Commit-AI is a CLI tool designed to automate the generation of meaningful commit messages for your Git repositories. It analyzes your git diff and crafts commit messages that follow the Conventional Commits spec.
Supported providers:
- openai — OpenAI API (e.g. gpt-4o), needs an API key
- claude-code — your Claude Code subscription, via the
claudeCLI - codex — your ChatGPT Codex subscription, via the
codexCLI - local — any OpenAI-compatible local endpoint (Ollama, LM Studio, llama.cpp, vLLM, …)
go install github.com/Jonath-z/commit-ai@latestcurl https://raw.githubusercontent.com/Jonath-z/commit-ai/master/install.sh | shSettings are persisted to ~/.config/commit-ai/config.json. You configure once, then just run commit-ai.
# Pick a provider
commit-ai config set provider openai # or claude-code, codex, local
# Provider-specific settings
commit-ai config set openai.api_key sk-...
commit-ai config set openai.model gpt-4o
commit-ai config set local.base_url http://localhost:11434/v1
commit-ai config set local.model llama3
commit-ai config set claude_code.model sonnet # optional
commit-ai config set codex.model gpt-5 # optional
# Inspect (API keys are redacted) or locate the config
commit-ai config show
commit-ai config pathBackward-compatible shortcut: commit-ai --apiKey sk-... saves the OpenAI key to config, sets provider=openai, and runs.
- Install and authenticate the Claude Code CLI (
claude login). commit-ai config set provider claude-code- Optional:
commit-ai config set claude_code.model sonnet
The tool shells out to claude -p, so usage counts against your existing Claude subscription.
- Install and authenticate the Codex CLI with your ChatGPT account.
commit-ai config set provider codex- Optional:
commit-ai config set codex.model gpt-5
The tool shells out to codex exec, so usage counts against your existing ChatGPT subscription.
Run any OpenAI-compatible server. With Ollama:
ollama serve
ollama pull llama3
commit-ai config set provider local
commit-ai config set local.base_url http://localhost:11434/v1
commit-ai config set local.model llama3Inside a git repo with unstaged changes:
commit-aiOverride the configured provider for a single run:
commit-ai --provider localIf you would like to contribute to the project, please fork the repository and open a pull request.
MIT — see the LICENSE file for details.