Generate conventional commit messages from your staged git diff using Azure OpenAI.
- Builds a suggested conventional commit message from staged changes.
- Warns on large commits.
- Optional Jira ticket prefix (e.g.
JIRA-123 fix(auth): ...). - Interactive flow: accept, edit, or cancel.
- Node.js 22+.
- Git repo with staged changes.
- Azure OpenAI credentials.
Local development:
npm install
npm linkThen run:
smart-commitYou can also run directly:
node bin/cli.jsCreate a .env file in this repo (or set environment variables in your shell):
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com
AZURE_OPENAI_API_KEY=your-key
AZURE_OPENAI_DEPLOYMENT=your-deployment-name
AZURE_OPENAI_API_VERSION=2024-02-15-preview
AZURE_OPENAI_DEPLOYMENT defaults to gpt-4o-mini if not set.
- Stage changes:
git add .- Run:
smart-commit- If prompted, enter a Jira ticket (optional). If provided, it prefixes the commit message.
- Only staged changes are analyzed.
- Large commits are flagged when insertions exceed the threshold in git shortstat.