AI-powered git commit message generator with support for multiple AI providers
npm install @committools/aicommitAI-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
``bash`
npm install -g @committools/aicommit
`bash`
aicommit --setup
You'll see an interactive menu to configure:
- Default AI provider selection
- API keys input
- Auto-commit behavior
`bashStage your files
git add .
š Detailed Usage
$3
`bash
aicommit # 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 helpShort alias (all same options work)
aic
aic --set-provider claude
`$3
#### Claude (Anthropic) - Recommended ā
1. Go to https://console.anthropic.com/
2. Create account or sign in
3. Navigate to API Keys
4. Create new key
5. Cost: ~$3 per million tokens
#### OpenAI (GPT-4)
1. Go to https://platform.openai.com/
2. Create account
3. Navigate to API keys
4. Create new key
5. Cost: ~$10 per million tokens
#### Google Gemini - Free š
1. Go to https://makersuite.google.com/app/apikey
2. Sign in with Google account
3. Create API key
4. Cost: Free up to 60 requests/minute
$3
`bash
$ 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
⯠ā Cancel
`āļø Configuration
Configuration file is stored at
~/.aicommit/config.json`json
{
"defaultProvider": "claude",
"apiKeys": {
"anthropic": "sk-ant-...",
"openai": "sk-...",
"gemini": "..."
},
"autoCommit": false
}
`$3
Instead of storing in config, you can use environment variables:
`bash
export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="sk-..."
export GEMINI_API_KEY="..."
`šÆ Conventional Commits Format
The tool generates commits in standard format:
`
(): `$3
-
feat: New feature
- fix: Bug fix
- docs: Documentation changes
- style: Code formatting (no logic change)
- refactor: Code refactoring without functionality change
- perf: Performance improvements
- test: Adding/updating tests
- chore: Build updates, config changes, etc.
- ci: CI/CD changesš Provider Comparison
| 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.
$3
`
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
`š ļø Troubleshooting
$3
Solution: Make sure you have staged files:
`bash
git add
or
git add .
`$3
Solution: Run setup:
`bash
aicommit --setup
`Or set environment variable:
`bash
export ANTHROPIC_API_KEY="your-key"
`$3
Solution:
- For Gemini: Wait a minute (60 req/min limit)
- For Claude/OpenAI: Check your plan and limits
$3
Solution: Set git line ending settings:
`bash
git config --global core.autocrlf true
`š” Tips
1. Use frequently: The more you use it, the better AI understands your style
2. Staged changes: Always
git add before aicommit
3. Edit freely: Don't hesitate to edit generated messages
4. Scope detection: AI automatically determines scope from files (auth, api, ui, etc.)
5. Large diffs: For very large changes, split into multiple commitsš¤ Contributing
Contributions are welcome!
1. Fork the repository
2. Create feature branch (
git checkout -b feature/amazing)
3. Commit changes (aicommit š)
4. Push to branch (git push origin feature/amazing`)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
---