AI-powered commit message generator following the Conventional Commits spec. Analyzes your staged git diff and suggests a ready-to-use commit message, which you confirm before committing.
Supports Anthropic, OpenAI, and Ollama (runs locally, no API key needed).
There are similar tools out there (opencommit, aicommits), but aicommit focuses on:
- Native support for 3 providers, including Ollama for anyone who doesn't want to depend on a paid API.
- Commit messages generated in whatever language you configure.
- Interactive confirmation before committing (the AI suggests, you decide).
npm install -g @smeltier/aicommitAnthropic or OpenAI (equires an API key):
export AICOMMIT_PROVIDER=anthropic # or openai
export AICOMMIT_API_KEY=your-api-keyOllama (runs locally, no API key needed):
export AICOMMIT_PROVIDER=ollamaMake sure you have Ollama installed and running (ollama serve), with the model pulled (ollama pull llama3).
export AICOMMIT_LANG=en # default: enAdd the lines above to your .zshrc or .bashrc so you don't have to set them every time:
echo 'export AICOMMIT_PROVIDER=anthropic' >> ~/.zshrc
echo 'export AICOMMIT_API_KEY=your-api-key' >> ~/.zshrcThen reload your shell (source ~/.zshrc) or open a new terminal.
git add .
aicommitaicommit shows the suggested message and asks for confirmation before committing:
Commit message: feat(auth): add token refresh logic
Confirm? (Y/n)
| Provider | Default model | Requires API key |
|---|---|---|
| anthropic | claude-haiku-4-5-20251001 |
Yes |
| openai | gpt-4o-mini |
Yes |
| ollama | llama3 |
No |
To use a different model:
export AICOMMIT_MODEL=claude-opus-4-6