opencommit/How To/Mise OpenCommit with AzureOpenAI
Properties
- tags
- Diataxis/How To
How To use mise home-directory config to drive opencommit with OpenAI/API delivered through Azure for Conventional Commits
Goal
Preconditions
Procedure
1. Install tools globally with mise
2. Create or open
~/.config/mise/config.toml- The following global config makes the task available in every repo:
- toml
[tasks.oco] description = "opencommit - AI-generated Conventional Commit on staged files" run = "opencommit" [tasks.oco.env] OCO_AI_PROVIDER = "azure" OCO_API_URL = "https://your-resource.openai.azure.com/" OCO_API_KEY = "your-azure-openai-api-key" OCO_MODEL = "gpt-4o-mini" # your Azure deployment name OCO_EMOJI = true OCO_DESCRIPTION = false
- Save and exit.
miseauto-reloads configs on next run.
- The following global config makes the task available in every repo:
3. (Optional) keep secrets in 1Password
- Replace literal values with secret references, e.g.
OCO_API_KEY = "op://AI/AzureOpenAI/api-key"andOCO_API_URL = "op://AI/AzureOpenAI/endpoint-url"– these resolve at runtime when you wrap the task withop run -- mise run oco. The pattern is identical to other mise examples that embed API secrets insideenvblocks.
- Replace literal values with secret references, e.g.
4. Commit with a single command
Stage your work:
git add -ARun:
mise run oco --type feat --scope auth
OpenCommit streams the generated message, then executesgit commit -m "<msg>".
Troubleshooting
- "Provider not found" → ensure
OCO_AI_PROVIDERis set to"azure". - Azure auth errors → verify your
OCO_API_URLandOCO_API_KEYare correct in the Azure OpenAI Service. - Model not found → ensure
OCO_MODELmatches your Azure deployment name (not the model name). - Unexpected commit style → adjust
OCO_EMOJIandOCO_DESCRIPTIONsettings in the env block.
- "Provider not found" → ensure
References
- OpenCommit Documentation - Official OpenCommit repository with Azure OpenAI configuration examples
- Template of
envin task blocks mise configandmise use -gfor editing global configs