← Back to Coding & Development

OpenCode

Open-source terminal AI coding agent that reads and writes code in the command line, supporting dozens of model providers.

Coding & DevelopmentFree tier + paidGlobal★ 3.7
curl -fsSL https://opencode.ai/v2/install | bash

At a Glance & Reviews

PricingFree tier + paid
OriginGlobal
Community Score★ 3.7 / 5 (8)

Community Discussions (8)

About OpenCode

OpenCode is an open-source coding agent developed by the Anomaly team, which also maintains developer tools such as SST. The project is open-sourced under the MIT license, with its repository originally hosted under the sst name and now migrated to the anomalyco organization. It addresses the problem where developers want an agent to enter real code repositories to read files, modify code, and run commands without being locked into a single model vendor or editor; therefore, from the outset, it designed the model layer to be interchangeable and built entry points across the terminal, desktop, and editors in parallel, allowing the same task to be continued across different locations.

Its agent architecture is divided into two tiers: primary agents and subagents. The two built-in primary agents are switched using the Tab key: Build is the default primary mode, holding full tool permissions to read and write files and execute commands; Plan is a read-only analysis mode where file edits and command executions require confirmation by default, making it suited for understanding repository structure and discussing approaches before taking action. Subagents are invoked by the primary agent according to the task, or can be summoned manually by the user; these include General for handling general multi-step tasks, Explore for quickly navigating codebases and locating files by path or symbol, and Scout for retrieving external documentation and open-source code. Users can also define their own review-oriented or specialized agents in configuration files or Markdown files, specifying separate models, prompts, and tool permissions.

Multi-model access is its core design. Through the AI SDK and the Models.dev directory, it connects to over 75 model providers, covering cloud vendors such as Anthropic, OpenAI, Google, AWS Bedrock, Azure, OpenRouter, and Groq, as well as local runtimes like Ollama and LM Studio. Models are uniformly addressed in a provider/model-name format and can be switched mid-session. Existing subscriptions can also be utilized directly: the official documentation supports logging into ChatGPT Plus and Pro subscriptions as well as GitHub Copilot and GitLab Duo subscriptions to invoke models without purchasing separate API credits. However, the official provider documentation explicitly notes that Anthropic prohibits using Claude Pro and Max subscriptions via plugins in OpenCode; since version 1.3.0, such plugins are no longer bundled officially, and Claude models should be accessed through compliant paths such as API keys.

The terminal interface is its primary workspace. Once launched in any project directory, the interface allows describing tasks, viewing file change diffs, undoing the previous step, and sharing sessions. Configuration uses two-tier JSON or JSONC files in the project root directory and the global directory, and API keys entered via the connect command are stored in a local authentication file without passing through its servers. Project rules are captured in an AGENTS.md file generated during project initialization, detailing structure, conventions, and patterns for the agent to follow; if a CLAUDE.md file already exists in the project, it is also read as fallback rules. Language Server Protocol integration enables it to recognize types and reference relationships when editing code, rather than performing plain text replacement.

The desktop and editor clients extend the same set of capabilities. The desktop application covers macOS, Windows, and Linux, offering multi-session support, tabs, diff viewing, and a built-in browser suited for running several tasks concurrently. Editor extensions can be installed in VS Code, Cursor, Windsurf, VSCodium, and similar editors. It also offers CLI modes such as headless execution, running a local server, and a web interface; GitHub integration allows mentioning it in issue or pull request comments so it can handle tasks directly inside GitHub Actions environments, while a mobile client can be used to monitor long-running task progress and perform approvals.

Extension mechanisms include the Model Context Protocol, plugins, and skills. It can connect via MCP to external tools such as GitHub, Linear, Figma, Notion, and Slack, bringing issues, designs, and documents into coding sessions. The plugin mechanism allows hooking into events before and after tool calls to customize behavior, while skills are discovered and loaded on demand from project or global skill directories, capturing fixed team review sequences, pre-release checklists, and other workflows into reusable instruction sets to maintain consistent practices across repositories.

Getting started is relatively straightforward. On macOS and Linux, it can be installed in one step using the official installation script, installed globally via npm i -g opencode-ai, or installed via Homebrew, Scoop, Chocolatey, Docker, and other methods, with the official documentation noting alternative methods on Windows when certain package manager paths are not recommended. Entering a project directory and running opencode launches the terminal interface, where users first run the connect command to select a provider and enter an API key or log into an existing subscription; users without keys can also try its built-in free models first, though the official documentation specifically notes that some free models may collect data during the trial period to improve their models. Users then run the init command to have it analyze the repository and generate AGENTS.md, commit it to version control after review, and begin asking about structure in Plan mode and modifying code in Build mode.

Typical scenarios fall into three categories. First, when taking over an unfamiliar repository, starting in Plan mode to let the Explore subagent map out module divisions and key entry points, then having Build fix bugs or add features based on those findings. Second, daily cross-file modifications, adding tests, and code review assistance, where every edit remains in diffs for item-by-item confirmation and mistakes can be reverted step by step using undo, making it easier to review than a single sweeping change. Third, running long tasks continuously on a remote server while monitoring progress locally from desktop or mobile, suited for projects that require running builds and tests in a server environment.

In terms of pricing, the core software is completely free and open-source, requiring no account to use all features, with costs coming solely from models. The first option is bringing your own API keys or existing subscriptions, paying the provider's standard rates with no markup. The second is OpenCode Go, a $10/month subscription curating a set of primarily open-weight coding models, with usage caps metered in dollar amounts per model and tiered across 5-hour, weekly, and monthly limits; higher quotas are available via Go Plus at $40/month, and shared team workspaces are available via Go Teams at $20 per member per month, with team workspaces currently in beta. The third is OpenCode Zen, a pay-as-you-go model gateway featuring models tested and selected by the team for coding agent scenarios, deducted from a prepaid balance at published per-million-token rates and covering proprietary models such as Claude, GPT, and Gemini. The official website emphasizes that when using bring-your-own providers, it does not store user code or context data.

Compared with official coding agents tied to a single vendor's models, OpenCode's differences center on choice and deployment form: the same workflow can use Claude today and switch to open-source or local models tomorrow without changing habits, while rule files, skills, and MCP configurations remain unchanged. Compared with assistants confined to an editor sidebar, it is terminal-centric while extending to desktop, editors, and continuous integration environments, with a client-server architecture that makes remote execution routine—at the trade-off that users must combine and validate model quality, speed, and cost themselves rather than relying on a default configuration pre-selected by a vendor.

Frequently Asked Questions

Is OpenCode free?

Partly. OpenCode has a free tier; higher limits or advanced features are paid. Check the official site for current plans and limits.

Sign in to Lumo

Sign in with a one-time code sent to your email — no password. Your saved tools will sync across your devices.

The code is only used to sign you in. We store just your email and saved list (privacy policy, in Chinese).

—

Signed in. Your saved tools sync across all your devices.

0saved
View saved tools

Send feedback

Found a mistake, missing something, or have a suggestion? Tell us.