DiffDraft is a VS Code extension that generates intelligent commit message drafts from your Git diffs using OpenRouter AI.
- ✨ AI-Powered Commit Messages: Automatically generates professional Git commit messages using OpenRouter AI
- 🤖 Model Pooling: Automatically pools and fails over between high-capacity models (
nvidia/nemotron-3-nano-30b-a3b:free,nvidia/nemotron-3-ultra-550b-a55b:free, andopenrouter/free) - 📝 Conventional Commits: Outputs formatted messages following Conventional Commits specification (e.g.,
feat(auth): add login functionality) - 🔍 Staged & Working Tree Support: Analyzes both staged changes and working tree modifications
- 🔒 Secure API Key Storage: API keys are stored securely using VS Code's encrypted SecretStorage
- ⚡ One-Click Generation: Generate commit messages directly from the Source Control panel
- Click the ✨ sparkle button in the Source Control panel title bar
- Enter your OpenRouter API Key when prompted (get one at openrouter.ai)
- The AI-generated commit message will appear in the commit input box
- Review and edit the message if needed, then commit!
Note: Your API key is stored securely and remembered for future sessions.
- VS Code 1.85.0 or higher
- Git extension enabled
- A valid OpenRouter API Key
Automated build script is available to compile and package the extension into a .vsix file formatted as diff-draft-v{version}.vsix:
# Build standard extension package
node scripts/build.js
# Or build with assigned API key embedded into .env
node scripts/build.js --api-key "sk-or-v1-your-key-here"You can optionally set an environment variable to override the API key:
OVERRIDE_API_KEYS: If set, these key(s) will be used instead of the stored key(s). Supports multiple keys separated by commas for rate-limit fallback (e.g.sk-or-v1-key1,sk-or-v1-key2)
- 🔄 Provider Migration: Completely migrated LLM provider from Groq to OpenRouter.
- ⚡ Real-Time Output Streaming: Stream commit message tokens directly to the SCM panel and Webview sidebar as they arrive.
- 🤖 Model Pooling: Automatic fallback and pooling between
nvidia/nemotron-3-nano-30b-a3b:free,nvidia/nemotron-3-ultra-550b-a55b:free, andopenrouter/free. - 🛠️ Automated Build Script: Created
scripts/build.jsto package the extension intodiff-draft-v{version}.vsixwith optional--api-keyargument. - 🛡️ Comprehensive Error Handling: Dedicated error handling for OpenRouter status codes.
Enjoy! 🚀