A CLI tool that leverages AI to automatically generate semantically correct, conventional commits compliant git messages.
- π€ AI-Powered - Analyzes diffs and understands the intent of your changes
- π Conventional Commits - Strictly adheres to v1.0.0 specification
- π¨ Interactive TUI - Beautiful prompts for staging, editing, and confirming
- π Multiple Providers - Claude Code, Gemini CLI, Codex, OpenRouter, OpenAI, Anthropic, Google AI Studio, Cerebras
- π Secure - API keys stored in keychain, never in config files
npm install -g @ai-git/cliAlso works with
bun,pnpm, andyarn.
brew tap sadiksaifi/tap/ai-gitcurl -fsSL https://ai-git.xyz/install | bashgit clone https://github.com/sadiksaifi/ai-git.git
cd ai-git
bun install
bun run buildRun ai-git in any git repository:
ai-gitOn first run, you'll be guided through a quick setup wizard to choose your AI provider.
Settings are saved to ~/.config/ai-git/config.json
Reconfigure:
ai-git configureSelf-update:ai-git upgrade
$ ai-git --help
Usage:
$ ai-git [command] [options]
AI-powered Conventional Commits
Commands:
configure Set up AI provider and model
upgrade Update ai-git to the latest version
Model:
--provider <id> Use a specific AI provider for this run
--model <id> Use a specific model for this run
Workflow:
-A, --stage-all Stage all changes before generating
-C, --commit Commit without confirmation
-P, --push Push to remote after committing
-H, --hint <text> Guide the AI with additional context
-X, --exclude <pattern> Skip files when staging (glob, regex, or path)
--dangerously-auto-approve Stage, commit, and push without prompts
--dry-run Preview the prompt without calling the AI
Info:
-v, --version Show version
-h, --help Show help# Use configured defaults
ai-git
# Override provider for this run
ai-git --provider gemini-cli --model gemini-3-flash-preview
# Use Codex with reasoning effort baked in
ai-git --provider codex --model gpt-5.3-codex-low
# Use OpenRouter
ai-git --provider openrouter --model anthropic/claude-sonnet-4-6
# Exclude files/directories from staging
ai-git -A --exclude "tests/" --exclude "*.test.ts"
# Automated (Be careful!)
ai-git --dangerously-auto-approve --hint "Refactored authentication module"
# Dry run works without installed provider CLI/API key
ai-git --dry-run -A| Provider | ID | Type | Requirements |
|---|---|---|---|
| Claude Code | claude-code |
CLI | Install CLI |
| Gemini CLI | gemini-cli |
CLI | Install CLI |
| Codex | codex |
CLI | Install CLI (npm install -g @openai/codex) |
| OpenRouter | openrouter |
API | Get API Key |
| OpenAI | openai |
API | Get API Key |
| Google AI Studio | google-ai-studio |
API | Get API Key |
| Anthropic | anthropic |
API | Get API Key |
| Cerebras | cerebras |
API | Get API Key |
Configure with ai-git configure
AI Git uses a three-tier configuration system:
- CLI flags (highest priority)
- Project config (
.ai-git.json) - Global config (
~/.config/ai-git/config.json)
{
"$schema": "https://raw.githubusercontent.com/sadiksaifi/ai-git/main/schema.json",
"provider": "claude-code",
"model": "haiku",
"defaults": {
"stageAll": false,
"commit": false,
"push": false
}
}{
"$schema": "https://raw.githubusercontent.com/sadiksaifi/ai-git/main/schema.json",
"provider": "openrouter",
"model": "anthropic/claude-sonnet-4-6"
}Tip: Add the
$schemaproperty for autocomplete and validation in your editor.Note: API keys are stored securely in keychain, not in config files.
The default prompt works excellently for most projects. Customize only for project-specific needs like ticket systems, monorepo scopes, or team style preferences.
| Field | Description | Example |
|---|---|---|
prompt.context |
Project-specific information | "React Native app. Jira tickets: PROJ-123" |
prompt.style |
Style/format preferences | "Always include scope. Keep body under 5 points." |
prompt.examples |
Custom commit examples (replaces defaults) | Array of commit message strings |
{
"$schema": "https://raw.githubusercontent.com/sadiksaifi/ai-git/main/schema.json",
"provider": "claude-code",
"model": "sonnet",
"prompt": {
"context": "Monorepo with packages: web, mobile, shared, api, docs, infra.",
"style": "Always use a scope from the valid list. Reference PR numbers in footer."
}
}{
"prompt": {
"examples": [
"feat(auth): add SSO integration\n\n- implement SAML 2.0 authentication\n- add identity provider configuration\n- support multiple IdP connections\n\nRefs: PROJ-456",
"fix(api): resolve rate limiting bypass\n\n- add per-user rate limit tracking\n- implement sliding window algorithm\n- add rate limit headers to responses"
]
}
}Note: Only provide
examplesif you have very specific formatting requirements.
# Install dependencies
bun install
# Run in development
bun run dev
# Test prompt generation without AI call
bun run dev --dry-run -A
# Disable update-check network calls (useful for tests/CI)
AI_GIT_DISABLE_UPDATE_CHECK=1 bun test
# Type check
bun run typecheck
# Build binary
bun run buildSee CONTRIBUTING.md for contribution guidelines.