FetchCoder for VS Code
AI-powered coding assistant that brings FetchCoder directly into VS Code

FetchCoder for VS Code integrates the powerful FetchCoder AI coding agent into Visual Studio Code, providing a Cursor-like experience with chat, compose mode, and intelligent code actions.
⚠️ Important: This extension requires a custom REST API server (included in the api-server/ directory) because the standard fetchcoder serve command doesn't implement the necessary REST endpoints. See Prerequisites below for setup instructions.
✨ Features
💬 Interactive Chat Panel
- Real-time streaming responses with progress indicators
- Syntax-highlighted code blocks
- Markdown rendering
- Conversation history and context awareness
- Multiple specialized agents
- Workspace-aware: automatically works in your project directory
- Live progress updates showing tool calls and file operations
🎨 Compose Mode
- Multi-file editing with AI assistance
- Visual diff view for proposed changes
- Accept/reject individual changes
- Atomic multi-file operations
🔧 Inline Code Actions
- Quick fixes with AI suggestions
- Code explanation on selection
- Smart refactoring suggestions
- Error fixing with diagnostics context
🤖 Multiple AI Agents
- General: Multi-step tasks and research
- Build: Compilation and dependency management
- Plan: Architecture design and planning
- Agentverse: Production-ready Fetch.ai agents
📊 Automatic Diff Viewer
- Automatic change tracking: Snapshots workspace before FetchCoder runs
- Visual change list: See all files created, modified, or deleted
- Native diff viewing: Click any change to view side-by-side diff
- Real-time updates: Changes appear automatically after each operation
- Change history: Review all modifications made during your session
📋 Prerequisites
Before using this extension, you need:
FetchCoder CLI installed globally:
npm install -g @fetchai/fetchcoder
VS Code version 1.80.0 or higher
API Server Setup (Automated):
The extension will automatically set up and start the API server on first launch! Just click "Setup Now" when prompted.
Manual setup (if needed):
- Open Command Palette (
Ctrl+Shift+P or Cmd+Shift+P)
- Run:
FetchCoder: Setup API Server
- The extension will automatically copy files and start the server
Note: The standard fetchcoder serve command doesn't provide the REST endpoints we need, so this extension includes a custom API server that wraps the FetchCoder CLI.
🚀 Installation
From VSIX (Manual)
- Download the
.vsix file from releases
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X)
- Click the
... menu → "Install from VSIX..."
- Select the downloaded
.vsix file
From Source
# Clone the repository
git clone https://github.com/fetchai/fetchcoder-vscode.git
cd fetchcoder-vscode
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Package the extension
npm install -g @vscode/vsce
vsce package
# Install the generated .vsix file in VS Code
🎯 Usage
First Time Setup
On first launch, the extension will prompt you to set up the API server:
- Click "Setup Now" when prompted
- The extension automatically installs and starts the API server
- You'll see a confirmation: "✅ FetchCoder API server is ready!"
- Start coding with AI assistance!
API Server Management
Control the API server from the Command Palette:
FetchCoder: Setup API Server - Install and configure the server
FetchCoder: Start API Server - Start the server
FetchCoder: Stop API Server - Stop the server
FetchCoder: Check API Server Status - View server status
The server runs at http://localhost:3000 and starts automatically when you open VS Code.
Opening Chat
- Use keyboard shortcut:
Ctrl+Shift+F C (Mac: Cmd+Shift+F C)
- Or command palette:
FetchCoder: Open Chat
- Or click the FetchCoder icon in the activity bar
Using Compose Mode
- Press
Ctrl+Shift+F M (Mac: Cmd+Shift+F M)
- Describe the changes you want to make
- Review proposed changes with diff view
- Accept or reject individual changes
Inline Code Actions
- Select code in the editor
- Right-click → FetchCoder options
- Or use quick actions (lightbulb icon)
- Choose: Ask, Explain, Refactor, or Fix
Viewing Changes with Diff Viewer
- After FetchCoder makes changes, a notification appears
- Click "View Changes" or use command palette:
FetchCoder: Open Diff Viewer
- See list of all modified, created, and deleted files
- Click "View" on any file to see side-by-side diff
- Changes are tracked automatically for every operation
Keyboard Shortcuts
| Shortcut |
Action |
Ctrl+Shift+F C |
Open Chat |
Ctrl+Shift+F M |
Open Compose Mode |
Ctrl+Shift+F S |
Send Selection to Chat |
Ctrl+Shift+F E |
Explain Code |
Ctrl+Shift+F R |
Refactor Code |
Ctrl+Shift+F F |
Fix Code |
Ctrl+Shift+F A |
Switch Agent |
Replace Ctrl with Cmd on macOS
⚙️ Configuration
Configure the extension in VS Code settings (Ctrl+,):
{
// FetchCoder API server URL
"fetchcoder.apiUrl": "http://localhost:3000",
// Default agent to use
"fetchcoder.defaultAgent": "general",
// Number of relevant files to include in context
"fetchcoder.autoContextFiles": 5,
// Enable inline code actions
"fetchcoder.enableInlineActions": true,
// Enable streaming responses
"fetchcoder.streamResponses": true
}
🔑 API Keys
FetchCoder comes with default test API keys. For production use, set your own:
ASI1 API Key (Required)
- Visit https://asi1.ai
- Sign up and generate your API key
- Set the key in FetchCoder:
echo 'ASI1_API_KEY=your-key-here' >> ~/.fetchcoder/.env
Agentverse API Key (Optional)
- Visit https://agentverse.ai/settings/api-keys
- Generate your API key
- Set the key:
echo 'AGENTVERSE_API_KEY=your-key-here' >> ~/.fetchcoder/.env
🐛 Troubleshooting
"Unable to connect to FetchCoder API"
Solution: The API server may not be running. Try:
- Open Command Palette (
Ctrl+Shift+P)
- Run:
FetchCoder: Check API Server Status
- If not running, click "Start Server" or run
FetchCoder: Start API Server
Manual verification:
curl http://localhost:3000/health
API Server Won't Start
- Check if FetchCoder CLI is installed:
ls ~/.fetchcoder/bin/fetchcoder
- If not found, install FetchCoder:
npm install -g @fetchai/fetchcoder
- Re-run:
FetchCoder: Setup API Server
Server Already Running on Port 3000
If port 3000 is in use, stop any existing server:
# Check what's using port 3000
lsof -i :3000
# Or use the extension command
Run: FetchCoder: Stop API Server
Raw JSON responses in chat
If you see raw JSON like {"response":"..."}:
- Run:
FetchCoder: Stop API Server
- Run:
FetchCoder: Start API Server
- Reload VSCode:
Ctrl+Shift+P → "Developer: Reload Window"
Connection on different port
If running the API server on a different port:
PORT=8080 ~/.fetchcoder/start-api-server.sh
Then update VS Code settings:
{
"fetchcoder.apiUrl": "http://localhost:8080"
}
Extension not activating
- Check VS Code version (must be 1.80.0+)
- Reload window:
Ctrl+Shift+P → "Developer: Reload Window"
- Check extension logs:
Ctrl+Shift+P → "Developer: Show Logs" → "Extension Host"
📖 Examples
Example 1: Code Explanation
- Select a function in your code
- Press
Ctrl+Shift+F E
- Get a detailed explanation in the chat panel
Example 2: Multi-File Refactoring
- Open Compose Mode (
Ctrl+Shift+F M)
- Type: "Extract authentication logic into a separate auth.ts file"
- Review the proposed changes
- Accept all or individual changes
Example 3: Bug Fixing
- Select code with errors (red squiggles)
- Click the lightbulb icon
- Select "Fix with FetchCoder"
- Get AI-powered fix suggestions
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature)
- Commit your changes (
git commit -m 'Add some AmazingFeature')
- Push to the branch (
git push origin feature/AmazingFeature)
- Open a Pull Request
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🔗 Links
💡 Tips
- Context is key: The extension automatically includes relevant open files in your requests
- Workspace awareness: FetchCoder automatically works in your current workspace folder - files are created/modified in the right location
- Conversational context: The chat remembers your conversation history, so you can ask follow-up questions naturally
- Track changes: Check the Diff Viewer to see exactly what FetchCoder modified in your project
- Use specific agents: Switch to specialized agents for better results (Build for compilation issues, Plan for architecture questions)
- Compose for big changes: Use Compose Mode instead of Chat for multi-file modifications
- Keyboard shortcuts: Learn the shortcuts to speed up your workflow
- Progress indicators: Watch the live progress updates to see what FetchCoder is doing in real-time
🙏 Acknowledgments
Built with ❤️ using:
Happy Coding with FetchCoder! 🤖✨