OpenCode
Recommended: use cc-switch for setup: https://github.com/farion1231/cc-switch/releases
Prerequisites
OpenCode provides an official installer script plus npm, bun, and brew install options.
- If you use the official installer script, you usually do not need to prepare
npmmanually first - If you use the
npminstall path, installNode.jsandnpmfirst - If you use the
buninstall path, installbunfirst
For the npm path, install Node.js from: https://nodejs.org/en/download
- macOS / Windows: install the
LTSrelease from that page - Linux: use the distro-specific method listed there
On macOS, if you already use Homebrew, you can also run:
brew install nodeThis installs both Node.js and npm.
Then verify:
node -v
npm -vFor Windows CLI workflows, the official docs currently recommend WSL.
Install
Official install page: https://opencode.ai/
Recommended install command from the official site:
curl -fsSL https://opencode.ai/install | bashThe official site also provides npm, bun, and brew install options.
Configure
If you do not use cc-switch, configure a custom provider with the Responses API:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"codex_proxy": {
"npm": "@ai-sdk/openai",
"name": "Codex Proxy",
"options": {
"baseURL": "https://okapi.pockgo.com/v1",
"apiKey": "{env:OPENAI_API_KEY}"
},
"models": {
"gpt-5-codex-mini": {
"name": "gpt-5-codex-mini"
}
}
}
},
"model": "codex_proxy/gpt-5-codex-mini"
}You can also use opencode auth login or /connect instead of inventing a project-specific environment variable.
