AI-powered commit message generator with support for multiple AI providers. Generate professional commit messages in Conventional Commits format.
- π― Multiple AI Providers: Claude (Anthropic), GPT-4 (OpenAI), Gemini (Google)
- π Conventional Commits: Automatic formatting in standard format
- β‘ Quick Setup: Configure once and use forever
- π¨ Interactive: Edit in console or git editor
- πΎ Local Configuration: API keys stored securely
- π Fast: Generate commit messages in seconds
npm install -g @committools/aicommitaicommit --setupYou'll see an interactive menu to configure:
- Default AI provider selection
- API keys input
- Auto-commit behavior
# Stage your files
git add .
# Generate commit message
aicommit
# Or with specific provider
aicommit --provider openai
# Or with git editor
aicommit --editor
# Short alias
aicaicommit # Generate commit for staged changes
aicommit --provider claude # Use Claude (for this run only)
aicommit --provider openai # Use GPT-4 (for this run only)
aicommit --provider gemini # Use Gemini (for this run only)
aicommit --set-provider openai # Change default provider permanently
aicommit --branch main # Compare with main branch
aicommit --editor # Open in git editor
aicommit --setup # Configure API keys
aicommit --config # Show current configuration
aicommit --help # Show help
# Short alias (all same options work)
aic
aic --set-provider claude- Go to https://console.anthropic.com/
- Create account or sign in
- Navigate to API Keys
- Create new key
- Cost: ~$3 per million tokens
- Go to https://platform.openai.com/
- Create account
- Navigate to API keys
- Create new key
- Cost: ~$10 per million tokens
- Go to https://makersuite.google.com/app/apikey
- Sign in with Google account
- Create API key
- Cost: Free up to 60 requests/minute
$ git add .
$ aicommit
π€ AICommit Generator
β Found changes in 3 file(s)
Files: src/auth.js, src/middleware.js, tests/auth.test.js
β Commit message generated!
============================================================
Generated Commit Message:
============================================================
feat(auth): Add JWT authentication system
Implement complete JWT-based authentication to replace the
legacy session-based approach. This improves scalability and
enables stateless authentication across distributed services.
- Add JWT token generation and validation middleware
- Implement refresh token rotation mechanism
- Create authentication endpoints (login, logout, refresh)
- Add password hashing with bcrypt
- Update user model with token-related fields
- Add comprehensive authentication tests
============================================================
? What would you like to do?
β Commit with this message
βοΈ Edit in git editor
π Copy to clipboard
β― β CancelConfiguration file is stored at ~/.aicommit/config.json
{
"defaultProvider": "claude",
"apiKeys": {
"anthropic": "sk-ant-...",
"openai": "sk-...",
"gemini": "..."
},
"autoCommit": false
}Instead of storing in config, you can use environment variables:
export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="sk-..."
export GEMINI_API_KEY="..."The tool generates commits in standard format:
<type>(<scope>): <subject>
<body>
<footer>
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code formatting (no logic change)refactor: Code refactoring without functionality changeperf: Performance improvementstest: Adding/updating testschore: Build updates, config changes, etc.ci: CI/CD changes
| Provider | Quality | Speed | Cost | Token Limit |
|---|---|---|---|---|
| Claude | βββββ | Fast | $3/1M | 200K |
| GPT-4 | βββββ | Fast | $10/1M | 128K |
| Gemini | ββββ | Fast | Free | 32K |
Recommendation: Claude for best quality at reasonable price, Gemini for free usage.
aicommit/
βββ bin/
β βββ gca.js # CLI entry point
βββ lib/
β βββ ai-providers.js # AI provider implementations
β βββ config.js # Configuration management
β βββ git.js # Git operations
βββ index.js # Main export
βββ package.json
βββ README.md
Solution: Make sure you have staged files:
git add <files>
# or
git add .Solution: Run setup:
aicommit --setupOr set environment variable:
export ANTHROPIC_API_KEY="your-key"Solution:
- For Gemini: Wait a minute (60 req/min limit)
- For Claude/OpenAI: Check your plan and limits
Solution: Set git line ending settings:
git config --global core.autocrlf true- Use frequently: The more you use it, the better AI understands your style
- Staged changes: Always
git addbeforeaicommit - Edit freely: Don't hesitate to edit generated messages
- Scope detection: AI automatically determines scope from files (auth, api, ui, etc.)
- Large diffs: For very large changes, split into multiple commits
Contributions are welcome!
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing) - Commit changes (
aicommitπ) - Push to branch (
git push origin feature/amazing) - Open Pull Request
MIT Β© [Oleksii Solomko]
- Anthropic for amazing Claude API
- OpenAI for GPT-4
- Google for free Gemini
- All contributors
- GitHub: @Solomko2
- Email: solomko2006@gmail.com
- Issues: GitHub Issues