What it does
An open-source AI coding agent with a terminal UI, a desktop app for macOS, Windows and Linux, and a web interface. It works with many LLM providers, and OpenCode also sells its own model access (OpenCode Console and the OpenCode Go plan). It ships a build agent that makes changes and a plan agent that plans without editing your project files. The current version is OpenCode 2. The code is on GitHub at anomalyco/opencode. MIT licensed.
Using OpenCode in the terminal
- Run opencode inside a project folder to open the terminal UI, or opencode <folder> to work somewhere else.
- Use /connect to sign in to a provider or add its API key, and /models to choose a model. opencode auth login does the same from your shell.
- Press Shift+Tab (or run /agents) to switch between the build agent, which makes changes, and the plan agent, which plans without editing your project files.
- Add an AGENTS.md file for project instructions. In folders without one, OpenCode reads CLAUDE.md instead.
- Run opencode run "your prompt" to use it from scripts and CI without the full-screen UI.
Where the OpenCode docs are
- opencode.ai/docs: install, config, providers, agents, MCP servers, permissions, troubleshooting and more (OpenCode 2).
- opencode.ai/docs/migrate-v1: moving from OpenCode 1 to OpenCode 2.
- github.com/anomalyco/opencode: source, releases and issues.
Who it's for
Terminal users who want an open-source agent and the freedom to pick their own model provider.
How to set it up
Install OpenCode 2 on macOS or Linux with one of:
bashcurl -fsSL https://opencode.ai/v2/install | bash # or brew install anomalyco/tap/opencode-v2 # or npm install -g @opencode/cliOn Windows, the docs say Windows package managers aren't supported: download the standalone Windows CLI or the desktop app from opencode.ai/docs. Moving from OpenCode 1? Both use the opencode command and don't install side by side, and V1 plugins don't run in V2. See opencode.ai/docs/migrate-v1.
cd into your project and start OpenCode, then run /connect to add a provider and /models to pick a model. Press Shift+Tab to switch between the build and plan agents.
bashcd your-project opencode
Check the official OpenCode docs for the latest steps.
Set it up / Fixes
Step-by-step guides for getting OpenCode running and fixing common errors.
Frequently asked questions
What is OpenCode?
An open-source AI coding agent you run in your terminal, a desktop app or a web interface. You connect a model provider you already use, or OpenCode's own Console or Go plan.
How do I install OpenCode?
On macOS or Linux, run curl -fsSL https://opencode.ai/v2/install | bash, brew install anomalyco/tap/opencode-v2 or npm install -g @opencode/cli. On Windows, download the standalone CLI or the desktop app from opencode.ai/docs.
Where are the OpenCode docs?
At opencode.ai/docs, which covers OpenCode 2. The source is at github.com/anomalyco/opencode.
Does OpenCode read AGENTS.md?
Yes. It loads your global ~/.config/opencode/AGENTS.md and each AGENTS.md from your current folder up to the project root, and falls back to CLAUDE.md where there is no AGENTS.md.
What is the difference between the build and plan agents?
Build is the default agent that makes changes. Plan explores and plans without editing normal project files, and shell commands still go through permissions. Press Shift+Tab to switch.
Can OpenCode 1 and 2 be installed together?
Not by default. Both use the opencode command. Remove a package-managed V1 install before installing V2; the V2 curl installer replaces the V1 program.
Example prompts
Switch to the plan agent and explain how authentication works in this repo.Add pagination to the /api/posts endpoint and update the tests.Add the Context7 MCP server to this project and check that it connects.Made OpenCode? Add the badge
If you like, show that OpenCode is listed and hand-checked here. It's optional: listings are free and we never ask for a link back.
Get the Markdown or HTML
Markdown (for a GitHub README)
[](https://www.pluginstackai.com/plugins/opencode/)HTML (for a website)
<a href="https://www.pluginstackai.com/plugins/opencode/"><img src="https://www.pluginstackai.com/badge/hand-checked.svg" alt="Hand-checked on PluginStack" width="226" height="28"></a>Free: MCP Starter Checklist
After you set this tool up, use the one-page checklist so your next MCP server doesn't fail on first connect.
More Coding Agents
- Aider
Aider
Open-source AI pair programming in your terminal. It edits code in your local git repo and works with many LLMs (Claude, DeepSeek, OpenAI models and more).
- Anthropic
Claude Code
Anthropic's agentic coding tool. It reads your codebase, edits files, runs commands, works with git and connects to MCP servers. It runs in the terminal, with VS Code/JetBrains extensions, a desktop app and a web version too.
- AWS Labs
CLI Agent Orchestrator (CAO)
An open-source tool from AWS Labs that lets one supervisor agent hand work to other coding agents, in parallel or one after another. It runs a local server, starts each agent CLI in its own terminal session (tmux), and gives the supervisor tools to assign and check work. Each agent stays a full CLI with its own sign-in. It supports Kiro CLI (the default), Claude Code, Codex CLI, Qwen Code, GitHub Copilot CLI, OpenCode, Cursor CLI and others, and has a web UI. Apache-2.0 licensed.
- OpenAI
Codex CLI
OpenAI's open-source coding agent that runs locally in your terminal. It reads and edits your code, runs commands and connects to MCP servers. Codex also comes as an IDE extension (VS Code, Cursor, Windsurf), a desktop app and a cloud version. Apache-2.0.
- OpenAI
Codex Security
OpenAI's open-source tool for finding and fixing security vulnerabilities with Codex. It scans a repository, selected paths or a diff for vulnerabilities, tries to validate each candidate finding against the source, and can generate a patch and later check whether a fix worked. Each scan saves a Markdown report with source evidence and coverage limits. It also drafts SECURITY.md policies, saves threat models, exports SARIF, JSON and CSV, and can send findings to Linear, Jira or GitHub. You can use it as a plugin inside Codex, as the cs command-line tool, from a TypeScript SDK or in a GitHub Action. Apache-2.0 licensed.
- Agentic AI Foundation (Linux Foundation)
goose
An open-source, general-purpose AI agent that runs on your machine as a desktop app (macOS, Linux, Windows), a CLI and an API. It isn't only for code: it also handles research, writing and automation. It supports 15+ model providers and connects to tools through MCP extensions. Originally from Block, now part of the Agentic AI Foundation. Apache-2.0.