Discover MCPs & agents
Loading MCPs and agents…
Loading MCPs and agents…
Generate Git commit messages using local or external LLM CLIs (Claude, Codex, etc.) — no API key required.
Jump to setup instructionsFetched from the repository for this visit.
Generate Git commit messages from staged diffs using your preferred LLM CLI.
git-ai-commit does not talk to LLM APIs directly. Instead, it delegates generation to existing LLM CLIs such as Claude Code, Antigravity, or Codex, so no API keys, SDKs, or vendor-specific integrations are required.
Package managers:
Homebrew:
brew install takai/tap/git-ai-commit
mise:
mise use -g github:takai/git-ai-commit@latest
Build from source (outputs to bin/):
mise run build
Put bin/git-ai-commit on your PATH to enable git ai-commit.
git ai-commit [options]
Common options:
--context VALUE Additional context for the commit message--context-file VALUE File containing additional context--prompt VALUE Bundled prompt preset: default, conventional, gitmoji, karma--prompt-file VALUE Path to a custom prompt file--engine VALUE Override engine name--amend Amend the previous commit-d, --diff Show staged diff in the editor (implies --edit)-e, --edit Open the generated commit message in an editor before committing-a, --all Stage modified and deleted files before generating the message-i, --include VALUE Stage specific files before generating the message-x, --exclude VALUE Hide specific files from the diff for message generation--debug-prompt Print the prompt before executing the engine--debug-command Print the engine command before execution-h, --help Show helpConfiguration is layered. Later layers override earlier ones:
| Priority | Source |
|---|---|
| 1 (lowest) | System git config (/etc/gitconfig) |
| 2 | Global git config (~/.gitconfig) |
| 3 | User TOML (~/.config/git-ai-commit/config.toml) |
| 4 | Repo TOML (git-ai-commit.toml or .git-ai-commit.toml at repo root) |
| 5 | Local git config (.git/config) |
| 6 | Worktree git config |
| 7 (highest) | Command-line flags |
Repository TOML config is applied only after an initial trust prompt, since it is a tracked file that could be set by a repo maintainer.
~/.config/git-ai-commit/config.toml for user-wide defaults, git-ai-commit.toml (or .git-ai-commit.toml) at the repo root for project defaults.
Example: Use Codex with Conventional Commits by default
engine = "codex"
prompt = "conventional"
Supported settings:
engine Default engine name (string)prompt Bundled prompt preset: default, conventional, gitmoji, karmaprompt_file Path to a custom prompt file (relative to the config file; must be within the repo root for repo TOML)engines.<name>.args Argument list for the engine command (array of strings)filter.max_file_lines Maximum lines per file in diff (default: 100)filter.exclude_patterns Additional glob patterns to exclude from difffilter.default_exclude_patterns Override built-in exclude patternsAll settings except engines.<name>.args can also be set via git config using the ai-commit section. This is useful for per-repository preferences in repositories you do not own, since .git/config is never committed or pushed.
# Set for the current repository only
git config --local ai-commit.engine claude
git config --local ai-commit.prompt conventional
# Or apply user-wide defaults
git config --global ai-commit.engine claude
git config --global ai-commit.prompt conventional
Supported keys:
| git config key | Equivalent TOML setting |
|---|---|
ai-commit.engine | engine |
ai-commit.prompt | prompt |
ai-commit.promptFile | prompt_file |
ai-commit.maxFileLines | filter.max_file_lines |
ai-commit.excludePatterns | filter.exclude_patterns |
ai-commit.defaultExcludePatterns | filter.default_exclude_patterns |
excludePatterns and defaultExcludePatterns support multiple values via git config --add:
git config --add ai-commit.excludePatterns '*.pb.go'
git config --add ai-commit.excludePatterns 'vendor/**'
Relative promptFile paths are resolved from the repo root for --local/--worktree scope, and from $HOME for --global scope. No path containment restriction applies — unlike repo TOML, git config cannot be set by a repository maintainer via push.
prompt and promptFile cannot both be set within the same scope. Setting both returns an error.
git-ai-commit treats LLMs as external commands, not as APIs. This design avoids direct network calls and API key management, and lets you reuse your existing LLM CLI setup.
Supported engines:
claudeagy (Antigravity CLI)codexBuilt-in defaults are applied when engines.<name>.args is not set.
For claude, defaults include:
-p --model haiku--settings "{\"attribution\":{\"commit\":\"\",\"pr\":\"\"}}" (prevents automatic Co-authored-by metadata)If no engine is configured, auto-detection tries commands in this order: claude → agy → codex. The first available command is used.
Gemini CLI removal: Google replaced Gemini CLI with Antigravity CLI (
agy), and Gemini CLI stopped serving requests for Google AI Pro/Ultra subscribers and free users on June 18, 2026.geminiis no longer a built-in engine: it is not auto-detected (with only Gemini CLI installed you getno engine configured), andengine = "gemini"without explicit arguments now fails with a message pointing atagy. Switch toengine = "agy", or keep running Gemini CLI by settingengines.gemini.argsyourself.
Any other engine name is treated as a direct command and executed with the prompt on stdin.
Example: Use ollama with gemma3:4b
engine = "ollama"
[engines.ollama]
args = ["run", "gemma3:4b"]
Bundled presets:
default – Commit messages aligned with the recommendations in Pro Gitconventional – Conventional Commits formatgitmoji – gitmoji-based commit messageskarma – Karma-style commit messagesPoint to a custom prompt file in TOML config:
engine = "claude"
prompt_file = "prompts/commit.md"
Or via git config (useful for repos you do not own):
git config --local ai-commit.promptFile /path/to/prompt.md
prompt and prompt_file (or promptFile in git config) are mutually exclusive within the same config layer. When they come from different layers, the higher-priority layer wins.
When the staged diff is large, it can exceed LLM context limits or degrade commit message quality. git-ai-commit automatically filters the diff to help LLMs focus on meaningful changes.
Default behavior:
filter.max_file_lines)Default exclude patterns:
**/*.lock, **/*-lock.json, **/*.lock.yaml, **/*-lock.yaml, **/*.lockfile**/*.min.js, **/*.min.css, **/*.map**/go.sumExample: Customize filtering
[filter]
max_file_lines = 300
# Add patterns to exclude (merged with defaults)
exclude_patterns = [
"**/vendor/**",
"**/*.generated.go",
"**/dist/**"
]
# Or replace defaults entirely
# default_exclude_patterns = ["**/my-lock.json"]
If you use Claude Code, you can integrate git-ai-commit as a plugin for a more convenient workflow.
/plugin marketplace add takai/git-ai-commit
/plugin install ai-commit@git-ai-commit-plugins
/ai-commit:staged - Commits only the currently staged changes/ai-commit:all - Stages all pending changes and commits as a single commit/ai-commit:organize - Organizes pending changes into multiple atomic commitsThis tool was inspired by how @negipo used a tool like this in his workflow to make his work much more efficient.
GitHub checked 159h ago - refresh overdue. Recently viewed repositories target hourly refresh.
Find a documented setup for your client. No sign-in, installation, or tool execution.
If this MCP is also published on mcpchannel.ai, you can subscribe from Browse and use the gateway config there instead.