OpenCode
Manual install
Section titled “Manual install”If your machine does not have the opencode command yet, install OpenCode first. If OpenCode is already installed, go straight to manual setup.
Choose one installation method:
choco install opencodescoop install opencodeFor npm, install Node.js from nodejs.org first, then run:
npm install -g opencode-ai@latestopencode --versionYou can use the official install script:
curl -fsSL https://opencode.ai/install | bashIf you use Homebrew, you can also run:
brew install anomalyco/tap/opencodeopencode --versionYou can use the official install script:
curl -fsSL https://opencode.ai/install | bashFor npm, install Node.js from nodejs.org using the method for your distribution, then run:
npm install -g opencode-ai@latestopencode --versionManual setup
Section titled “Manual setup”If you are not using CC Switch, write the user-level OpenCode config manually. Use the OpenAI-compatible Base URL with /v1, and use a token from the OpenCode group.
-
Create and enter the configuration directory.
mkdir "%USERPROFILE%\.config\opencode" cd /d "%USERPROFILE%\.config\opencode"mkdir -p ~/.config/opencode cd ~/.config/opencodemkdir -p ~/.config/opencode cd ~/.config/opencode -
Create or update
opencode.json.Replace
<model-id>with an available model name from the model marketplace, and replacesk-your-tokenwith your OpenCode-group token.{ "$schema": "https://opencode.ai/config.json", "model": "qiuqiu/<model-id>", "provider": { "qiuqiu": { "npm": "@ai-sdk/openai-compatible", "name": "Qiuqiu Token", "options": { "baseURL": "https://api.qiuqiutoken.net/v1", "apiKey": "sk-your-token" }, "models": { "<model-id>": { "name": "<model-id>" } } } } } -
Close all OpenCode terminal windows, open a new terminal, then start OpenCode from your project.
After it opens, type
/modelsand selectqiuqiu/<model-id>.cd your-project-folder opencodecd your-project-folder opencodecd your-project-folder opencode
