Kodap VSCode Extension
AI-powered code assistant for VSCode with real-time consensus voting and live dashboard synchronization.
Features
- Real-time Code Analysis: Analyze files with AI models for instant insights and suggestions
- Refactoring: Refactor selected code with multiple AI models voting on the best approach
- Test Generation: Automatically generate unit tests for your code
- Consensus Voting: Multiple LLM models vote on suggestions, showing consensus agreements
- Live Dashboard Sync: All VSCode activity syncs in real-time to your Kodap dashboard
- Usage Tracking: Monitor LLM API usage and costs directly from the sidebar
- Multiple Model Support: Use Claude, GPT-4, Gemini, and more simultaneously
Installation
- Install the extension from the VSCode Marketplace (search for "Kodap")
- Open VSCode and navigate to the Kodap sidebar (click the sparkle icon)
- Authenticate with your Kodap API key
Getting Started
First Time Setup
- Open the Command Palette (
Cmd+Shift+P on macOS, Ctrl+Shift+P on Windows/Linux)
- Run:
Kodap: Authenticate with API
- Enter your API key from your Kodap dashboard
- You're ready to use Kodap!
Basic Commands
Analyze File
Kodap: Analyze This File
- Right-click on any file or use the Command Palette
- Analyzes the current file for code quality, performance, and style issues
Refactor Selection
Kodap: Refactor Selection
- Select code, right-click, and choose "Kodap: Refactor Selection"
- Multiple AI models provide refactoring suggestions
Generate Tests
Kodap: Generate Tests
- Open a file and run this command to generate unit tests
- Tests appear in a new file next to the original (e.g.,
file.test.ts)
View Usage
Kodap: View LLM Usage
- Check your current API usage and estimated monthly costs
- Available in the status bar (bottom right)
Consensus Voting
Displays active AI consensus votes on code suggestions:
- Pending: Awaiting votes from all models
- Voting: Models currently analyzing
- Completed: Consensus reached
Click on any vote to see which models agreed and the reasoning.
LLM Usage
Real-time tracking of your API usage:
- Total API Calls: Cumulative calls in the period
- This Month (Est.): Projected monthly cost
- Providers: Breakdown by AI provider (OpenAI, Anthropic, Google)
- Models: Individual model usage statistics
Configuration
Edit VSCode settings (settings.json) to customize Kodap:
{
"kodap.apiUrl": "http://localhost:7071",
"kodap.autoAnalyze": false,
"kodap.consensusModels": 2
}
Features in Detail
Consensus Voting System
Kodap uses multiple LLMs simultaneously for better suggestions:
- Input: You request an action (analyze, refactor, test)
- Voting: Selected models analyze the code independently
- Consensus: Results are merged; high-agreement suggestions are prioritized
- Output: Most supported solution is presented, with alternative votes visible
Real-time Dashboard Sync
Every action in VSCode is synced to your Kodap dashboard:
- See active coding sessions across your team
- Track which files are being analyzed
- Monitor consensus voting in real-time
- Review LLM usage patterns
Model Presets
Quick-select popular model combinations:
- Balanced: Claude + GPT-4 + Gemini
- Quality: Claude Opus + GPT-4
- Fast: Claude Haiku + GPT-4o mini + Gemini Flash
- Budget: Single model (configurable)
Troubleshooting
Extension Not Activating
- Reload VSCode (
Cmd+Shift+P > "Reload Window")
- Check the Output panel for error messages
- Verify authentication:
Kodap: Authenticate with API
API Connection Failed
- Verify your API key is correct
- Ensure Kodap backend is running on
localhost:7071
- Check internet connection and firewall settings
No Usage Data Showing
- Try refreshing: Click the reload icon in the sidebar
- Ensure you've made at least one API call
- Check that the authentication token is valid
Architecture
Services
- AuthManager: Handles API key storage and token lifecycle
- ApiClient: REST API and WebSocket communication with Kodap backend
- CommandRegistry: Registers and manages all VSCode commands
Views
- ConsensusVotingProvider: Tree view for active consensus votes
- UsageStatsProvider: Tree view for LLM usage statistics
Development
Build
npm install
npm run build
Watch Mode
npm run watch
Run Extension
Open in VSCode and press F5 to launch the debug instance.
API Integration
The extension communicates with the Kodap backend via:
- REST API: For analyzing, refactoring, and generating tests
- WebSocket: For real-time updates on consensus votes and usage stats
All requests include JWT authentication via the Authorization header.
Privacy & Security
- Your API key is stored securely in VSCode's secret storage
- All communication is encrypted with the Kodap backend
- No code is sent to third parties without explicit consent
- Usage data is associated with your account only
Support
For issues, feature requests, or questions:
License
MIT - See LICENSE file for details