OpenCode
An open-source, provider-agnostic AI coding agent for the terminal, with a headless server, build and plan agents, and support for 75+ model providers.

OpenCode is an open-source AI coding agent that runs in your terminal. It reads your repository, edits files, runs shell commands, and completes multi-step tasks through the same read-plan-edit-run loop as Claude Code , but it is not tied to any single model vendor. You point it at Anthropic, OpenAI, Google, a local model, or any of 75+ providers, and the agent behaves the same way underneath. It is released under the MIT license and is built by the team that originated it in the SST open-source ecosystem, now organised under the Anomaly org.
The distinctive design choice is a client/server split. OpenCode runs a headless server that does the real work, and the terminal interface (TUI), a desktop app, an IDE extension, and a web view are all clients that talk to it. That means the same session can be driven from more than one surface, and the agent can run on a remote machine while you attach from your laptop.
Where OpenCode sits in the stack
Installation
OpenCode ships as a single command install script, and through most package managers.
# Install script (macOS, Linux, WSL)
curl -fsSL https://opencode.ai/install | bash
# Or via a package manager
npm install -g opencode-ai
brew install anomalyco/tap/opencodeOnce installed, start it in a project directory. Running with no arguments opens the terminal interface.
cd my-project
opencode # launch the TUI in the current repoTwo ways to use it
The first pattern is an interactive session. Inside the TUI you run /init once to let the agent survey the project, /connect to authenticate a provider, and /models to choose the model. Press Tab to switch between the full-access build agent and the read-only plan agent, which asks permission before it edits files or runs commands.
# Inside the OpenCode TUI
/init # survey the repo and write an AGENTS.md
/connect # authenticate a provider (OAuth or API key)
/models # pick a model, e.g. anthropic/claude-sonnet-4-5
# type a task, then press Tab to flip between build and planThe second pattern is a project config file, opencode.json, checked into the repo so the whole team shares one setup. This example pins a model, wires an API key from the environment, and sets the server port.
{
"$schema": "https://opencode.ai/config.json",
"model": "anthropic/claude-sonnet-4-5",
"provider": {
"anthropic": { "options": { "apiKey": "{env:ANTHROPIC_API_KEY}" } }
},
"autoupdate": true,
"server": { "port": 4096 }
}For scripting and CI, OpenCode also runs one-shot prompts without the interface: opencode run "write unit tests for the auth module".
Typical workflow
How it compares
| OpenCode | Claude Code | Crush | Aider | |
|---|---|---|---|---|
| Maintainer | Anomaly (SST) | Anthropic | Charm | Aider community |
| License | MIT | Proprietary | FSL-1.1-MIT | Apache-2.0 |
| Language | TypeScript | Proprietary | Go | Python |
| Model coupling | Any provider | Anthropic only | Any provider | Any provider |
| Interface | TUI, desktop, IDE, web | Terminal, VS Code, desktop | Terminal only | Terminal |
| Best for | Multi-surface, provider choice | Deep Anthropic-native work | One fast Go binary | Git-centric pair coding |
Crush deserves a note here because of the shared name. The original OpenCode was a Go project (opencode-ai/opencode); it was archived, and its author continued the work at Charm under the name Crush
. The OpenCode described on this page is a separate TypeScript agent that carries the opencode name today. If you want a single self-contained Go binary, Crush is the closer fit; if you want the multi-client server architecture and the build/plan agent system, OpenCode is.
When not to use it
- You want one static binary with no runtime. OpenCode is a TypeScript stack with a server component. Crush ships as a single Go binary with fewer moving parts.
- You need a pinned, reproducible CLI. OpenCode releases very frequently and enables auto-update by default. For locked toolchains, disable
autoupdateand pin a version, or choose a slower-moving tool. - You are all-in on one vendor’s managed features. If you only ever use Anthropic models and want the tightest native integration, subagents, and hooks, Claude Code is built for that. OpenCode trades vendor-specific depth for provider breadth.
- You want a graphical editor. OpenCode is terminal-first. If you want AI inside a full IDE, Cursor or a VS Code extension such as Cline fits better.
Further reading
- OpenCode documentation : official install, configuration, agents, and provider setup.
- OpenCode on GitHub : source, issues, and release history under the MIT license.
- Open-source coding agents compared : where OpenCode sits among the Claude Code alternatives.
- Claude Code vs Cursor vs Codex : the proprietary tools OpenCode competes with.
- Aider : the git-centric terminal agent, another provider-agnostic option.
- Agentic loops : the read-plan-edit-run cycle every coding agent runs.
Sources
- OpenCode documentation : definition, install commands, build and plan agents, config schema, provider list.
- OpenCode on GitHub
: MIT license, TypeScript,
opencode serveheadless server (repo redirects to the anomalyco org after the maintainers’ rename). - Crush on GitHub : Charm’s terminal agent, FSL-1.1-MIT, Go.
- Original opencode-ai/opencode : archived, with the official notice that the project continued as Crush.