Copilot Commit Message Improver
A VSCode extension that generates intelligent commit messages using GitHub Copilot based on your staged changes.
Features
- One-Click Generation: Click the sparkle (✨) button in the Source Control toolbar to generate a commit message
- Powered by GitHub Copilot: Uses the latest Copilot language models to analyze your changes
- Customizable: Configure which model to use and provide custom instructions for commit message style
- Smart Analysis: Reads your staged git diff to understand what changed
Requirements
- Visual Studio Code 1.85.0 or higher
- GitHub Copilot subscription (required to access language models)
- Git repository with staged changes
Usage
- Stage your changes in the Source Control view (Git)
- Click the sparkle icon (✨) in the Source Control toolbar
- Wait for Copilot to analyze your changes
- The generated commit message will appear in the commit message box
Extension Settings
This extension contributes the following settings:
copilotCommitImprover.modelId: The Copilot model ID to use for generating commit messages
- Leave empty to be prompted to select from available models
- Use the "Select Copilot Model for Commit Messages" command to choose from dynamically loaded models
- The extension automatically detects all available Copilot models (including gpt-4o, gpt-5-mini, o1-preview, etc.)
copilotCommitImprover.customInstructions: Provide custom instructions for commit message generation
- Default: "Generate a clear, concise commit message following conventional commits format. Use imperative mood and explain what changed and why."
copilotCommitImprover.maxTokens: Maximum tokens for the generated message (default: 500)
Selecting a Model
You can select your preferred Copilot model in two ways:
- Command Palette: Run
Copilot Commit Improver: Select Copilot Model for Commit Messages
- First Use: If no model is configured, you'll be prompted to select one when you first generate a commit message
The extension will show you all available models with their details (family, version, max tokens) so you can make an informed choice.
How to Run in Development
Install dependencies:
npm install
Compile the extension:
npm run compile
Press F5 in VSCode to launch a new Extension Development Host window
In the new window, open a git repository with staged changes
Click the sparkle icon in the Source Control toolbar
How to Package and Install
Install vsce (VSCode Extension Manager):
npm install -g @vscode/vsce
Package the extension:
vsce package
Install the generated .vsix file:
- In VSCode, go to Extensions view
- Click the "..." menu
- Select "Install from VSIX..."
- Choose the generated
.vsix file
Troubleshooting
"No Copilot model found"
- Ensure you have an active GitHub Copilot subscription
- Sign in to GitHub Copilot in VSCode
- Run the "Select Copilot Model" command to see available models
- If the issue persists, restart VSCode
"No staged changes"
- Make sure you have staged files in the Source Control view
- Use
git add <file> or stage files through the UI
"Could not get diff"
- Ensure your repository has commits (not a brand new repo)
- Check that Git is properly configured
License
MIT
Release Notes
0.0.4
- Settings Link: Added clickable link in settings to select models
- Model Picker Fix: Settings link now properly opens model picker every time
- Better UX: Separated model selection (always picker) from model retrieval (uses configured or prompts)
0.0.2
- Dynamic Model Selection: Automatically detects all available Copilot models
- Model Selection Command: New command to browse and select from available models
- Future-Proof: Works with new models like gpt-5-mini automatically
- Model details shown in selection UI (family, version, max tokens)
0.0.1
Initial release:
- Generate commit messages from staged changes
- Configurable model selection
- Custom instruction support
- Source Control toolbar integration
| |