# opencode

> Open source AI coding agent with a terminal UI, built-in build and plan agents, and a desktop app in beta.

Stars: 222.7k · Language: TypeScript · License: MIT · Categories: AI

- Repository: https://github.com/anomalyco/opencode
- Website: https://opencode.ai
- Page: https://www.trmn.sh/tools/opencode

## Install

- Homebrew: `brew install anomalyco/tap/opencode`
- npm: `npm i -g opencode-ai@latest`
- Install script: `curl -fsSL https://opencode.ai/install | bash`

## Overview

OpenCode is an open source AI coding agent that runs in the terminal through a TUI. It is also distributed as a beta desktop application for macOS (Apple Silicon and Intel), Windows, and Linux (.deb, .rpm, .AppImage). It is published on npm as `opencode-ai`.

It ships with two built-in agents that you switch between using the `Tab` key. The `build` agent is the default and has full access for development work. The `plan` agent is read-only: it denies file edits by default and asks permission before running bash commands, which suits exploring an unfamiliar codebase or planning changes. A `general` subagent handles complex searches and multistep tasks. It is used internally and can be invoked with `@general` in messages.

Installation is available through a curl install script, npm/bun/pnpm/yarn, Homebrew, Scoop, Chocolatey, pacman and AUR on Arch Linux, mise, and Nix. The install script picks its target directory from `$OPENCODE_INSTALL_DIR`, then `$XDG_BIN_DIR`, then `$HOME/bin`, then `$HOME/.opencode/bin`. It is aimed at developers who want an agent-driven coding workflow in the terminal or desktop. Configuration and agent details are covered in the project's online docs.

### Installation

```bash
# via Homebrew
brew install anomalyco/tap/opencode
```

```bash
# via npm
npm i -g opencode-ai@latest
```

```bash
# via Install script
curl -fsSL https://opencode.ai/install | bash
```

![OpenCode Terminal UI](https://media.trmn.sh/cached/806c7201c2eb0c566b3ab206c1c52727e03009af360a457b36d10dbf585723b6.png)

## Alternatives

- [Claude Code](https://www.trmn.sh/tools/claude-code.md): AI-powered coding assistant that runs in the terminal and understands your codebase to execute tasks through natural language commands. (TypeScript, 153.7k stars)
- [gemini-cli](https://www.trmn.sh/tools/gemini-cli.md): Terminal AI agent providing direct command line access to Google Gemini models with file operations, web search, and tool integration. (TypeScript, 108.6k stars)
- [OmO](https://www.trmn.sh/tools/oh-my-openagent.md): Terminal coding agent run through the omo command. It runs on senpi, a fork of pi, and can split a job into parallel agents across multiple models. (TypeScript, 70.4k stars)
- [oh-my-pi](https://www.trmn.sh/tools/oh-my-pi.md): Terminal coding agent (fork of Pi) with LSP and DAP debugger integration, subagents, Python/Bun execution, and in-process native tools. Supports 60+ providers. (TypeScript, 37.0k stars)
- [Continue](https://www.trmn.sh/tools/continue.md): Open-source coding agent distributed as a CLI, VS Code extension, and JetBrains plugin. Repository is read-only after the final 2.0.0 release. (TypeScript, 36.4k stars)

## Guides

- [Claude Code Alternatives](https://www.trmn.sh/alternatives/claude-code): Claude Code alternatives: OpenCode, Codex CLI, Gemini CLI, Aider and Goose compared by providers, agents, git handling and free tiers.
- [codex Alternatives](https://www.trmn.sh/alternatives/codex): Codex alternatives: OpenCode, Claude Code, Gemini CLI, Aider and Goose compared by model support, interface and workflow.
- [gemini-cli Alternatives](https://www.trmn.sh/alternatives/gemini-cli): Alternatives to gemini-cli: opencode, claude-code, codex, goose, and aider compared by provider support, agents, and workflow.
- [Goose Alternatives](https://www.trmn.sh/alternatives/goose): Goose alternatives compared: OpenCode, Claude Code, Aider, Codex and Gemini CLI, with how each differs on scope, providers and workflow.
- [Open Interpreter Alternatives](https://www.trmn.sh/alternatives/open-interpreter): Open Interpreter alternatives: Goose, opencode, Claude Code, Codex and Gemini CLI compared on interfaces, providers and approval controls.
- [opencode Alternatives](https://www.trmn.sh/alternatives/opencode): opencode alternatives: Claude Code, codex, Gemini CLI, Aider and Goose compared by interface, model support and git workflow.
- [Best AI Coding Agents for the Terminal](https://www.trmn.sh/best/ai-coding-agents): Compare terminal AI coding agents: opencode, Claude Code, codex, Gemini CLI, aider, Goose and Open Interpreter by workflow and model support.
- [opencode vs Claude Code](https://www.trmn.sh/compare/opencode-vs-claude-code): opencode vs Claude Code: terminal AI coding agents compared on interface, agents, plugins, install options and licensing.

---

Canonical: https://www.trmn.sh/tools/opencode
