Home / Resources / OpenCode

Installation guide

Install OpenCode

Set up OpenCode 2, connect your model provider, and start a session from your project folder.

Last reviewed:

Before you begin

  • A terminal and a local project folder.
  • Credentials for your chosen model provider. Available models and usage depend on that provider.
  • Already using OpenCode 1? Back up your configuration and read the migration guide before switching. V1 and V2 share configuration locations.

Authentication and access are managed directly by each provider.

Install your CLI

This guide covers OpenCode 2. On macOS, choose the installer or Homebrew. On Linux, use the installer. On Windows, get the standalone CLI for your architecture from the official setup documentation; V2 does not support Windows package managers.

Continue in the official documentation

Choose one installation method. Copy the command for your system and run it in your own terminal.

macOS / Linux · OpenCode 2
curl -fsSL https://opencode.ai/v2/install | bash
macOS · Homebrew · OpenCode 2
brew install anomalyco/tap/opencode-v2

Check the installation

Check that the displayed version starts with 2. If it shows 1, another OpenCode installation may be taking precedence in your PATH.

Terminal
opencode --version

Sign in and start

Open a terminal in a project folder you want to work with, then start the CLI:

Terminal
opencode

Inside OpenCode, run /connect, choose your provider, and follow its authentication steps. Then run /models and select an available model. These are commands for the OpenCode interface, rather than your shell.

Inside OpenCode · /connect
/connect
Inside OpenCode · /models
/models

Try your first task

Begin by asking for an explanation of the project. Review the response before requesting edits.

Explain the structure of this project without modifying files.

If something goes wrong

The terminal cannot find opencode

Open a new terminal and check whether your installation directory is included in PATH.

No model is available

Repeat /connect and /models inside OpenCode. Check your provider credentials and model access.

A session will not start

Check the background service with the command below. See the official troubleshooting guide before changing service files or session data.

Existing plugins fail after switching versions

V1 plugin implementations require migration for V2. Consult the migration guide before enabling them.

Terminal
opencode service status

Keep it up to date

Keep using the same V2 installation channel. Review its current update instructions in the official setup documentation, then check opencode --version again.

Official sources

These are independent guides to the providers’ tools. ORQST integration availability follows the product roadmap.