Gemini Commit Message
Generate concise Git commit messages from your changes using Google Gemini.
This extension analyzes your Git changes and generates a commit message directly in the Source Control input box, keeping commits consistent, readable, and fast without leaving VS Code.
Features
- Generate commit messages from staged changes
- Falls back to unstaged changes when nothing is staged
- Handles new repositories safely
- Writes natural-language sentences in lowercase while preserving original casing for variable names, constants, and file names
- Uses Google Gemini (2.0 Flash) for fast generation
- Cancellable loader with clean error handling
- Cross-platform support (macOS, Windows, Linux)
How it works
- If staged changes exist, they are used
- Otherwise:
- Existing repo: unstaged diff
- New repo: file change summary
- The changes are sent to Gemini
- The generated message is inserted into the Git commit input box
Requirements
- Git installed and available in PATH
- A Google Gemini API key
Setup
1. Get a Gemini API key
- Go to https://ai.google.dev/
- Create a project in Google AI Studio
- Generate an API key
Open VS Code Settings (JSON) and add:
{
"geminiCommit.apiKey": "YOUR_API_KEY_HERE"
}
Install
Usage
- Open a Git repository in VS Code
- Make changes (stage them if you want)
- Open the Source Control panel
- Run the command:
Generate Commit Message (Gemini)
This command generates a commit message from the current Git changes and inserts it into the Source Control commit input box.
You can run it from:
- Command Palette (
Cmd/Ctrl + Shift + P)
- Or bind it to a keyboard shortcut
Rate limits
This extension uses the Google Gemini API.
Usage may be subject to API rate limits, especially on the free tier. If a limit is reached, a friendly message will be shown.
Enabling billing in Google AI Studio increases available limits.
Privacy
- Your code is sent only to Google Gemini to generate the commit message
- No data is stored or logged by this extension
- API keys are stored locally in VS Code settings
Known limitations
- Large diffs may be summarized or truncated
- Free-tier quotas may be exhausted during heavy testing
- Multi-root workspaces use the first repository only
License
MIT