Overview
OpenCode is an open source AI coding agent that works from your terminal. You install it as a command-line tool and use it to explore, write, and change code in your projects.
It ships with two built-in agents you switch between using the Tab key: a full-access build agent for development work, and a read-only plan agent for analysis and code exploration. A general subagent handles complex searches and multistep tasks.
Beyond the terminal, OpenCode also offers a beta desktop application for macOS, Windows, and Linux, so you can use the same agent through a graphical app.
What it does
- Runs as a terminal-based AI coding agent you install once and use across projects
- Built-in build agent with full access for hands-on development work
- Read-only plan agent that denies file edits and asks before running bash commands, good for exploring unfamiliar code
- General subagent for complex searches and multistep tasks, callable with @general in messages
- Switch between agents instantly with the Tab key
- Optional beta desktop app for macOS, Windows, and Linux alongside the CLI
Getting started
OpenCode installs as a command-line tool. You can use the install script, a package manager, or a platform-specific installer, then run it inside any project directory.
Install with the script
The quickest way is the official install script, which picks an install directory automatically.
curl -fsSL https://opencode.ai/install | bashOr install with a package manager
OpenCode is published to npm and several other package managers, so you can use the one that fits your setup.
npm i -g opencode-ai@latest # or bun/pnpm/yarn
brew install anomalyco/tap/opencode # macOS and Linux
scoop install opencode # WindowsSwitch agents while you work
Once running, press Tab to switch between the build agent (full access) and the plan agent (read-only). Use @general in a message to call the general subagent for complex searches and multistep tasks.
Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Writing and editing code in a project directly from the terminal with the full-access build agent
- Exploring an unfamiliar codebase or planning changes safely with the read-only plan agent
- Running complex searches and multistep tasks through the general subagent
- Using the same coding agent through a desktop app on macOS, Windows, or Linux
How opencode compares
opencode alongside other open-source autonomous coding agents tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| opencode | ★ 176k | The open source AI coding agent for your terminal |
| Gemini CLI | ★ 105k | An open-source command-line AI agent from Google that connects your terminal to Gemini models for reading code, editing files, running shell commands, and searching the web. |
| OpenHands | ★ 77.8k | An open-source AI software-development agent that plans tasks, edits files, runs commands, and tests code, usable from a terminal CLI, a local web GUI, or a Python SDK. |
| Goose | ★ 49.8k | Goose is an open-source AI agent that runs on your machine for code, research, automation, and more, with a desktop app, CLI, and API built in Rust. |
| Continue | ★ 34.1k | Continue is an open-source coding agent available as a CLI, VS Code extension, and JetBrains plugin, plus version-controlled AI checks that run on pull requests in CI. |
| Vibe Kanban | ★ 27.1k | Vibe Kanban lets you plan tasks on a kanban board, run coding agents like Claude Code and Codex in isolated workspaces, then review their diffs and ship pull requests. |
| Serena | ★ 25.6k | Serena is an open-source MCP toolkit that gives any LLM coding agent symbol-level code retrieval, editing, and refactoring across 40+ languages. |
| Crush | ★ 25.5k | Crush is a terminal coding agent from Charm. It connects your code, tools, and workflows to any OpenAI- or Anthropic-compatible LLM, with LSP context and MCP plugins. |