Skip to content

๐Ÿ‘ OpenCode โ€‹

OpenCode is an open-source terminal-based AI coding agent built by AnomalyCo. It's model-agnostic, supports 75+ LLM providers, and runs directly in your terminal with full file-system access - a free, community-driven alternative to Claude Code.


๐Ÿ“Š Tool Datasheet โ€‹

MetricDetails
Tool NameOpenCode
CategoryOpen-Source Terminal Coding Agent
PurposeTerminal-based AI pair-programming with full codebase access, shell integration, and MCP support.
DeveloperAnomalyCo
LicenseOpen Source
Installnpm install -g opencode-ai or `curl -fsSL https://opencode.ai/install
Websiteopencode.ai
GitHubgithub.com/anomalyco/opencode

๐Ÿ› ๏ธ Capabilities โ€‹

  1. Codebase Understanding: Indexes project structure, understands dependencies, finds relevant files for any task.
  2. Full File Operations: Reads, edits, creates, and deletes files. Applies patches. Refactors across multiple files.
  3. Shell Integration: Runs build commands, test suites, linters. Parses error output. Debugs failures autonomously.
  4. Git Workflow: Stages changes, writes commit messages, creates branches, pushes - full version control from terminal.
  5. Model-Agnostic: 75+ providers. Use Claude Opus for complex architecture, GPT-5.6 for broad generation, DeepSeek for cost-sensitive work, or local models via Ollama.
  6. MCP Support: Connect to any MCP server for extended tool capabilities.
  7. AGENTS.md Convention: Hierarchical project instructions that guide agent behavior - define coding standards, test requirements, and repo conventions.

๐Ÿงญ Step-by-Step Setup โ€‹

1. Install โ€‹

bash
npm install -g opencode-ai

Or use the curl installer:

bash
curl -fsSL https://opencode.ai/install | bash

2. Start a Session โ€‹

Navigate to your project and run:

bash
cd ~/your-project
opencode

OpenCode reads your project files, indexes the codebase, and waits for instructions in its terminal TUI.

3. Your First Task โ€‹

Inside the session, describe what you want:

text
Add input validation to the user registration endpoint in src/api/users.ts

OpenCode searches the codebase, finds the relevant files, proposes edits, applies them, and can run tests to verify.

4. Multi-Session Work โ€‹

OpenCode supports multiple concurrent sessions. Run opencode in different terminal tabs for different projects or tasks.


๐Ÿ’ก Sample Workflows โ€‹

  1. Code Migration: "Migrate all Express routes in src/routes/ to FastAPI, update type annotations, and verify endpoints with pytest"
  2. Bug Hunt: "Find all instances of potential null pointer dereferences in the auth module and add guard clauses"
  3. Documentation: "Generate JSDoc comments for all exported functions in src/lib/ - follow the existing style in src/lib/crypto.ts"