AI-powered Git commit message generator supporting multiple AI providers for VS Code.
π₯ Install from VS Code Marketplace
Or install directly in VS Code:
- Open VS Code
- Press
Ctrl+P(Windows/Linux) orCmd+P(macOS) - Type:
ext install bablilayoub.auto-git-message - Press Enter
- Multiple AI Providers: Support for OpenAI, Anthropic Claude, Google Gemini, Ollama (local), and Groq
- AI-Generated Commit Messages: Generate multiple commit message suggestions based on your staged Git changes
- Context-Aware Generation: Analyzes file types, frameworks, and change patterns for smarter suggestions
- Commit History & Favorites: Save and reuse your best commit messages with full history tracking
- Secure API Key Storage: API keys are stored securely using VS Code's Secret Storage
- Free Options Available: Use Google Gemini (free tier), Ollama (completely free/local), or Groq (free tier)
- Professionalism Levels: Choose from 4 levels of commit message complexity (Simple to Enterprise)
- Activity Bar Integration: Dedicated panel in VS Code's Activity Bar for easy access
- Source Control Integration: Insert generated messages directly into the Source Control input box
- Multiple Access Methods: Activity Bar, Source Control buttons, Command Palette, and keyboard shortcuts
- Configurable AI Settings: Customize AI provider, model, temperature, and professionalism level
- Smart UI: Conditional interface that adapts based on setup status
- Keyboard Shortcuts: Quick access with customizable key bindings
- VS Code 1.104.0 or higher
- API key for your chosen AI provider (free options available)
- Git repository with staged changes
π₯ Download from VS Code Marketplace
- Click the download button above
- Click "Install" on the marketplace page
- VS Code will open and install the extension automatically
- Open VS Code
- Click the Extensions icon in the Activity Bar (or press
Ctrl+Shift+X) - Search for "Auto Git Message"
- Click "Install" on the extension by bablilayoub
code --install-extension bablilayoub.auto-git-messageThe extension supports multiple AI providers to give you flexibility and cost options:
- Google Gemini: Free tier with generous limits (Get API key)
- Ollama: Completely free, runs locally (Download Ollama)
- Groq: Free tier with fast inference (Get API key)
- OpenAI: High-quality models like GPT-4 (Get API key)
- Anthropic Claude: Advanced reasoning capabilities (Get API key)
- Choose your AI provider: Use the command
AI: Select AI Providerto choose between OpenAI, Anthropic, Google Gemini, Ollama, or Groq - Set your API key: Use the command
AI: Set API Keyand enter your API key for the selected provider- For Ollama: No API key needed, just make sure Ollama is running locally
- Configure settings: Adjust model, temperature, and professionalism level in VS Code settings
- Open Command Palette (
Cmd+Shift+Pon macOS,Ctrl+Shift+Pon Windows/Linux) - Run command:
AI: Select AI Provider - Choose your preferred AI provider (OpenAI, Anthropic, Google Gemini, Ollama, or Groq)
- Run command:
AI: Set API Key(skip for Ollama - no API key needed) - Enter your API key when prompted
- Make some changes to your files
- Stage the changes you want to commit (
git addor use VS Code Source Control) - Generate commit messages using any of these methods:
- Activity Bar: Click the Auto Git Message icon (git-commit icon) in the left Activity Bar
- Source Control Panel: Click the sparkle (β¨) button in the Source Control panel
- Command Palette: Run command
AI: Generate Commit Message
- Select one of the 3 generated commit message suggestions
- The selected message will be inserted into the Source Control input box
The extension automatically analyzes your staged changes to provide better commit messages:
- Framework Detection: Recognizes React, Vue, Node.js, Python, Rust, and more
- File Type Analysis: Identifies tests, documentation, configuration files
- Change Pattern Recognition: Detects API changes, UI updates, bug fixes
- Smart Suggestions: Provides appropriate conventional commit types based on context
- Commit History: Automatic tracking of all generated commit messages
- Favorites System: Star your best commit messages for quick reuse
- Quick Access: Browse history and favorites directly from the Activity Bar
- Smart Actions: Copy, reuse, or manage your saved messages
Ctrl+Shift+G(Windows/Linux) /Cmd+Shift+G(macOS): Generate commit messageCtrl+Shift+H(Windows/Linux) /Cmd+Shift+H(macOS): Show commit historyCtrl+Shift+F(Windows/Linux) /Cmd+Shift+F(macOS): Show favorite commits
- Context Actions: Add to favorites, copy to clipboard, or use immediately
- Provider-Specific Models: Different model options for each AI provider
- Performance Optimized: Bundled extension loads 15x faster than before
The extension adds a dedicated panel to VS Code's Activity Bar (the leftmost vertical bar) with a git-commit icon. The panel provides:
Setup Mode (when AI provider is not configured):
- Instructions for getting started
- Direct link to select AI provider and set up API key
- Requirements checklist
Ready Mode (when AI provider is configured):
- Quick access to generate commit messages
- Configuration options (Provider selection, Model selection, Professionalism level)
- API key management
- Usage requirements
You can hide this panel by setting commitAi.showActivityBar: false in your settings if you prefer using the Source Control buttons or Command Palette.
Add these settings to your VS Code settings.json:
{
"commitAi.provider": "openai",
"commitAi.model": "gpt-4o-mini",
"commitAi.temperature": 0.7,
"commitAi.professionalism": "standard",
"commitAi.showActivityBar": true,
"commitAi.apiEndpoint": ""
}-
commitAi.provider(string, default:"openai")- AI provider to use for generating commit messages
- Options:
openai,anthropic,google,ollama,groq
-
commitAi.model(string, varies by provider)- Model to use for generating commit messages
- OpenAI:
gpt-4o-mini,gpt-4o,gpt-4-turbo,gpt-3.5-turbo - Anthropic:
claude-3-5-sonnet-20241022,claude-3-haiku-20240307 - Google:
gemini-1.5-flash,gemini-1.5-pro - Ollama:
llama3.2,codellama,mistral(depends on locally installed models) - Groq:
llama-3.1-8b-instant,mixtral-8x7b-32768
-
commitAi.temperature(number, default:0.7)- Controls randomness in AI responses (0 = deterministic, 2 = very creative)
- Range: 0.0 to 2.0
-
commitAi.apiEndpoint(string, optional)- Custom API endpoint for Ollama or Groq
- Ollama default:
http://localhost:11434 - Groq default:
https://api.groq.com/openai
-
commitAi.professionalism(string, default:"standard")- Professionalism level for commit messages
- Options:
simple: Basic format ("fix bug", "add feature")standard: Conventional commits ("fix: resolve login issue")professional: With scopes ("fix(auth): resolve login validation issue")enterprise: Full format with detailed body and breaking changes
-
commitAi.showActivityBar(boolean, default:true)- Show/hide the Auto Git Message icon in the Activity Bar
- Set to
falseto hide the Activity Bar panel if you prefer using other access methods
The extension offers 4 levels of commit message professionalism to match your project's needs:
Basic, clear messages without prefixes:
fix login bug
add user dashboard
update documentation
Conventional Commits format:
fix: resolve login validation issue
feat: add responsive user dashboard
docs: update API authentication guide
Conventional Commits with scopes:
fix(auth): resolve login validation issue
feat(ui): add responsive user dashboard
docs(api): update authentication endpoints
Full format with detailed descriptions and breaking changes:
feat(auth)!: implement OAuth2 authentication
Add comprehensive OAuth2 support with PKCE flow
for enhanced security and better user experience.
BREAKING CHANGE: removes basic authentication support.
All users must migrate to OAuth2 tokens.
Closes #123
AI: Set OpenAI API Key: Prompts to enter and securely store your OpenAI API keyAI: Generate Commit Message: Generates commit messages based on staged changesSelect OpenAI Model: Choose which OpenAI model to use with detailed descriptions and current model indicatorSelect Professionalism Level: Choose commit message complexity from simple to enterprise-gradeManage API Key: Update or remove the stored OpenAI API key
- Node.js 18+ and npm
- VS Code
- Clone this repository
- Install dependencies:
npm install - Open in VS Code
- Press
F5to launch Extension Development Host
# Compile TypeScript
npm run compile
# Watch for changes
npm run watch
# Lint code
npm run lint
# Package extension
npm install -g @vscode/vsce
vsce package- Press
F5in VS Code to launch the Extension Development Host - In the new window, open a folder with a Git repository
- Make some changes and stage them (
git add) - Set your OpenAI API key:
Cmd+Shift+PβAI: Set OpenAI API Key - Generate commit message:
Cmd+Shift+PβAI: Generate Commit Message
The extension handles various error scenarios:
- No API Key: Prompts to set API key first
- No Staged Changes: Warns user to stage files first
- No Git Repository: Shows error if not in a Git repository
- API Errors: Handles invalid API keys, quota limits, and network issues
- Fallback to Clipboard: If Source Control input box is unavailable, copies message to clipboard
- OpenAI API key is stored securely using VS Code's Secret Storage
- Only staged changes (git diff --staged) are sent to OpenAI
- No personal information or file paths are included in API requests
- Fork the repository
- Create a feature branch
- Make your changes
- Run linting:
npm run lint - Submit a pull request
MIT License - see LICENSE file for details
- Initial release
- Basic commit message generation with OpenAI API
- Secure API key storage
- Source Control integration
- Configurable AI settings
- If the Source Control input box is not available, the extension will fallback to copying the commit message to clipboard
- Very large diffs (>1MB) may cause slower API response times
- β¨ AI-powered commit message generation using OpenAI API
- π Secure API key storage with VS Code Secret Storage
- π Four professionalism levels (Simple, Standard, Professional, Enterprise)
- π― Activity Bar integration with smart conditional UI
- βοΈ Configurable OpenAI models and temperature settings
- π§ Multiple access methods (Activity Bar, Source Control, Command Palette)
- π Source Control integration with automatic message insertion
- π¨ Professional VS Code UI with proper icons and structure
MIT License - see LICENSE file for details
- Fork the repository
- Create a feature branch
- Make your changes
- Run linting:
npm run lint - Submit a pull request