Stop writing fix stuff commits.
ai-commit reads your staged diff and generates a clean, conventional commit message in under a second.
$ git add .
$ ai-commit
✨ Generated commit message:
feat(auth): add refresh-token rotation with audit log
- Rotate refresh tokens on every use
- Persist token family for compromise detection
- Log all rotations to security_audit table
Accept this message? [Y/n/edit/regen]Install • Usage • Configuration • Why?
pip install ai-commitcurl -fsSL https://raw.githubusercontent.com/kasimmj/ai-commit/main/install.sh | bashgit clone https://github.com/kasimmj/ai-commit
cd ai-commit && pip install -e .git add .
ai-commitai-commit --model gpt-4o-mini # OpenAI
ai-commit --model claude-haiku-4 # Anthropic
ai-commit --model llama3.2 # Local via Ollamaai-commit --lang ar
# → "feat(auth): إضافة دورة تجديد رموز التحديث"ai-commit --dry-runai-commit --yesai-commit --install-hookNow git commit (without -m) opens with the AI message pre-filled in your editor.
Create ~/.ai-commit.toml:
[default]
model = "gpt-4o-mini"
language = "en"
emoji = true
max_diff_lines = 500
[providers.openai]
api_key_env = "OPENAI_API_KEY"
base_url = "https://api.openai.com/v1"
[providers.anthropic]
api_key_env = "ANTHROPIC_API_KEY"
[providers.ollama]
base_url = "http://localhost:11434"
[prompts]
# Customize the system prompt
style = "conventional" # conventional | gitmoji | plain
length = "concise" # concise | detailedEnv vars override:
AI_COMMIT_MODEL=claude-haiku-4 ai-commit| Without ai-commit | With ai-commit |
|---|---|
fix stuff |
fix(api): handle 429 from upstream gracefully |
wip |
wip(dashboard): export CSV partial — handle pagination next |
updates |
chore(deps): bump axios 1.6.0 → 1.7.2 for ReDoS fix |
asdfasdf |
refactor(payments): extract Stripe client into adapter |
You spend 3 seconds instead of 90 seconds, and your git log actually tells the story of your project.
- Reads
git diff --cached(your staged changes) - Detects the most-changed file types and scope
- Sends a focused prompt to the chosen model
- Parses the response into a conventional commit format
- Shows you the result, lets you accept / edit / regenerate / cancel
The prompt is designed for fast, cheap models (Haiku, GPT-4o-mini, llama3.2:3b). You don't need GPT-4 for a commit message.
- Diffs are sent to the model you choose
- Use a local model (Ollama) for zero data leaving your machine
- Secrets in the diff are auto-redacted (regex patterns: API keys, tokens, passwords) before sending
MIT © 2026 Kasim Mohammed