通过脚本安装(推荐):
```bash
Linux / macOS
curl -fsSL https://opencode.ai/install | bash
Windows (PowerShell)
iwr https://opencode.ai/install.ps1 -useb | iex
```
通过 npm 安装:
```bash
npm install -g @opencode-ai/cli
```
通过源码安装:
```bash
git clone https://github.com/opencode-ai/opencode.git
cd opencode
npm install
npm run build
npm link
```