AI-assisted git commit message generator with multi-provider LLM support.
git-msg watches your staged diff, calls an LLM, and drops a commit message
into an interactive TUI where you can confirm, edit, or abort — before anything
is committed.
git add .
git-msg generate
Generated commit message:
> Use as-is
Edit inline
Open $EDITOR
Abort
feat(config): add XDG-compliant path resolution via internal/dirs
- Multi-provider — OpenAI, Anthropic (Claude), Google Gemini, Ollama (local)
- Interactive TUI review — confirm, edit inline, open
$EDITOR, or abort - Git hook integration — install as
prepare-commit-msgfor automatic generation on everygit commit - Customisable prompts — Jinja2-style templates with
{{ diff }},{{ branch }},{{ log }}variables - Secure credentials — API keys stored in the system keychain, never in config files
- XDG config — all config lives under
~/.config/mdstn/git-msg/
brew tap madstone-tech/tap
brew install git-msggo install github.com/madstone-tech/git-msg@latestDownload the latest binary for your platform from the
Releases page,
extract, and move to a directory on your PATH:
tar -xzf git-msg_Darwin_arm64.tar.gz
sudo mv git-msg /usr/local/bin/1. Run any git-msg command — the first-run wizard launches automatically
when no config file exists:
git-msg — first-run setup
─────────────────────────
Select LLM provider
> Anthropic (Claude)
OpenAI (GPT)
Google Gemini
Ollama (local)
For Ollama, git-msg queries ollama list and presents a model picker.
For cloud providers, you enter a model name and API key (stored in the keychain).
2. Stage some changes and generate:
git add src/
git-msg generate3. (Optional) Install the git hook so generation happens automatically on
every git commit:
git-msg hook installSee Getting Started for a full walkthrough.
| Provider | Default model | Needs API key |
|---|---|---|
anthropic |
claude-haiku-4-5 |
Yes |
openai |
gpt-4o-mini |
Yes |
gemini |
gemini-1.5-flash |
Yes |
ollama |
(from ollama list) | No |
Override the provider for a single run:
git-msg generate --provider ollamaSee Providers for setup instructions for each provider.
Config file: ~/.config/mdstn/git-msg/config.toml
[provider]
name = "anthropic"
model = "claude-haiku-4-5"
[ollama]
host = "http://localhost:11434"
[prompt]
default = "conventional"
[hook]
global = falsegit-msg config set provider.name ollama
git-msg config set provider.model llama3
git-msg config showSee Configuration for all keys and credential management.
git-msg ships with a built-in conventional template that follows the
Conventional Commits specification.
Create your own templates and edit them in $EDITOR:
git-msg prompt list
git-msg prompt show conventional
git-msg prompt edit conventional
git-msg prompt reset conventionalSee Prompt Templates for the template format and variable reference.
| Document | Description |
|---|---|
| Getting Started | Installation, first run, and daily workflow |
| Configuration | Config file, all keys, credential storage |
| Providers | Setup guide for each LLM provider |
| Prompt Templates | Template format, variables, and customisation |
| Git Hook | Automatic generation via prepare-commit-msg |
| CLI Reference | Complete command and flag reference |
git clone https://github.com/madstone-tech/git-msg
cd git-msg
task build # compile to bin/git-msg
task test # run test suite
task ci # fmt + vet + lint + constitution + test + buildRequirements: Go 1.26+, Task