Good Commit is a fast Rust CLI that writes git commit messages with AI. It stages changes (optional), generates a message, shows a preview, commits, and can push. Use OpenAI (including GPT-5) or local Ollama, with safe handling for large diffs.
Keywords: git ai commit, commit message generator, OpenCommit alternative, conventional commits.
- One command:
gorg.to stage, generate, commit, and push (optional). - Fast and lightweight: Rust, single binary, no runtime.
- GPT-5 + Ollama support: cloud or local.
- Large diff safe: summarization fallback prevents token blowups.
- Conventional commits by default, with quick overrides.
brew tap Bikz/tap
brew install goodcommitnpm install -g goodcommitcurl -s https://raw.githubusercontent.com/Bikz/goodcommit/main/install.sh | shgoodcommit setup
gSetup asks for your provider, default push behavior, and (if OpenAI) your API key. You can also set OPENAI_API_KEY or GOODCOMMIT_OPENAI_API_KEY instead of storing it in config. Create a key at:
https://platform.openai.com/api-keys
# AI commit (uses defaults)
g
# Use your own message
g "fix: resolve auth session leak"
# Skip push
g --no-push
# Show message without committing
g --dry-run
# Interactive staging
g --interactive
# Local commit only (no push)
g -l
# Guided split into multiple commits
goodcommit splitConfig precedence: CLI flags > repo config > global config > env > defaults.
Config files:
- Global:
~/.config/goodcommit/config.toml - Repo:
.goodcommit.toml
Example:
provider = "openai"
model = "gpt-5-nano-2025-08-07"
push = true
conventional = true
one_line = trueIgnore files (for AI prompt only):
- Global:
~/.config/goodcommit/ignore - Repo:
.goodcommit-ignore
Set your key:
export OPENAI_API_KEY="..."ollama pull qwen2.5-coder:1.5bgoodcommit hook install
goodcommit hook uninstallIssues and PRs are welcome. Please open an issue for bugs or feature requests, and open a PR for fixes or docs. For larger changes, start with an issue so we can align.
MIT