CommitAI Lite
简体中文
A minimal VS Code extension that turns Git diffs into clean AI-generated commit messages.
It reads the current Git diff, calls an OpenAI-compatible /chat/completions API, and writes the generated message back to VS Code's commit input box. It never commits code automatically.
Features
- Adds a generate action to the Source Control title menu
- Reads staged, unstaged, deleted, modified, and newly added untracked files
- Supports OpenAI-compatible services such as OpenAI, DeepSeek, Qwen-compatible gateways, SiliconFlow, and OpenRouter
- Configures
baseUrl, apiKey, model, and custom prompt directly in VS Code Settings
- Defaults to Chinese Conventional Commits style messages
Configuration
Configure the extension in VS Code Settings JSON:
{
"commitAILite.baseUrl": "https://api.openai.com/v1",
"commitAILite.apiKey": "your-api-key",
"commitAILite.model": "gpt-4o-mini",
"commitAILite.customPrompt": "Please generate a Git commit message in Chinese that follows Conventional Commits.",
"commitAILite.maxDiffChars": 12000
}
DeepSeek example:
{
"commitAILite.baseUrl": "https://api.deepseek.com/v1",
"commitAILite.model": "deepseek-chat"
}
Local Development
Run checks:
npm test
Open this project in VS Code, press F5, and choose Run Extension to start an Extension Development Host.
For Marketplace compatibility, CommitAI Lite uses the stable scm/title menu contribution instead of the proposed scm/inputBox contribution.
Notes
commitAILite.apiKey is stored directly in VS Code Settings for simplicity. Treat your settings file as sensitive.
- The extension only calls OpenAI-compatible
/chat/completions; it does not include provider-specific adapters.
- The extension only generates commit messages. It does not run
git commit.
- Before publishing, replace
"publisher": "local" in package.json with your real Visual Studio Marketplace publisher ID.
License
MIT