Setup AI Commit Suggestions
Enable AI-powered commit message suggestions when running gon push. Uses the Anthropic API (Claude Haiku) to generate conventional commit messages based on your changes.
1. Get an Anthropic API key
Create a new API key
Copy the key (starts with
sk-ant-)
2. Configure gon-cli
gon config set anthropic_api_key sk-ant-api03-YOUR_KEY_HERE
3. Use it
Run gon push as usual. When prompted for a commit message:
- Enter — accepts the AI suggestion shown in brackets
- ↑↓ arrows — browse conventional commit type prefixes (
feat:,fix:, etc.) - Type + Tab — autocomplete type prefix (e.g.
fi+ Tab →fix:) - Type freely — write your own message (validated against conventional commit format)
How it works
- Calls the Anthropic Messages API with Claude Haiku (~1 second)
- Sends only the module name and list of changed file names (no file contents)
- Costs less than $0.001 per suggestion
- Falls back gracefully if the API is unavailable
Verify setup
gon config get anthropic_api_key
Should output your key. If not set, gon push skips AI suggestions and shows a plain prompt.