git-msg stores all configuration at:
~/.config/mdstn/git-msg/config.toml
If XDG_CONFIG_HOME is set, that path is used instead of ~/.config.
The file is created by the setup wizard on first use. API keys are never written here — they live in the system keychain.
[provider]
name = "anthropic" # openai | anthropic | gemini | ollama
model = "claude-haiku-4-5"
[ollama]
host = "http://localhost:11434"
[prompt]
default = "conventional"
[hook]
global = false| Key | Type | Default | Description |
|---|---|---|---|
provider.name |
string | anthropic |
LLM provider to use |
provider.model |
string | claude-haiku-4-5 |
Model name for the chosen provider |
ollama.host |
string | http://localhost:11434 |
Base URL of your Ollama instance |
prompt.default |
string | conventional |
Template name used when --template is not given |
hook.global |
bool | false |
Whether hook install targets the global hooks path |
git-msg config showgit-msg config get provider.name
git-msg config get provider.modelgit-msg config set provider.name openai
git-msg config set provider.model gpt-4o
git-msg config set ollama.host http://192.168.1.10:11434
git-msg config set prompt.default conventional
git-msg config set hook.global trueChanges take effect immediately on the next git-msg invocation.
API keys are stored in the system keychain using service name git-msg
and the provider name as the account key (e.g. anthropic, openai).
- System keychain (
git-msg/<provider>) - Environment variable
GIT_MSG_<PROVIDER>_API_KEY - Error with remediation instructions
export GIT_MSG_ANTHROPIC_API_KEY=sk-ant-...
export GIT_MSG_OPENAI_API_KEY=sk-...
export GIT_MSG_GEMINI_API_KEY=AIza...This is useful in CI, Docker, or any environment without an interactive keychain.
Re-run the setup wizard by removing your config and running any command:
rm ~/.config/mdstn/git-msg/config.toml
git-msg generate --dry-runThe wizard will prompt for a new key and overwrite the keychain entry.
# Switch permanently
git-msg config set provider.name ollama
git-msg config set provider.model fast-coder:latest
# Switch for a single run only
git-msg generate --provider openai --provider-model gpt-4oDelete the config file. The next command will trigger the setup wizard:
rm ~/.config/mdstn/git-msg/config.tomlTo also remove all user prompt template overrides:
rm -rf ~/.config/mdstn/git-msg/Use XDG_CONFIG_HOME to isolate configurations:
XDG_CONFIG_HOME=/path/to/work-config git-msg generate
XDG_CONFIG_HOME=/path/to/personal-config git-msg generateEach will read from $XDG_CONFIG_HOME/mdstn/git-msg/config.toml.