Git AI Assistant

Generate commit messages, PR descriptions, and code reviews using free AI models via OpenRouter — directly in VS Code.
🇧🇷 README em Português
✨ Features
| Feature |
Description |
| 🤖 AI Commit Messages |
Generates Conventional Commits messages based on your staged changes |
| 📝 PR Descriptions |
Creates structured PR descriptions using GitHub CLI to fetch real PR data |
| 🔍 Code Review |
Analyzes your code changes and provides categorized feedback |
📦 Installation
From VS Code Marketplace (Recommended)
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X / Cmd+Shift+X)
- Search for "Git AI Assistant"
- Click Install
From VSIX File
- Download the
.vsix file from Releases
- Install via command palette:
Extensions: Install from VSIX
⚙️ Configuration
1. Get OpenRouter API Key
- Visit OpenRouter.ai
- Sign up / Log in
- Go to API Keys section
- Create a new API key
Open VS Code Settings (Ctrl+, / Cmd+,) and search for Git AI Assistant:
| Setting |
Default |
Description |
gitAiAssistant.apiKey |
"" |
Required - Your OpenRouter API key |
gitAiAssistant.model |
google/gemini-2.0-flash-exp:free |
AI model to use (see models) |
gitAiAssistant.baseBranch |
main |
Base branch for PR diff comparison |
gitAiAssistant.language |
en |
Output language: en or pt-BR |
gitAiAssistant.useGitHubCLI |
true |
Use gh CLI for PR descriptions (requires GitHub CLI) |
Popular Free Models
| Model |
Recommended For |
google/gemini-2.0-flash-exp:free |
General use, fast, high quality |
meta/llama-3.1-405b-instruct:free |
Complex reasoning, code review |
openai/gpt-4o-mini |
Reliable, well-balanced |
anthropic/claude-3-5-sonnet:free |
Technical accuracy |
🎯 Usage
Generate Commit Message
- Stage your changes:
git add .
- Open Command Palette (
Ctrl+Shift+P / Cmd+Shift+P)
- Run Git AI: Generate Commit Message
- The generated message is inserted into the SCM input box
Tip: You can also click the ✨ icon in the Source Control panel toolbar
Generate PR Description
Prerequisites: Install and authenticate GitHub CLI (gh auth login)
- Open Command Palette
- Run Git AI: Generate PR Description
- Enter your PR number (e.g.,
123) or full PR URL
- The extension fetches PR details via
gh pr view and the diff
- AI generates a structured description in the webview panel
Fallback: If GitHub CLI isn't available, compares current branch with base branch
Review Changes
- Open Command Palette
- Run Git AI: Review Changes
- Choose scope: Staged changes or All changes
- Review feedback appears in a webview panel with:
- 🔴 Critical Issues
- 🟡 Suggestions
- 🟢 Positive Aspects
- 📝 Summary
🖼️ Screenshots
Commit Message Generation

PR Description Generation

Code Review

🔧 Requirements
- VS Code
1.85.0 or higher
- OpenRouter API Key (free registration)
- GitHub CLI (optional, for PR description feature)
🐛 Troubleshooting
| Problem |
Solution |
| "No staged changes found" |
Run git add . to stage your changes |
| "API Key is required" |
Configure gitAiAssistant.apiKey in settings |
| "Failed to get PR diff" |
Install and authenticate GitHub CLI: gh auth login |
| "Empty content from model" |
Try a different model in settings |
| "Request timed out" |
Check internet connection, try a smaller diff |
How to Report Bugs
Open a bug report with:
- Extension version
- VS Code version
- Steps to reproduce
- Error messages from Output panel
🤝 Contributing
Suggest a feature • Report a bug
See CONTRIBUTING.md for development guidelines.
⚡ Quick Links
| |