Opencode Installation Guide

Installing Opencode

Step-by-step instructions for installing the Opencode AI coding assistant on Mac and Windows.

Opencode is an AI coding assistant you run from the terminal. It lets you interact with AI models to write, edit, and understand code from the command line.

Estimated time: 5 minutes


Mac

If you don’t have Homebrew installed, see the Setting Up a Package Manager guide first.

Step 1: Install Opencode

Open Terminal and run:

brew install anomalyco/tap/opencode

Homebrew will download and install Opencode automatically.

Step 2: Verify the installation

Type the following and press Enter:

opencode --version

You should see a version number printed — this confirms Opencode is installed correctly.


Windows

If you don’t have npm installed, see the Installing Node.js and npm guide first.

Step 1: Install Opencode

Open Command Prompt and run:

npm i -g opencode-ai

npm will download and install Opencode globally on your system.

Step 2: Verify the installation

Type the following and press Enter:

opencode --version

You should see a version number printed — this confirms Opencode is installed correctly.