Skip to content

Installation & Setup

OpenCode is a Go-based CLI. Install it with a shell script, npm, Homebrew, Chocolatey, Scoop, or Docker. This lesson covers all installation methods and provider configuration.

Gnome mascot

What you'll learn

  • Install: curl -fsSL https://opencode.ai/install | bash or npm install -g opencode-ai
  • 75+ model providers configurable via /connect in the TUI
  • /init creates an AGENTS.md file for project context

Build it

Choose an installation method that best fits your environment. Once installed, configure your preferred model provider by launching the TUI and running the connect command.

bash
# Shell installer (recommended)
curl -fsSL https://opencode.ai/install | bash

# Or npm
npm install -g opencode-ai

# Or Homebrew
brew install anomalyco/tap/opencode

# Or Docker
docker run -it --rm ghcr.io/anomalyco/opencode

# Configure a provider
opencode
/connect
# Select a provider and enter your API key

What goes wrong

MistakeHow you notice itThe fix
Terminal not supportedDisplay issues, missing featuresUse WezTerm, Alacritty, Ghostty, or Kitty
Provider not configuredNo model availableRun /connect in the TUI

Next: The TUI & Keybinds