Overview
CodeMate is an AI-powered code review assistant that analyzes your code and provides improvement suggestions from multiple perspectives. It uses Google's Gemini AI to understand your code and offer actionable recommendations.
Features
🤖 AI-Powered Analysis
- Automatically analyzes code when you save a file
- Uses Gemini AI for intelligent code review
- Provides up to 3 actionable suggestions per analysis
🎭 Multiple Perspectives
Switch between different analysis viewpoints:
- Pragmatic - Real-world maintainability and readability
- Performance - Optimization and efficiency improvements
- Maintainability - Code structure and separation of concerns
- Security - Vulnerability detection and input validation
- Product - User experience and error handling
⌨️ Keyboard Shortcuts
Shift+Alt+B(Windows/Linux) /Cmd+Shift+B(macOS) - Open CodeMate in the configured location
📋 Commands
CodeMate: Show View- Reveal CodeMate in the configured locationCodeMate: Switch Perspective- Cycle through different viewpointsCodeMate: Analyze Current File- Manually trigger analysis
Installation
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X) - Search for "CodeMate"
- Click Install
Configuration
CodeMate provides several settings you can customize:
| Setting | Type | Default | Description |
|---|---|---|---|
codemate.apiKey |
string | - | Gemini API key (or use GEMINI_API_KEY env var) |
codemate.model |
string | gemini-2.5-flash |
Gemini model used for analysis |
codemate.autoAnalyze |
boolean | true |
Automatically analyze on file save |
codemate.defaultPersonality |
string | pragmatic |
Default analysis perspective |
codemate.debounceDelay |
number | 500 |
Delay in ms for save events |
codemate.viewLocation |
string | sidebar |
Render CodeMate in the sidebar or in a separate editor panel |
Getting a Gemini API Key
- Go to Google AI Studio
- Create a new API key
- Set it via:
- Environment variable:
GEMINI_API_KEY=your-keyorGOOGLE_API_KEY=your-key - Or in VS Code settings:
codemate.apiKey
- Environment variable:
Usage
Automatic Analysis
Simply save a file (Ctrl+S) and CodeMate will analyze it automatically. The suggestions will appear in the configured CodeMate view.
Manual Analysis
- Open a file you want to analyze
- Press
Shift+Alt+Bor runCodeMate: Analyze Current Filefrom Command Palette - If
codemate.viewLocationis set tosidebar, open CodeMate from the Activity Bar. If it is set topanel, CodeMate opens beside the editor.
Switching Perspectives
Click the status bar item or use CodeMate: Switch Perspective to cycle through different viewpoints.
Applying Suggestions
- Click on line numbers (e.g.,
L25) to jump to that location - Check the checkbox to mark tasks as done
Requirements
- VS Code 1.116.0 or later
- A Gemini API key (free tier available)
Extension Settings
This extension contributes the following settings:
codemate.apiKey- Set your Gemini API keycodemate.model- Choose the Gemini model used for analysiscodemate.autoAnalyze- Enable/disable auto-analysis on savecodemate.defaultPersonality- Set the default perspectivecodemate.debounceDelay- Configure save event debounce delaycodemate.viewLocation- Choose between sidebar and editor panel UI
Known Issues
- API key not set - Make sure to configure your Gemini API key
- Analysis fails on large files - Code is truncated to 2000 characters
Release Notes
0.1.0
- Initial release
- AI-powered code analysis with Gemini
- Multiple perspective modes
- Modern UI with dark theme
- Keyboard shortcuts and commands
- Configurable settings
Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.
License
MIT
Enjoy using CodeMate! 🚀