AI-powered git commit messages that actually make sense.
Stop writing fix bug, update stuff, and wip forever. commitai reads your staged diff and generates meaningful Conventional Commits messages — powered by Claude, GPT-4, or a fully local Ollama model (free, no API key needed).
$ git add -p
$ commitai --provider ollama
Branch: main
[1] feat(auth): add JWT refresh token rotation
[2] feat: implement sliding session expiry for tokens
[3] fix(auth): prevent token reuse after refresh
[4] refactor(auth): extract token lifecycle management
[5] security: rotate JWT tokens on each refresh request
Select (1-5), edit, or quit: 1
✓ Committed: feat(auth): add JWT refresh token rotation
- Multi-provider — Claude (Anthropic), GPT-4 (OpenAI), or local Ollama (free!)
- Context-aware — uses your branch name and recent commits for style consistency
- Interactive — pick a suggestion, edit it, or bail out
- Conventional Commits — enforces
type(scope): descriptionformat - Git hook — install once, runs automatically on every
git commit - Zero config — just set your API key and go
pipx install commitai-cliOr with pip:
pip install commitai-cli# 1. Install Ollama: https://ollama.com
ollama pull llama3.2
# 2. Run in your repo
git add .
commitai --provider ollamaexport ANTHROPIC_API_KEY=sk-ant-...
git add .
commitaipip install 'commitai-cli[openai]'
export OPENAI_API_KEY=sk-...
git add .
commitai --provider openaicommitai [OPTIONS] COMMAND [ARGS]...
Options:
-p, --provider [anthropic|openai|ollama] AI provider [default: anthropic]
-m, --model TEXT Model override
-n, --count INTEGER Number of suggestions [default: 5]
-y, --yes Auto-select first suggestion
-v, --version Show version and exit.
Commands:
install-hook Install as a prepare-commit-msg git hook.
| Provider | Default Model | API Key | Cost |
|---|---|---|---|
ollama |
llama3.2 | ❌ No | Free (local) |
anthropic |
claude-haiku-4-5 | ✅ Yes | ~$0.001/commit |
openai |
gpt-4o-mini | ✅ Yes | ~$0.001/commit |
MIT — see LICENSE.