Skip to main content
Version: Next

FetchCoder - AI Coding Agent for the Terminal

npm version License: MIT

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.

For production use, get your own API keys:

  1. ASI1 API Key (Required)

  2. Agentverse API Key (Optional - for MCP features)

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):

  1. Environment variables
  2. User config: ~/.fetchcoder/.env
  3. Installation directory: .env
  4. 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):

ShortcutAction
Ctrl+X HShow help
Ctrl+X NNew session
Ctrl+X MChange model
Ctrl+X TChange theme
Ctrl+X AChange agent
Ctrl+X SShare session
Ctrl+X EOpen editor
Ctrl+X QQuit
TabNext agent
EnterSubmit

🔄 Upgrading

Update to the latest version:

npm install -g @fetchai/fetchcoder@latest

Or use the built-in upgrade command:

fetchcoder upgrade

🐛 Troubleshooting

Command not found

After installation, reload your shell:

source ~/.zshrc  # or ~/.bashrc
# or restart your terminal

Permission denied

On macOS, if you see security warnings:

xattr -d com.apple.quarantine ~/.fetchcoder/bin/*

Or go to System Settings → Privacy & Security and click "Allow Anyway".

API key errors

Check your configuration:

# View current config
fetchcoder config get

# Set API key
echo 'ASI1_API_KEY=your-key-here' >> ~/.fetchcoder/.env

Debug mode

Enable detailed logging:

DEBUG=* fetchcoder run "test"