OpenCode Introduction
Get started with OpenCode.
OpenCode is an open source AI coding agent. It’s available as a terminal-based interface, desktop app, or IDE extension.
Let’s get started.
Prerequisites
To use OpenCode in your terminal, you’ll need:
A modern terminal emulator like:
API keys for the LLM providers you want to use.
Install
The easiest way to install OpenCode is through the install script.
Terminal window
curl -fsSL https://opencode.ai/install | bash
You can also install it with the following commands:
Using Node.js
Terminal window
npm install -g opencode-aiTerminal window
bun install -g opencode-aiTerminal window
pnpm install -g opencode-aiTerminal window
yarn global add opencode-aiUsing Homebrew on macOS and Linux
Terminal window
brew install anomalyco/tap/opencodeWe recommend using the OpenCode tap for the most up to date releases. The official
brew install opencodeformula is maintained by the Homebrew team and is updated less frequently.Installing on Arch Linux
Terminal window
sudo pacman -S opencode # Arch Linux (Stable)paru -S opencode-bin # Arch Linux (Latest from AUR)
Windows
Recommended: Use WSL
For the best experience on Windows, we recommend using Windows Subsystem for Linux (WSL). It provides better performance and full compatibility with OpenCode’s features.
Using Chocolatey
Terminal window
choco install opencodeUsing Scoop
Terminal window
scoop install opencodeUsing NPM
Terminal window
npm install -g opencode-aiUsing Mise
Terminal window
mise use -g github:anomalyco/opencodeUsing Docker
Terminal window
docker run -it --rm ghcr.io/anomalyco/opencode
Support for installing OpenCode on Windows using Bun is currently in progress.
Windows CLI (winget): winget install --id SST.opencode --accept-source-agreements --accept-package-agreements
You can also grab the binary from the Releases.