ReviewerBot 🤖
An AI-powered VS Code extension that generates one-liner reviews above function definitions using Gemini 2.0 Flash API. Reviews are generated in different styles: funny, roast, motivational, technical, and hilarious!
✨ Features
- Multi-language Support: Go, Python, JavaScript/TypeScript, C, C++, Dart, Java
- Multiple Review Styles:
- 😄 Funny: Light-hearted and humorous
- 🔥 Roast: Sarcastic and critical
- 💪 Motivational: Encouraging and uplifting
- 🔧 Technical: Professional and constructive
- 🤪 Hilarious: Over-the-top and entertaining
- Star Ratings: Automatic star ratings (⭐ to ⭐⭐⭐⭐⭐)
- Auto-generation: Generate reviews on file save (optional)
- CodeLens Integration: Reviews appear as clickable CodeLens above functions
- Mock Mode: Test without API calls
📸 Screenshots & Demo
🎬 Demo

📱 Screenshots by Language
🐍 Python

🟢 Go

🟡 JavaScript

🎯 Dart

🏗️ Architecture
ReviewerBot consists of two main components:
1. Go Backend (/backend
)
- Function Parser: Detects function definitions using regex patterns
- Gemini Integration: Connects to Gemini 2.0 Flash API
- Review Generator: Formats reviews with star ratings
- Direct Communication: Called directly by VS Code extension via stdin/stdout
- Mock Mode: Fallback reviews when API is unavailable
2. VS Code Extension (/extension
)
- Backend Client: Calls Go executable directly via stdin/stdout
- CodeLens Provider: Displays reviews as clickable CodeLens above functions
- Configuration UI: Settings for API key, review style, etc.
- Command Palette: Manual review generation, clearing, and review history
🚀 Quick Start
Prerequisites
- Go 1.21+
- Node.js 16+
- VS Code
- Gemini API Key
1. Setup Go Backend
# Install dependencies
go mod tidy
# Build the executable
go build -o reviewer-bot.exe main.go
# Set your Gemini API key (optional - will use mock mode if not set)
export GEMINI_API_KEY="your-api-key-here"
The Go executable will be called directly by the extension via stdin/stdout communication.
2. Setup VS Code Extension
# Navigate to extension directory
cd extension
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Package extension (optional)
npm run package
3. Install Extension
- Open VS Code
- Press
Ctrl+Shift+P
(or Cmd+Shift+P
on Mac)
- Type "Extensions: Install from VSIX"
- Select the packaged
.vsix
file
- Open VS Code Settings (
Ctrl+,
)
- Search for "ReviewerBot"
- Configure:
- API Key: Your Gemini API key (optional - will use mock mode if not set)
- Review Style: Choose your preferred style
- Auto-generate on Save: Enable/disable
📖 Usage
Manual Review Generation
- Open a supported file (
.go
, .js
, .ts
, .py
)
- Press
Ctrl+Shift+P
(or Cmd+Shift+P
)
- Type "ReviewerBot: Generate Reviews"
- Reviews will appear above function definitions
API Key Management
- Set API Key: Press
Ctrl+Shift+P
→ "ReviewerBot: Set Gemini API Key"
- Clear API Key: Press
Ctrl+Shift+P
→ "ReviewerBot: Clear Gemini API Key"
- Show Configuration: Press
Ctrl+Shift+P
→ "ReviewerBot: Show Current Configuration"
- Mock Mode: If no API key is set, mock reviews will be generated
Review Persistence
- Reviews are automatically saved to
.reviewer-bot-reviews.json
in your workspace
- Reviews persist across file sessions and VS Code restarts
- Review history is maintained for each function
AI-Powered Star Ratings
- Star ratings (⭐ to ⭐⭐⭐⭐⭐) are now generated by the AI based on code quality
- Ratings consider: code structure, readability, naming, error handling, performance, and best practices
- No more random ratings - each review gets a quality-based star rating
Clear Reviews
- Press
Ctrl+Shift+P
(or Cmd+Shift+P
)
- Type "ReviewerBot: Clear Reviews"
- All reviews will be removed
Review History
- Click on any CodeLens review above a function
- View the review history for that function
- Select from previous reviews
Auto-generation on Save
Enable in settings to automatically generate reviews when saving files.
🎨 Review Styles
Funny 😄
⭐⭐⭐⭐ Well-structured and funny—this function actually made me smile 😂
function calculateTip(amount) {
...
}
Roast 🔥
⭐⭐ This function has more ifs than your life plan. Still… functional. 🤷
function validateEmail(email) {
...
}
Motivational 💪
⭐⭐⭐⭐⭐ You're doing great! This function rocks! 🚀
function processData(data) {
...
}
Technical 🔧
⭐⭐⭐⭐ Well-structured and efficient code 📊
function calculateAverage(numbers) {
...
}
Hilarious 🤪
⭐⭐⭐ This function is so wild, it needs a leash! 🦮
function complexAlgorithm(a, b, c) {
...
}
Note: Reviews appear as clickable CodeLens above function definitions, not as comments in the code.
🔧 Configuration
Backend Configuration
Environment Variables:
GEMINI_API_KEY
: Your Gemini API key (optional - will use mock mode if not set)
MOCK_MODE
: Set to "true" for testing without API
Extension Configuration
VS Code Settings:
{
"reviewerBot.apiKey": "your-gemini-api-key",
"reviewerBot.reviewStyle": "funny",
"reviewerBot.autoGenerateOnSave": false,
"reviewerBot.enabledLanguages": ["go", "javascript", "typescript", "python"]
}
🧪 Testing
Test Backend
# Test with mock mode
MOCK_MODE=true go run main.go
# Test with sample data
echo '{"file_path": "test.go", "file_content": "func test() {}", "style": "funny"}' | go run main.go
Test Extension
- Open a sample file from
/examples
- Run "ReviewerBot: Generate Reviews"
- Verify reviews appear above functions
📁 Project Structure
reviewer-bot/
├── backend/ # Go backend
│ ├── main.go # Entry point
│ ├── parser/ # Function parsing
│ ├── gemini/ # Gemini API client
│ ├── review/ # Review generation
│ ├── types/ # Data structures
│ └── go.mod # Go dependencies
├── extension/ # VS Code extension
│ ├── src/ # TypeScript source
│ ├── package.json # Extension manifest
│ └── tsconfig.json # TypeScript config
├── examples/ # Sample files
│ ├── sample.go
│ ├── sample.js
│ └── sample.py
└── README.md
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
📝 License
MIT License - see LICENSE file for details
🙏 Acknowledgments
- Google Gemini 2.0 Flash API for AI-powered reviews
- VS Code Extension API for the development platform
- Go community for the excellent standard library
🐛 Troubleshooting
Backend Issues
- Executable not found: Ensure
reviewer-bot.exe
is in workspace root
- API key invalid: Verify your Gemini API key
- Permission errors: Check file permissions for executable
Extension Issues
- Backend not found: Ensure Go executable is in workspace root
- No reviews generated: Check file type support
- Configuration errors: Verify settings in VS Code
Common Solutions
- Restart VS Code after configuration changes
- Check Developer Tools console for error messages
- Verify Go executable is in workspace root
- Test with mock mode first
Happy coding with ReviewerBot! 🎉