Help us improve
Share bugs, ideas, or general feedback.
npx claudepluginhub takai/git-ai-commitGenerate Git commit messages from staged diffs and apply them automatically, using git-ai-commit as the execution backend.
Share bugs, ideas, or general feedback.
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, Gemini, 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/):
make 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:
claudegeminicodexBuilt-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)