FetchCoder - AI Coding Agent for the Terminal
FetchCoder is an AI coding agent built for the terminal. Powered by ASI1, it provides a powerful, extensible platform for AI-assisted development.
🚀 Quick Start
Installation
Install FetchCoder globally via npm:
npm install -g @fetchai/fetchcoder
The installer will:
- Automatically detect your platform (macOS, Linux, Windows)
- Download the appropriate binary for your system
- Install to
~/.fetchcoder/bin/
- Set up PATH and configurations
- Install with default API keys for immediate use
Usage
After installation, start FetchCoder:
# Interactive TUI mode
fetchcoder
# CLI mode - run a single task
fetchcoder run "write a Python hello world script"
# API server mode
fetchcoder serve
# Check version
fetchcoder --version
# Get help
fetchcoder --help
✨ Features
- 🎨 Interactive TUI: Beautiful terminal interface with syntax highlighting
- 🔧 Tool-Based Architecture: File operations, code execution, search, and more
- 🌐 API Server Mode: Run as a service with RESTful API
- 🔌 MCP Integration: 30+ essential Agentverse tools for agent management
- 🎯 Agent System: Specialized AI agents for different development tasks
- 🚀 Lightning Fast: Built with Go and TypeScript for maximum performance
- 🔐 Secure: API keys stored safely, no telemetry or data collection
🔑 API Configuration
Default Test Keys
FetchCoder includes default test API keys that work out of the box:
- ASI1 API Key: Pre-configured for immediate use
- Agentverse API Key: Pre-configured for MCP tools
These are provided for convenience but may have rate limits.
Using Your Own Keys (Recommended)
For production use, get your own API keys:
-
ASI1 API Key (Required)
- Visit: https://asi1.ai
- Sign up and generate your API key
-
Agentverse API Key (Optional - for MCP features)
- Visit: https://agentverse.ai/settings/api-keys
- Sign up and generate your API key
Setting Your Keys
You can set your API keys in multiple ways:
Option 1: Environment Variables (Temporary)
export ASI1_API_KEY="your-asi1-key-here"
export AGENTVERSE_API_KEY="your-agentverse-key-here"
fetchcoder
Option 2: User Configuration File (Permanent)
# Edit the user config file
nano ~/.fetchcoder/.env
# Add your keys:
ASI1_API_KEY=your-asi1-key-here
AGENTVERSE_API_KEY=your-agentverse-key-here
Option 3: Shell Configuration (Permanent)
# Add to ~/.zshrc or ~/.bashrc
echo 'export ASI1_API_KEY="your-asi1-key-here"' >> ~/.zshrc
echo 'export AGENTVERSE_API_KEY="your-agentverse-key-here"' >> ~/.zshrc
source ~/.zshrc
Configuration Priority
FetchCoder loads API keys in this order (first found wins):
- Environment variables
- User config:
~/.fetchcoder/.env
- Installation directory:
.env
- Default test keys (built-in fallback)
📖 Usage Examples
Interactive TUI Mode
Launch the beautiful terminal interface:
fetchcoder
Features:
- Multiple color themes (
Ctrl+X T
to switch) - Full markdown rendering with syntax highlighting
- Real-time streaming responses
- Multi-agent switching with Tab
- Session management and export
CLI Mode
Run single tasks directly:
# Generate code
fetchcoder run "create a REST API with Express.js"
# Refactor code
fetchcoder run "refactor this function to use async/await" --file app.js
# Debug issues
fetchcoder run "fix the TypeScript errors in this project"
# Use with pipes
cat error.log | fetchcoder run "explain these errors"
# Specify a model
fetchcoder run "optimize this SQL query" --model claude-3-opus
API Server Mode
Start FetchCoder as an API service:
fetchcoder serve --port 3000
Then use the REST API:
curl -X POST http://localhost:3000/api/chat \
-H "Content-Type: application/json" \
-d '{"message": "write a fibonacci function in Python"}'
🔧 Configuration
Configuration File
FetchCoder uses ~/.fetchcoder/fetchcoder.json
for configuration:
{
"$schema": "https://fetchcoder.ai/config.json",
"model": "asi1/asi1-mini",
"temperature": 0.7,
"theme": "fetchcoder",
"editor": "vim",
"mcp": {
"agentverse": {
"type": "local",
"command": ["mcp-server"],
"enabled": true,
"environment": {
"AGENTVERSE_MCP_ESSENTIAL_ONLY": "true"
}
}
}
}
MCP Essential Mode
The package includes 30 essential Agentverse MCP tools:
- Agent lifecycle (create, update, delete, start, stop)
- Agent inspection and monitoring
- Secrets and storage management
- Messaging operations
- Registry/Almanac operations
- Team agent management
- Asset management
To enable all 137 tools, set AGENTVERSE_MCP_ESSENTIAL_ONLY
to "false"
.
🎯 Agent System
FetchCoder includes specialized agents:
- General: Multi-step tasks and research
- Build: Compilation and dependency management
- Plan: Architecture design
- Agentverse: Production-ready Fetch.ai agents
Switch agents in TUI with Tab
or via CLI:
fetchcoder agent agentverse "create a weather forecasting agent"
⌨️ Keyboard Shortcuts
FetchCoder uses a leader key system (default: Ctrl+X
):
Shortcut | Action |
---|---|
Ctrl+X H | Show help |
Ctrl+X N | New session |
Ctrl+X M | Change model |
Ctrl+X T | Change theme |
Ctrl+X A | Change agent |
Ctrl+X S | Share session |
Ctrl+X E | Open editor |
Ctrl+X Q | Quit |
Tab | Next agent |
Enter | Submit |
🔄 Upgrading
Update to the latest version:
npm install -g @fetchai/fetchcoder@latest
Or use the built-in upgrade command:
fetchcoder upgrade