CodeReviewer AI - VS Code Extension
AI-powered code refactoring and developer assistance extension. Get real-time refactoring suggestions, automated code quality checks with quick fixes, and contextual code explanations powered by your choice of AI models.
Features
🔄 Real-time Refactoring Suggestions
- Automatic analysis as you type (debounced)
- Context-aware suggestions based on code complexity
- Smart refactoring recommendations for cleaner code
🛡️ Automated Code Quality Checks
- Security Issues: SQL injection, XSS, hardcoded secrets, and more
- Performance Problems: Inefficient algorithms, memory leaks, blocking operations
- Best Practices: Code style, error handling, naming conventions
- Potential Bugs: Null references, type mismatches, race conditions
💡 Contextual Code Explanations
- Hover over code for quick tooltips
- Right-click for detailed explanations
- Configurable explanation depth (brief, moderate, detailed)
⚡ Quick Fixes
- One-click fix application with preview
- Side-by-side diff view before applying
- Automatic fix generation powered by AI
🎨 Beautiful Dark Theme UI
- Elegant dark mode interface
- Green and amber accent colors for highlights
- Color-coded issue categories
- Interactive side panel with filtering
Supported Languages
- JavaScript / TypeScript
- Python
- Java
- C / C++
- C#
- Go
- Rust
- PHP
- Ruby
Model Backends
Choose from multiple AI model providers:
Local (Privacy-First)
- Ollama - Recommended for local use (auto-detected)
- llama.cpp - Lightweight local execution
- transformers.js - Browser-based inference
Cloud API Providers
- OpenAI - GPT-4, GPT-3.5-turbo
- Anthropic Claude - Claude 3.5 Sonnet, Claude 3 Opus
- Google Gemini - Gemini Pro, Gemini Ultra
- Custom API - OpenAI-compatible endpoints
Installation
- Install the extension from VS Code Marketplace
- Open VS Code
- The extension will auto-detect Ollama or prompt for configuration
Setting up Ollama (Recommended for Local Use)
# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh
# Pull a code model
ollama pull codellama
# Start using CodeReviewer AI!
Using API Providers
- Open Settings (
Ctrl+, or Cmd+,)
- Search for "CodeReviewer AI"
- Select your preferred model backend
- Enter your API key (stored securely in system keychain)
Usage
Automatic Analysis
- On Type: Analyzes code 2 seconds after you stop typing
- On Save: Analyzes when you save a file
Manual Analysis
- Command Palette:
CodeReviewer AI: Analyze Current File
- Keyboard Shortcut:
Ctrl+Shift+R (or Cmd+Shift+R on Mac)
Code Explanations
- Select code you want explained
- Right-click and choose "CodeReviewer AI: Explain Selected Code"
- Or use keyboard shortcut:
Ctrl+Shift+E (or Cmd+Shift+E)
Applying Fixes
- Click on an issue in the side panel
- Click "Apply Fix" button
- Review the diff preview
- Click "Apply" to implement the fix
Viewing Issues
- Issues appear in the "CodeReviewer AI" side panel
- Wavy underlines in the editor highlight problematic code
- Gutter icons indicate issue locations
- Click any issue to jump to its location
Configuration
Model Settings
{
"codereviewer.modelBackend": "ollama",
"codereviewer.ollamaModel": "codellama",
"codereviewer.ollamaUrl": "http://localhost:11434",
"codereviewer.temperature": 0.3,
"codereviewer.maxTokens": 2000
}
Analysis Settings
{
"codereviewer.analyzeOnSave": true,
"codereviewer.analyzeOnType": true,
"codereviewer.debounceDelay": 2000,
"codereviewer.analysisScope": "currentFile",
"codereviewer.enabledCategories": {
"security": true,
"performance": true,
"bestPractices": true,
"bugs": true,
"refactoring": true
}
}
UI Settings
{
"codereviewer.autoOpenPanel": true,
"codereviewer.showGutterIcons": true,
"codereviewer.showInlineDecorations": true,
"codereviewer.showHoverTooltips": true,
"codereviewer.explanationDepth": "brief"
}
Ignored Files
{
"codereviewer.ignoredPatterns": [
"node_modules/",
"dist/",
"build/",
".git/",
"*.min.js"
]
}
Keyboard Shortcuts
Ctrl+Shift+R (Mac: Cmd+Shift+R) - Get Refactoring Suggestions
Ctrl+Shift+E (Mac: Cmd+Shift+E) - Explain Selected Code
Commands
All commands are accessible via Command Palette (Ctrl+Shift+P or Cmd+Shift+P):
CodeReviewer AI: Analyze Current File
CodeReviewer AI: Get Refactoring Suggestions
CodeReviewer AI: Explain Selected Code
CodeReviewer AI: Show Panel
CodeReviewer AI: Clear All Issues
CodeReviewer AI: Refresh Analysis
CodeReviewer AI: Export Issues
Privacy
- Local models (Ollama, llama.cpp): Your code never leaves your machine
- API providers: Code is sent to third-party services (OpenAI, Anthropic, Google)
- No telemetry: We don't collect any usage data by default
- Secure storage: API keys are stored in your system's secure credential storage
Troubleshooting
Ollama Not Detected
- Ensure Ollama is installed:
ollama --version
- Check if Ollama is running:
ollama list
- Verify the URL in settings matches your Ollama server
API Errors
- Check your API key in settings
- Verify your internet connection
- Check API provider status page
- Review rate limits on your API plan
Extension Not Working
- Check the Output panel: View → Output → "CodeReviewer AI"
- Verify your language is supported
- Check if file is in ignored patterns
- Try refreshing analysis: Command Palette → "CodeReviewer AI: Refresh Analysis"
Development
Building from Source
# Clone the repository
git clone https://github.com/codereviewer-ai/CodeRevviewer-AI.git
cd CodeRevviewer-AI/vscode-extension
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Run in debug mode
# Press F5 in VS Code to open Extension Development Host
Testing
# Run tests
npm test
# Run linter
npm run lint
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
License
MIT License - see LICENSE for details.
Support
Changelog
See CHANGELOG.md for release history.
Credits
Built with ❤️ using:
- VS Code Extension API
- Ollama
- OpenAI SDK
- Anthropic SDK
- TypeScript
Enjoy smarter coding with CodeReviewer AI! 🚀