Appearance
OpenCode 配置
OpenCode 可以使用 OpenAI 兼容环境变量接入 TimeSniper。
安装
请使用 OpenCode 官方推荐的安装方式。安装完成后确认:
bash
opencode --version配置
macOS / Linux:
bash
export OPENAI_API_KEY="sk-你的Key"
export OPENAI_BASE_URL="https://timesniper.club/v1"
opencodeWindows PowerShell:
powershell
$env:OPENAI_API_KEY="sk-你的Key"
$env:OPENAI_BASE_URL="https://timesniper.club/v1"
opencode建议
如果 OpenCode 支持本地配置文件,优先把 Key 放入工具自己的密钥管理或系统环境变量,不要把真实 Key 提交到项目仓库。