_ ____ _ _
__ _ _ _| |_ ___ / ___|___ _ __ ___ _ __ ___ (_) |_
/ _` | | | | | __/ _ \____| | / _ \| '_ ` _ \| '_ ` _ \ | | __|
| (_| | | |_| | || (_) |____| |__| (_) | | | | | | | | | | || | |_
\__,_| \__,_|\__\___/ \____\___/|_| |_| |_|_| |_| |_|/ |\__|
AI-powered git commit messages from the command line.
$ git add auto_commit/auto_commit/gemini_provider.py
$ auto-commit
Analyzing 1 files (+24 -10 lines)…
╭─ Suggested commit ─────────────────────────────────────────────╮
│ refactor(gemini): migrate SDK integration to google-genai │
│ │
│ - replace deprecated google-generativeai client usage │
│ - configure GenerateContentConfig for tokens and temperature │
│ - keep provider interface compatible with existing flow │
╰────────────────────────────────────────────────────────────────╯
[C]opy [E]dit [A]ccept & commit [R]ejectauto-commit in action
- 6 AI providers with curated model lists (OpenAI 3, Anthropic 3, Gemini 2, DeepSeek 2, Grok 3, Mistral 3).
- Smart diff chunking for large repositories using file boundaries.
- Interactive configuration TUI powered by Rich and questionary.
- Conventional Commits output format with concise subject/body structure.
- One-command install from PyPI.
pip install auto-commit-aiThen configure:
auto-commit configThen use:
git add .
auto-commitBefore you start, make sure you have:
| Requirement | Minimum version | Check with |
|---|---|---|
| Python | 3.10+ | python --version |
| Git | any | git --version |
| pip | 23+ | pip --version |
The easiest way. Works on macOS, Linux, and Windows.
pip install auto-commit-aiVerify the installation:
auto-commit --version# 1. Clone the repository
git clone https://github.com/apexi777/auto-commit-ai.git
cd auto-commit-ai
# 2. Create and activate a virtual environment (recommended)
python -m venv .venv
# macOS / Linux:
source .venv/bin/activate
# Windows:
.venv\Scripts\activate
# 3. Install in editable mode with dev dependencies
pip install -e ".[dev]"
# 4. Verify
auto-commit --versionYou only need one API key — for whichever provider you choose. Pick any from the table below:
| Provider | Free tier | Get your key |
|---|---|---|
| OpenAI | No | https://platform.openai.com/api-keys |
| Anthropic | No | https://console.anthropic.com/keys |
| Gemini | Yes ✓ | https://aistudio.google.com/apikey |
| DeepSeek | Yes ✓ | https://platform.deepseek.com/api_keys |
| Grok | No | https://console.x.ai |
| Mistral | Yes ✓ | https://console.mistral.ai/api-keys |
💡 Not sure which to pick? Start with Gemini or DeepSeek — both offer a free tier with no credit card required.
Run the interactive setup wizard:
auto-commit configYou will be guided through three steps:
? Select AI provider:
❯ Anthropic
OpenAI
Gemini
DeepSeek
Grok
Mistral
? Select model:
❯ claude-sonnet-4-5
claude-opus-4-5
claude-haiku-4-5
? Enter your API key: sk-ant-****
Your settings are saved to ~/.auto_commit/config.json.
Alternatively, set an environment variable to skip the config step entirely:
# macOS / Linux — add to ~/.bashrc or ~/.zshrc
export ANTHROPIC_API_KEY="sk-ant-your-key-here"
# Windows PowerShell
$env:ANTHROPIC_API_KEY = "sk-ant-your-key-here"# 1. Make changes to your code
# 2. Stage them as usual
git add .
# 3. Run auto-commit — it analyzes the diff and suggests a message
auto-commitExample output:
╭─ Suggested commit ──────────────────────────────────╮
│ feat(auth): add JWT refresh token support │
│ │
│ - implement token rotation on each request │
│ - add 401 handler with automatic retry │
│ - store refresh token in httpOnly cookie │
╰──────────────────────────────────────────────────────╯
[C] Copy [E] Edit [A] Accept & commit [R] Reject
auto-commit --auto
# Generates the message and runs git commit immediatelyauto-commit config # open interactive menu
auto-commit config --show # print current config| Problem | Solution |
|---|---|
command not found: auto-commit |
Make sure pip's bin dir is in your PATH. |
Try: python -m auto_commit |
|
Invalid API key |
Re-run auto-commit config and re-enter key |
No staged changes |
Run git add . first |
Account out of credits |
Top up balance or switch provider |
| Slow response on large repos | Normal — large diffs are chunked automatically |
Full error logs are written to ~/.auto_commit/error.log.
| Provider | Models | Env Variable |
|---|---|---|
| OpenAI | gpt-4o, gpt-4-turbo, gpt-3.5-turbo | OPENAI_API_KEY |
| Anthropic | claude-opus-4-5, claude-sonnet-4-5, claude-haiku-4-5 | ANTHROPIC_API_KEY |
| Gemini | gemini-2.0-flash, gemini-1.5-pro | GEMINI_API_KEY |
| DeepSeek | deepseek-chat, deepseek-reasoner | DEEPSEEK_API_KEY |
| Grok | grok-3, grok-3-mini, grok-2 | XAI_API_KEY |
| Mistral | mistral-large-latest, mistral-small-latest, codestral-latest | MISTRAL_API_KEY |
| Command | Description |
|---|---|
auto-commit |
Generate commit message |
auto-commit --auto |
Generate + commit instantly |
auto-commit config |
Open interactive settings |
auto-commit config --show |
Print current configuration |
Config file path: ~/.auto_commit/config.json
Environment variables take priority over values stored in the config file.
{
"provider": "anthropic",
"model": "claude-sonnet-4-5",
"api_keys": {
"openai": "",
"anthropic": "",
"gemini": "",
"deepseek": "",
"grok": "",
"mistral": ""
},
"language": "auto",
"max_tokens": 512,
"temperature": 0.3
}git clone https://github.com/apexi777/auto-commit-ai
cd auto-commit-ai
pip install -e ".[dev]"
pytest -qGuidelines:
- Use Conventional Commits.
- Add or update tests for any new provider behavior.
- Include a clear PR description: problem, solution, and verification steps.
MIT License — Copyright (c) 2026 Babich Andrey