AI-powered code review for VS Code, integrated with your CrewAI deployed agent. Analyze the active file for quality issues, optimizations, security concerns, and inline suggestions.
Features
- CrewAI AMP integration — kickoff + status polling against your deployed agent
- Command Palette —
AI Code Review: Analyze Current File - Sidebar panel — "AI Reviewer" with Issues, Optimizations, and Suggestions
- Editor toolbar button — sparkle icon in the editor title bar
- Inline suggestions — line highlights and hover tooltips (when the agent returns line numbers)
- Secure API key storage — Bearer token via VS Code Secret Storage
Quick start (for users installing the extension)
- Install the extension from the Marketplace or a
.vsixfile. - Open the Command Palette and run AI Code Review: Set API Key.
- Paste your Bearer token from the CrewAI dashboard → your crew → Status tab.
- Open any code file and run AI Code Review: Analyze Current File.
The default API URL points to the deployed CrewAI agent:
https://vs-code-code-optimizer-inline-suggestions-a-e0d6590d.crewai.com
Developer setup
cd d:\extension
npm install
npm run compile
For local development, edit .env (gitignored, not published):
AI_REVIEW_API_URL=https://vs-code-code-optimizer-inline-suggestions-a-e0d6590d.crewai.com
AI_REVIEW_API_KEY=your-crewai-bearer-token
AI_REVIEW_API_KEY_HEADER=Authorization
AI_REVIEW_REQUEST_TIMEOUT=180000
Press F5 to launch the Extension Development Host.
CrewAI API flow
When the configured URL contains crewai.com, the extension:
POST /kickoffwith{ "inputs": { "code": "...", "language": "..." } }- Polls
GET /status/{kickoff_id}until complete - Parses
issues,optimizations, andsuggestionsfrom the agent output
Your crew should return JSON like:
{
"issues": [{ "message": "Avoid eval()", "line": 12, "severity": "error" }],
"optimizations": ["Use const instead of let"],
"suggestions": [{ "message": "Extract into a helper", "line": 45 }]
}
Configuration
| Setting | Default | Description |
|---|---|---|
aiCodeReview.apiUrl |
CrewAI deployed URL | Agent base URL (no /kickoff suffix) |
aiCodeReview.apiKey |
— | Bearer token (prefer Set API Key command) |
aiCodeReview.requestTimeout |
180000 |
Max wait for agent execution (ms) |
aiCodeReview.enableInlineSuggestions |
true |
Line highlights and hovers |
Config priority: VS Code Settings → .env (dev only) → Secret Storage → defaults.
Commands
| Command | Description |
|---|---|
AI Code Review: Analyze Current File |
Run code review on the active editor |
AI Code Review: Set API Key |
Store CrewAI Bearer token securely |
AI Code Review: Clear Stored API Key |
Remove stored token |
AI Code Review: Clear Inline Highlights |
Remove editor decorations |
Package and publish
npm run package
# Creates: ai-code-reviewer-1.0.0.vsix
Install locally:
code --install-extension ai-code-reviewer-1.0.0.vsix
Publish to Marketplace:
- Create a publisher at marketplace.visualstudio.com/manage
- Change
"publisher"inpackage.jsonto your publisher ID - Create an Azure DevOps PAT with Marketplace → Manage scope
- Run:
npx vsce login your-publisher-id
npm run publish
Troubleshooting
| Problem | Solution |
|---|---|
| Authentication failed | Run Set API Key with your CrewAI Bearer token |
| Request timed out | Increase aiCodeReview.requestTimeout (agent may need more time) |
| Cannot connect | Verify the CrewAI deployment is live in the dashboard |
| No inline highlights | Ensure the agent returns line numbers in issues/suggestions |
| Empty file warning | Open a file with code content |
License
MIT