AI-powered git commit message generator using FREE Google Gemini API
CommitCraft uses Google's Gemini AI to analyze your code changes and automatically generate meaningful, conventional commit messages. Completely FREE - no credit card required.
- 100% FREE - Uses Google's free Gemini API
- AI-Powered - Uses latest Gemini models to understand your code
- Multiple Suggestions - Get 3 different commit message options
- Multiple Styles - Conventional, Semantic, Descriptive, or Custom
- Jira Integration - Automatic ticket key prepending
- Interactive CLI - Beautiful terminal interface
- Context-Aware - Considers branch names, files, and history
- Fast & Easy - One command to generate and commit
gem install commitcraftOr add to your Gemfile:
gem 'commitcraft'- Go to https://aistudio.google.com/app/apikey
- Click "Create API Key"
- Copy your key
export GEMINI_API_KEY='your-key-here'
# Make it permanent:
echo 'export GEMINI_API_KEY="your-key"' >> ~/.bashrc
source ~/.bashrccd your-project
git add .
commitcraft generategit add .
commitcraft generateCommitCraft will:
- Analyze your staged changes
- Generate 3 commit message suggestions
- Let you choose one (or write your own)
- Commit with your selected message
commitcraft generate --auto-commit # Auto-commit with first suggestion
commitcraft generate --style semantic # Use specific commit style
commitcraft generate --all # Include all changes
commitcraft generate --amend # Amend previous commit
commitcraft generate --include-history # Include commit history as context
commitcraft generate --jira CF-123 # Add Jira ticket keyAutomatically prepend Jira ticket keys to your commit messages:
# One-time Jira key
commitcraft generate --jira CF-123
# Short form
commitcraft generate -j CF-123
# Combined with other options
commitcraft generate -j CF-123 -s semantic -yOutput:
Choose a commit message:
[CF-123] feat(auth): add OAuth2 authentication
[CF-123] feat: implement user login system
[CF-123] Add authentication with OAuth2
Set default Jira prefix:
# Set once for all commits
commitcraft config --jira-prefix CF-123
# Now every commit includes CF-123 automatically
commitcraft generateSupported formats:
PROJECT-123ABC-456JIRA-789
Conventional (default)
feat(auth): add OAuth2 login flow
fix(api): resolve null pointer error
docs(readme): update installation steps
Semantic
Add user authentication middleware
Fix memory leak in background worker
Update dependencies to latest versions
Descriptive
Implement caching to improve response time by 40%
Refactor database queries to eliminate N+1 problems
Add comprehensive error handling for edge cases
commitcraft config --show # Show current config
commitcraft config --style conventional # Set default style
commitcraft config --model gemini-2.5-flash # Set AI model
commitcraft config --jira-prefix CF-123 # Set default Jira prefix
commitcraft status # View git status
commitcraft version # Check versiongemini-2.5-flash(default) - Best balancegemini-2.5-pro- Highest qualitygemini-2.5-flash-lite- Fastestgemini-2.0-flash- Fast and versatilegemini-flash-latest- Auto-updates to latest
Add to ~/.gitconfig:
[alias]
ai = !commitcraft generate
aic = !commitcraft generate --auto-commitThen use:
git ai # Interactive mode
git aic # Auto-commit# Working on CF-123 all week
commitcraft config --jira-prefix CF-123
# All commits include CF-123
git add file1.rb && commitcraft generate -y
git add file2.rb && commitcraft generate -y
git add file3.rb && commitcraft generate -y$ git log --oneline
a1b2c3d [CF-123] feat(auth): add OAuth2 authentication
d4e5f6g [CF-123] test(auth): add integration tests
h7i8j9k [CF-456] fix(api): resolve validation error
l0m1n2o [CF-456] docs(api): update API documentationFilter by ticket:
git log --grep="CF-123" --oneline- 15 requests/minute
- 1 million tokens/minute
- 1,500 requests/day
Bug reports and pull requests are welcome.
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
MIT License - see LICENSE.txt
- Stage related changes together for better commit messages
- Use --include-history for context-aware suggestions
- Try different styles to match your team's conventions
- Set default Jira prefix for long-running feature work
- Use --auto-commit for quick, simple changes
- Create git aliases for faster workflow