OpenCode provides a variety of installation methods to suit different operating system environments and user habits:
Quick Installation (recommended)
Use the official one-click install script for most macOS and Linux users:curl -fsSL https://opencode.ai/install | bash
Package Manager Installation
- npm user:
npm i -g opencode-ai@latest - Homebrew users:
brew install sst/tap/opencode - Arch Linux users:
paru -S opencode-bin
Customized Installation
Specify the installation directory by setting an environment variable:OPENCODE_INSTALL_DIR=/usr/local/bin curl -fsSL https://opencode.ai/install | bash
Make sure to remove all older installations below version 0.1.x before installing to avoid conflicts.
This answer comes from the articleOpenCode: AI Programming Intelligence Running in a Terminal EnvironmentThe
































