OpenCode Guide
OpenCode is an open-source AI coding assistant framework. It supports integration with multiple AI models, including code generation, modification, and review workflows.
Installation
Choose an installation method based on your workflow.
macOS / Linux
bash
curl -fsSL https://opencode.ai/install | bashWindows PowerShell
Using WSL is recommended. Install it with the macOS / Linux method above inside WSL.
Connect to GoRouter
After installation, choose one of the following methods to connect OpenCode to GoRouter.
Using CC-Switch is recommended for centralized configuration.
Steps:
- Follow Create API Key to generate an API key.
- Follow CC-Switch to configure a unified provider.
- Restart
OpenCodeafter configuration is complete.