Generate Git commit messages from staged diffs using your preferred LLM CLI.
Package managers:
Homebrew:
brew tap takai/tap
brew install git-ai-commitmise:
mise use -g github:takai/git-ai-commit@latestBuild from source (outputs to bin/):
make buildPut bin/git-ai-commit on your PATH to enable git ai-commit.
git ai-commit [options]Common options:
--context VALUEAdditional context for the commit message--context-file VALUEFile containing additional context--prompt VALUEBundled prompt preset:default,conventional,gitmoji,karma--prompt-file VALUEPath to a custom prompt file--engine VALUEOverride engine name--amendAmend the previous commit-a,--allStage modified and deleted files before generating the message-i,--include VALUEStage specific files before generating the message--debug-promptPrint the prompt before executing the engine--debug-commandPrint the engine command before execution-h,--helpShow help
Configuration is layered, allowing global defaults with per-repository overrides:
- User config:
~/.config/git-ai-commit/config.toml - Repo config:
.git-ai-commit.tomlat the repository root - Command-line flags
This makes it easy to keep personal preferences (engine, style) while enforcing repository-specific commit rules. Repository config is applied only after an initial trust prompt.
Example: Use Codex with Conventional Commits by default
engine = "codex"
prompt = "conventional"Supported settings:
engineDefault engine name (string)promptBundled prompt preset:default,conventional,gitmoji,karmaprompt_filePath to a custom prompt file (relative to the config file)engines.<name>.argsArgument list for the engine command (array of strings)
Supported engines:
claudegeminicodex
If no engine is configured, auto-detection tries commands in this order: claude → gemini → codex. The first available command is used.
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 live in internal/config/assets/:
default– Commit messages aligned with the recommendations in Pro Gitconventional– Conventional Commits formatgitmoji– gitmoji-based commit messageskarma– Karma-style commit messages
Example: Use a custom prompt file
engine = "claude"
prompt_file = "prompts/commit.md"Note: prompt and prompt_file are mutually exclusive within the same config file. If both are set, an error is returned. When settings come from different layers (user config vs repo config), the later layer wins.
This tool was inspired by how @negipo used a tool like this in his workflow to make his work much more efficient.