English | 简体中文
A VSCode extension for generating standardized Git/SVN commit messages using AI. Supports OpenAI, Ollama, VSCode built-in AI services, Zhipu AI, DashScope, Gemini AI, and Doubao AI.
🆓 Free AI Model Support
Features
OpenAI API
- Suitable for scenarios requiring high-quality generation results
- Supports multiple models including GPT-3.5/GPT-4
- Requires API Key, charged based on usage
Ollama
- Local deployment, no internet required
- Supports multiple open-source models
- Ideal for scenarios with data privacy requirements
VSCode Built-in AI
- Uses VSCode's built-in GitHub Copilot
- Requires valid GitHub Copilot subscription
- Configuration: Set provider to "vscode"
Zhipu AI (GLM-4)
- Excellent Chinese language performance
- Fixed monthly free quota
- Suitable for users in China
DashScope
- AI service provided by Alibaba Cloud
- Supports Tongyi Qianwen series models
- Suitable for enterprise applications
Gemini AI
- AI service provided by Google
- Daily free quota: 1500 requests
- Suitable for individual developers
📝 Version Control System Support
📊 Weekly Report Generation
- AI-powered weekly report generation
- Automatically summarize your work progress
- Customizable report templates
- Support multiple AI providers for report generation
🌍 Multi-language Commit Message Generation
Supports the following 19 languages:
- Simplified Chinese (简体中文)
- Traditional Chinese (繁體中文)
- Japanese (日本語)
- Korean (한국어)
- Czech (Čeština)
- German (Deutsch)
- French (Français)
- Italian (Italiano)
- Dutch (Nederlands)
- Portuguese (Português)
- Vietnamese (Tiếng Việt)
- English
- Spanish (Español)
- Swedish (Svenska)
- Russian (Русский)
- Bahasa Indonesia
- Polish (Polski)
- Turkish (Türkçe)
- Thai (ไทย)
🎨 Conventional Commits Compliant
Generates commit messages following the Conventional Commits specification:
Commit Message Format:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
Supported Commit Types:
feat
: New feature
fix
: Bug fix
docs
: Documentation changes
style
: Code style adjustments
refactor
: Code refactoring
perf
: Performance improvements
test
: Test-related changes
build
: Build-related changes
ci
: CI/CD-related changes
chore
: Other changes
revert
: Revert commits
Automatic Scope Detection:
- Automatically inferred from modified file paths
- Smart categorization for multi-file changes
- Customizable scope rules via configuration
Breaking Changes Support:
- Mark breaking changes with
!
- Detailed impact description in body
- Example:
feat!: Restructure authentication system
Intelligent Description Generation:
- Automatic code change analysis
- Key modification point extraction
- Clear and concise description generation
😄 Automatic Emoji Addition
- Automatically adds emojis to commit messages
- Can be enabled/disabled through configuration:
{
"dish-ai-commit.features.commitFormat.enableEmoji": true // Enable emoji
}
- Emojis automatically match commit types:
- ✨ feat: New features
- 🐛 fix: Bug fixes
- 📝 docs: Documentation
- 💄 style: Styling
- ♻️ refactor: Refactoring
- ⚡️ perf: Performance
- ✅ test: Testing
- 🔧 chore: Other changes
📊 Code Analysis Features
- Intelligent code difference analysis
- Automatically simplify complex code changes
- Preserve key context information
- Customizable analysis behavior via maxLineLength and contextLines
🔄 Merge Commit Support
By enabling the enableMergeCommit option, you can:
- Merge changes from multiple related files into a single commit message
- Automatically analyze file associations
- Generate more concise commit records
📝 Weekly Report Templates
Weekly report generation supports custom templates:
- Customize prompts via systemPrompt configuration
- Summarize by project/task
- Customize report format and key content
📋 Requirements
- VS Code 1.80.0+
- SVN Command Line Tool
- SVN SCM (Optional) - Install SVN SCM v2.18.1+ if you need to enter commit messages in VSCode's SCM input box
- Download the latest version of the SVN SCM extension from the release page
- Git SCM (Optional) - Install Git SCM if you need to enter commit messages in VSCode's SCM input box
- Valid AI service configuration (OpenAI API Key or Ollama service)
Configuration
Configuration |
Type |
Default |
Description |
dish-ai-commit.base.language |
string |
Simplified Chinese |
Commit message language |
dish-ai-commit.base.systemPrompt |
string |
"" |
Custom system prompt |
dish-ai-commit.base.provider |
string |
OpenAI |
AI provider |
dish-ai-commit.base.model |
string |
gpt-3.5-turbo |
AI model |
dish-ai-commit.providers.openai.apiKey |
string |
"" |
OpenAI API key |
dish-ai-commit.providers.openai.baseUrl |
string |
https://api.openai.com/v1 |
OpenAI API base URL |
dish-ai-commit.providers.zhipu.apiKey |
string |
"" |
Zhipu AI API key |
dish-ai-commit.providers.dashscope.apiKey |
string |
"" |
DashScope API key |
dish-ai-commit.providers.doubao.apiKey |
string |
"" |
Doubao API key |
dish-ai-commit.providers.ollama.baseUrl |
string |
http://localhost:11434 |
Ollama API base URL |
dish-ai-commit.providers.gemini.apiKey |
string |
"" |
Gemini AI API key |
dish-ai-commit.features.codeAnalysis.simplifyDiff |
boolean |
false |
Enable diff content simplification |
dish-ai-commit.features.codeAnalysis.maxLineLength |
number |
120 |
Maximum line length after simplification |
dish-ai-commit.features.codeAnalysis.contextLines |
number |
3 |
Number of context lines to preserve |
dish-ai-commit.features.commitFormat.enableMergeCommit |
boolean |
false |
Allow merging multiple file changes into one commit |
dish-ai-commit.features.commitFormat.enableEmoji |
boolean |
true |
Use emoji in commit messages |
dish-ai-commit.features.weeklyReport.systemPrompt |
string |
"" |
Custom system prompt for weekly reports |
Commands
Command ID |
Category |
Title |
Description |
dish-ai-commit.selectModel |
[Dish AI Commit] |
Select AI Model for Commit Generation |
Choose the AI model for generating commit messages |
dish-ai-commit.generateWeeklyReport |
[Dish AI Commit] |
Generate Weekly Report |
Generate AI-powered weekly work report |
Configuration Instructions
- OpenAI Configuration
{
"dish-ai-commit.base.provider": "openai",
"dish-ai-commit.providers.openai.apiKey": "your-api-key",
"dish-ai-commit.providers.openai.baseUrl": "https://api.openai.com/v1"
}
- Ollama Configuration
{
"dish-ai-commit.base.provider": "ollama",
"dish-ai-commit.providers.ollama.baseUrl": "http://localhost:11434"
}
- VSCode Configuration
{
"dish-ai-commit.base.provider": "vscode"
}
📋 How to use
- Select the file to be submitted from the source code manager
- Click the "Dish AI Commit" icon in the source code manager title bar
- Or execute the "Dish AI Commit" command in the command panel
- AI will automatically generate a submission message that meets the specifications
📥 Install
- Search "Dish AI Commit" from the VS Code extension market
- Click to install
- Restart VS Code
- Configure AI service parameters according to actual needs
📝 Changelog
See CHANGELOG.md for a detailed version history.
📋 Dependency Requirements
- VS Code 1.80.0+
- SVN command line tool
- SVN SCM (optional) - To enter commit information in the SCM input box of VSCode, please install SVN SCM v2.18.1+
- Valid AI service configuration (OpenAI API Key or Ollama service)
💡 Frequently asked questions
- Ensure that the SVN command line tool is correctly installed and accessible
- Ensure that the SVN SCM extension is correctly installed and enabled
- Configure the correct AI service parameters
- Ensure that the network can access the selected AI service
🛠️ Development Guide
You can use Github Codespaces for online development:
![github-codespace](https://github.com/littleCareless/dish-ai-commit/blob/main/images/codespaces.png?raw=true)
Alternatively, you can clone the repository and run the following command for local development:
$ git clone https://github.com/littleCareless/dish-ai-commit
$ cd ai-commit
$ npm install
Open the project folder in VSCode. Press F5 to run the project. A new Extension Development Host window will pop up and start the extension.
🤝 Contribution Guidelines
We welcome all forms of contributions, including but not limited to:
- Submit Issues to report bugs
- Propose new features
- Submit Pull Request to improve the code
- Improve the documentation
Please make sure before submitting a PR:
The code has been tested
Update the relevant documents
Follow the project code specifications
![](https://img.shields.io/badge/%F0%9F%A4%AF_pr_welcome-%E2%86%92-ffcb47?labelColor=black&style=for-the-badge)
💗 Thanks to our contributors
![](https://contrib.rocks/image?repo=littleCareless%2fdish-ai-commit)
🙏 Acknowledgments
This project is inspired by and references these excellent open source projects:
- svn-scm - SVN source control management for VSCode
- vscode - Visual Studio Code editor
- vscode-gitlens - Git supercharged for VSCode
- ai-commit - AI assisted Git commit message generation
📄 License
This project is MIT licensed.