Skip to content

Shawnchee/vscode-gemini-conventional-commit-writer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

59 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Gemini Modular Conventional Commit Writer

Generate conventional commits in seconds! โšก

AI-powered commit messages using Google Gemini (because it's free! ๐ŸŽ‰) - No more struggling with commit message format or wording. Just stage your changes, click generate, and get a perfectly formatted conventional commit instantly.

Professional commit messages with a single click using Google's Gemini AI models.

Demo Video

โœจ Features

  • ๐Ÿค– AI-Powered Commit Messages: Generate conventional commits based on your staged changes in seconds
  • ๐Ÿ“ Brief or Detailed: Choose between single-line commits or multi-line with body and footer
  • ๐Ÿ’ฐ 100% Free: Uses Google Gemini's free tier (no credit card required!)
  • โšก Multiple Models: Choose from Gemini 2.5 Flash and Flash Lite
  • ๐ŸŽฏ Conventional Commits: Follows the Conventional Commits specification
  • ๐Ÿงฉ Modular: Automatically generates focused, single-purpose commits based on staged changes
  • ๐Ÿ”’ 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

VS Code: Search for "Gemini Conventional Commit Writer" in VS Code Extensions marketplace or install from here.

Cursor IDE: Also available on Open VSX Registry for Cursor, Antigravity, and VSCodium users.

2. Get a Free Gemini API Key

  1. Visit Google AI Studio
  2. Click "Get API Key" (no credit card required!)
  3. Copy your API key

โš ๏ธ Privacy Notice: Google's free tier may use your data for training purposes. If your code contains proprietary information, consider using a paid Gemini API key which offers data protection guarantees. See Google's data usage policy for details.

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

  1. Stage your changes in Git
  2. Click the sparkle icon (โœจ) in the Source Control title bar or use Ctrl+Alt+G / Cmd+Alt+G
  3. Choose commit style:
    • Brief Commit: Single-line (e.g., feat(auth): add google oauth)
    • Detailed Commit: Multi-line with body and footer for context
  4. Commit message appears instantly in the input box!

๐ŸŽฎ Usage

Generate Commit Message

Three ways to generate:

  1. Button: Click the sparkle icon (โœจ) in Source Control toolbar
  2. Keyboard: Press Ctrl+Alt+G (Windows/Linux) or Cmd+Alt+G (Mac)
  3. Command Palette: Run "Gemini Commit: Generate Commit Message"

Then choose your style:

  • Brief Commit - Perfect for quick, straightforward changes
    feat(api): add user authentication endpoint
    
  • Detailed Commit - For complex changes that need context
    feat(api): add user authentication endpoint
    
    - Implement JWT token generation and validation
    - Add password hashing with bcrypt
    - Create user session management
    
    This enables secure user authentication and prepares
    the foundation for role-based access control.
    
    Refs: #123
    

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

All models are available on Google's free tier!

๐Ÿ“ Conventional Commits Format

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:

About

writes conventional commits for your work projects. Gemini free API, can control your outputs

Resources

License

Stars

3 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors