ai-commit

AI-Commit

commit

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


Installation

One-liner script

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 sudo to move the binary.

Build from source

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/

Features (overview)


Configuration

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.

Example config.yaml

authorName: "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

Environment variables

For each provider, the code observes:


Usage

  1. Stage changes
git add .
  1. Generate a commit message (interactive)
ai-commit

TUI keybindings

Style review display:


CLI Reference

ai-commit [flags]
ai-commit review
ai-commit summarize

Main flags

Workflow control

Subcommands

The “fuzzy finder” is embedded via a Go library; no external fzf binary is required.


Examples

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 matrix

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
Google 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_KEY and ${PROVIDER}_BASE_URL (uppercase provider name).


TUI details


Style review behavior (--review-message)


Commit templates

You can wrap the final AI message with a template, e.g.:

template: |
  {COMMIT_MESSAGE}

  Branch: {GIT_BRANCH}

Placeholders:


Limits & filtering


Troubleshooting


Security & privacy


License

MIT (project’s chart mentions MIT; keep the repo’s LICENSE in sync with public statements).


Changelog / Roadmap (short)