Gemini Modular Conventional Commit Writer
AI-powered conventional commit messages using Google Gemini (because it's free! 🎉)
Generate professional, conventional commit messages with a single click using Google's Gemini AI models (Useful for interns)
✨ Features
- 🤖 AI-Powered Commit Messages: Generate conventional commits based on your staged changes
- 💰 100% Free: Uses Google Gemini's free tier (no credit card required!)
- ⚡ Multiple Models: Choose from Gemini 2.5 Flash, Flash Lite, 2.0 Flash, or 2.0 Flash Lite
- 🎯 Conventional Commits: Follows the Conventional Commits specification
- 🔒 Secure: API keys stored securely in VS Code's Secret Storage
- ⌨️ Keyboard Shortcut:
Ctrl+Alt+G (Windows/Linux) or Cmd+Alt+G (Mac)
- 🎨 Git Integration: Seamlessly integrates with VS Code's Source Control UI
🚀 Getting Started
1. Install the Extension
Search for "Gemini Conventional Commit Writer" in VS Code Extensions marketplace or install from here.
2. Get a Free Gemini API Key
- Visit Google AI Studio
- Click "Get API Key" (no credit card required!)
- Copy your API key
3. Set Your API Key
Option 1: Via Command Palette
- Press
Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac)
- Search for "Gemini Commit: Set API Key"
- Paste your API key
Option 2: Via Source Control UI
- Open the Source Control view
- Click the gear icon (⚙️) in the SCM title bar
- Select "Set API Key"
4. Generate Your First Commit
- Stage your changes in Git
- Click the sparkle icon (✨) in the Source Control title bar
- Or use keyboard shortcut:
Ctrl+Alt+G / Cmd+Alt+G
🎮 Usage
Generate Commit Message
Three ways to generate:
- Button: Click the sparkle icon (✨) in Source Control toolbar
- Keyboard: Press
Ctrl+Alt+G (Windows/Linux) or Cmd+Alt+G (Mac)
- Command Palette: Run "Gemini Commit: Generate Commit Message"
Manage Settings
Click the gear icon (⚙️) in Source Control toolbar to access:
- Set API Key: Add or update your Gemini API key
- Clear API Key: Remove stored API key
- Open Settings: Configure extension preferences
⚙️ Configuration
Access settings via File > Preferences > Settings > Extensions > Gemini Commit Writer or click the gear icon in Source Control.
Available Settings
| Setting |
Default |
Description |
| Model |
gemini-2.5-flash |
Choose your Gemini model (all free!) |
| Temperature |
0.1 |
Control creativity (0.0 = consistent, 1.0 = creative) |
| Max Output Tokens |
500 |
Maximum commit message length (~375 words) |
| Max Diff Length |
5000 |
Maximum git diff size to analyze (characters) |
| Show Timing Info |
false |
Display performance metrics after generation |
Model Comparison
| Model |
Best For |
Speed |
Quality |
| gemini-2.5-flash ⚡ |
Recommended for most users |
Fast |
High |
| gemini-2.5-flash-lite 💡 |
High-volume usage |
Fastest |
Good |
| gemini-2.0-flash 🔷 |
Complex changes |
Fast |
High |
| gemini-2.0-flash-lite 💾 |
Cost-effective |
Fastest |
Good |
All models are available on Google's free tier!
Generated messages follow this format:
<type>(<scope>): <description>
Types:
feat: New feature
fix: Bug fix
docs: Documentation changes
style: Code style changes (formatting, etc.)
refactor: Code refactoring
perf: Performance improvements
test: Adding or updating tests
build: Build system changes
ci: CI/CD changes
chore: Maintenance tasks
Examples:
feat(auth): add google oauth integration
fix(api): resolve null pointer exception in user service
docs(readme): update installation instructions
refactor(utils): simplify date formatting logic
🔧 Troubleshooting
"No staged changes found"
Solution: Stage your changes first using git add or the Source Control UI.
"Gemini API key not found"
Solution: Set your API key via the gear icon (⚙️) in Source Control or Command Palette.
"Rate limit exceeded"
Solution: Google's free tier has usage limits. Wait a few minutes and try again. Consider:
- Using a lighter model (
gemini-2.5-flash-lite)
- Reducing
maxDiffLength in settings
- Waiting between requests
"Empty response from AI model"
Solution:
- Increase
maxOutputTokens in settings (try 500-1000)
- Your diff might be too large, reduce
maxDiffLength
- Try a different model
API Key Security
Your API key is stored securely using VS Code's Secret Storage API. It's never exposed in settings files or source control.
🤝 Contributing
Found a bug or have a feature request?
📄 License
MIT License - see LICENSE file for details.
🙏 Acknowledgments
Enjoy writing better commits with AI! ⭐
If you find this extension helpful, please consider: