Skip to main content
OpenCode CLI requires Node.js and npm. After installation, run opencode at least once to confirm OpenCode starts correctly.

1. Check Node.js

node --version
npm --version
If version numbers appear, Node.js and npm are installed. If Node.js is not installed, refer to the Node.js installation guide, then run the checks again.

2. Install OpenCode CLI

npm install -g opencode-ai@latest
Check the installed version:
opencode --version

3. Initialize OpenCode

opencode
If the OpenCode chat UI, model information, or command hints appear, the installation succeeded. OpenCode started successfully