
AI-Commit AI-Commit streamlines your Git workflow with AI—focused on three core tasks that matter
It supports multiple providers:
Focus on better commits, consistent standards, and reduced toil—right from your terminal.
Repository: https://github.com/renatogalera/ai-commit
The script detects your OS/arch, downloads the latest release, makes it executable, and installs to /usr/local/bin (using sudo when needed).
curl -sL https://raw.githubusercontent.com/renatogalera/ai-commit/main/scripts/install_ai_commit.sh | bash
If you’re not root, it’ll prompt for
sudoto move the binary.
git clone https://github.com/renatogalera/ai-commit.git
cd ai-commit
go build -o ai-commit ./cmd/ai-commit
sudo mv ai-commit /usr/local/bin/
ai-commit review) on staged diffs (style, refactor hints, simple risks).--review-message) to enforce clarity & quality.--force) for scripts/CI.--semantic-release, with optional --manual-semver).--interactive-split) with chunk selection/inversion.--emoji) mapped to commit types.--template) and prompt template (promptTemplate in config).On first run, AI-Commit creates:
~/.config/ai-commit/config.yaml
Path is derived from the binary name; if you rename the binary, the folder matches the new name.
config.yamlauthorName: "Your Name"
authorEmail: "youremail@example.com"
provider: "phind" # default provider if no CLI flag is given
providers:
phind:
apiKey: "" # Optional for Phind
model: "Phind-70B"
baseURL: "https://extension.phind.com/agent" # Example endpoint
openai:
apiKey: ""
model: "chatgpt-4o-latest"
baseURL: "https://api.openai.com/v1"
google:
apiKey: ""
model: "models/gemini-2.5-flash"
baseURL: "https://generativelanguage.googleapis.com"
anthropic:
apiKey: ""
model: "claude-3-7-sonnet-latest"
baseURL: "https://api.anthropic.com"
deepseek:
apiKey: ""
model: "deepseek-chat"
baseURL: "https://api.deepseek.com/v1"
openrouter:
apiKey: ""
model: "openrouter/auto"
baseURL: "https://openrouter.ai/api/v1"
ollama:
apiKey: "" # Not required
model: "llama2"
baseURL: "http://localhost:11434"
limits:
diff:
enabled: false
maxChars: 0
prompt:
enabled: false
maxChars: 0
semanticRelease: false
interactiveSplit: false
enableEmoji: false
commitType: "" # Optional default
template: "" # Optional commit message template; can use {COMMIT_MESSAGE} and {GIT_BRANCH}
promptTemplate: "" # Optional global prompt template for AI prompts
commitTypes:
- type: "feat" emoji: "✨"
- type: "fix" emoji: "🐛"
- type: "docs" emoji: "📚"
- type: "style" emoji: "💎"
- type: "refactor" emoji: "♻️"
- type: "test" emoji: "🧪"
- type: "chore" emoji: "🔧"
- type: "perf" emoji: "🚀"
- type: "build" emoji: "📦"
- type: "ci" emoji: "👷"
lockFiles:
- "go.mod"
- "go.sum"
Notes
authorName/authorEmail are used for git authoring by CommitChanges. Set these to your identity (the tool does not read your git config).promptTemplate influences the prompts for message generation, code reviews, and style checks.limits.diff/prompt allow truncation/summarization before sending to providers.For each provider, the code observes:
${PROVIDER}_API_KEY (e.g., OPENAI_API_KEY, GOOGLE_API_KEY, ANTHROPIC_API_KEY, DEEPSEEK_API_KEY, PHIND_API_KEY, OPENROUTER_API_KEY)${PROVIDER}_BASE_URL (e.g., OPENAI_BASE_URL, GOOGLE_BASE_URL, …, OLLAMA_BASE_URL)git add .
ai-commit
TUI keybindings
Enter or yr (limited attempts)te (save with Ctrl+s, cancel Esc)p (save with Ctrl+s, cancel Esc)l (exit diff with Esc or q)?q / Esc / Ctrl+CStyle review display:
- If the selected provider does not stream, style-review suggestions (when
--review-messageis enabled) are shown in the TUI.- For streaming providers, style review is not yet shown live inside the TUI.
ai-commit [flags]
ai-commit review
ai-commit summarize
--provider — one of: openai, google, anthropic, deepseek, phind, ollama, openrouter--model — overrides providers.<name>.model--apiKey — overrides providers.<name>.apiKey or ${PROVIDER}_API_KEY--baseURL — overrides providers.<name>.baseURL or ${PROVIDER}_BASE_URL--language — language for prompts/responses (default: english)--commit-type — force a Conventional Commit type (feat, fix, …)--template — apply a template to the final message (supports {COMMIT_MESSAGE} and {GIT_BRANCH})--review-message — run AI style review on the generated commit message--force — non-interactive; prints style feedback (if any) then commits immediately--semantic-release — compute next version from latest commit and create a tag--manual-semver — with --semantic-release, choose version via TUI--interactive-split — open the chunk-based split TUIreview — AI code review of staged changes
ai-commit review
summarize — pick a commit via an in-terminal fuzzy finder and generate an AI summary
ai-commit summarize
The “fuzzy finder” is embedded via a Go library; no external
fzfbinary is required.
Interactive, English, OpenAI
ai-commit --provider=openai --model=chatgpt-4o-latest --language=english
Force commit + style review (non-interactive)
ai-commit --force --review-message
Interactive with style review (non-streaming providers show feedback in TUI)
ai-commit --provider=google --model=models/gemini-2.5-flash --review-message
Use Anthropic via env vars
export ANTHROPIC_API_KEY=sk-...
ai-commit --provider=anthropic --model=claude-3-7-sonnet-latest
DeepSeek with explicit base URL
ai-commit --provider=deepseek --model=deepseek-chat --baseURL=https://api.deepseek.com/v1 --apiKey=sk-...
Phind (no API key by default)
ai-commit --provider=phind --model=Phind-70B --baseURL=https://extension.phind.com/agent
Ollama (local)
ai-commit --provider=ollama --model=llama2 --baseURL=http://localhost:11434
OpenRouter
ai-commit --provider=openrouter --model=openrouter/auto --apiKey=sk-...
Interactive split
ai-commit --interactive-split
Semantic release (manual selection)
ai-commit --semantic-release --manual-semver
| Provider | API key required | Default model (example) | Base URL (example) | Streaming in code |
|---|---|---|---|---|
| Phind | No (optional) | Phind-70B |
https://extension.phind.com/agent |
Yes |
| OpenAI | Yes | chatgpt-4o-latest |
https://api.openai.com/v1 |
Yes |
| Yes | models/gemini-2.5-flash |
https://generativelanguage.googleapis.com |
No | |
| Anthropic | Yes | claude-3-7-sonnet-latest |
https://api.anthropic.com |
Yes |
| DeepSeek | Yes | deepseek-chat |
https://api.deepseek.com/v1 |
Yes |
| OpenRouter | Yes | openrouter/auto |
https://openrouter.ai/api/v1 |
Yes |
| Ollama | No | llama2 |
http://localhost:11434 |
No |
Env vars:
${PROVIDER}_API_KEYand${PROVIDER}_BASE_URL(uppercase provider name).
l to inspect the full Git diff inside the TUI.t.--review-message)--force): style feedback prints to the terminal before the commit. If issues are found, it prints a short, styled block; if not, it remains quiet or shows “No issues found.”Interactive:
You can wrap the final AI message with a template, e.g.:
template: |
{COMMIT_MESSAGE}
Branch: {GIT_BRANCH}
Placeholders:
{COMMIT_MESSAGE} — replaced with the AI-generated (and type-prefixed) message{GIT_BRANCH} — resolved via git at runtimelockFiles are filtered out from the AI prompt to reduce noise.Limits:
limits.diff: truncate/summarize diffs before promptinglimits.prompt: hard cap the final prompt size (truncated with ...)--apiKey, the ${PROVIDER}_API_KEY environment variable, or a non-empty providers.<name>.apiKey is set.authorName/authorEmail in config.yaml to avoid commits with default values.MIT (project’s chart mentions MIT; keep the repo’s LICENSE in sync with public statements).