# opencode

> The open source AI coding agent for your terminal

- Category: AI Coding / Autonomous Coding Agents
- Language: TypeScript
- Licence: MIT
- Repository: https://github.com/anomalyco/opencode
- Website: https://opencode.ai
- Canonical page: https://ai-tldr.dev/tools/opencode/
- Updated: 2026-10-27

## In short

opencode is the open source AI coding agent for your terminal. You install it as a command-line tool and use it to explore, write, and change code in your projects. It sits in the Autonomous Coding Agents category of the AI Coding tools and is open-source, written in TypeScript and licensed MIT.

## 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.

OpenCode 2.0 runs the agent as one background service that the terminal, web and desktop clients all connect to. It adds a rebuilt server API, a Code Mode that chains tool calls in one script, background subagents and shell commands, hot-reloadable plugins, and an SDK for using OpenCode as a library.

## 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
- Desktop plugins (experimental since 2.2.0) that users can create, install and share

## 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.

1. Install with the script

   The quickest way is the official install script, which picks an install directory automatically.

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

2. Or 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.

```bash
npm i -g @opencode/cli@latest       # or bun/pnpm/yarn
brew install anomalyco/tap/opencode # macOS and Linux
scoop install opencode              # Windows
```

3. Switch 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.

## 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

## Version history

- 2026-10-27 v2.2.0: OpenCode 2.2.0 adds experimental desktop plugins that users can create, install and share, a redesigned desktop app, and prompt cache TTLs set per provider or model. The OpenCode GitHub Action is no longer published, and TUI plugins now need OpenTUI 0.7.
- 2026-10-12 v2.0: OpenCode 2.0 runs as one background service shared by the terminal, web and desktop apps, with a rebuilt API, Code Mode, background subagents and an SDK. Version 1 plugins and server API integrations must be ported.
