AI--opencode
管理员权限运行cmd
确保已经安装了 node.js npm
npm -v
node -v
切换淘宝镜像源 npm config set registry https://registry.npmmirror.com
安装 npm install -g opencode-ai
新开窗口 opencode --version
1.18.18
安装成功,用cc.switch来配置conf
供应商标识 hj-jens 供应商名称 jens 备注 jens 官网链接 无 接口格式 Anthropic API Key ah-c256a91dfffdccxxxxxxx46b1c1a77d8a8f1c2d579exx Base Url http://10.125.5.34/ai-model/anthropic/v1 额外选项 键名: setCacheKey 值: true 获取模型列表,配置上四个模型或者其中一个即可 模型ID 显示名称 Qwen3.6-27B Qwen3.6-27B Qwen3.6-35B-A3B Qwen3.6-35B-A3B qwen-instruct-flash qwen-instruct-flash qwen-thinking qwen-thinking 配置json { "npm": "@ai-sdk/anthropic", "options": { "baseURL": "http://10.125.5.34/ai-model/anthropic/v1", "apiKey": "ah-c256a91dfffdccxxxxxxx46b1c1a77d8a8f1c2d579exx", "setCacheKey": true }, "models": { "Qwen3.6-27B": { "name": "Qwen3.6-27B" }, "Qwen3.6-35B-A3B": { "name": "Qwen3.6-35B-A3B" }, "qwen-instruct-flash": { "name": "qwen-instruct-flash" }, "qwen-thinking": { "name": "qwen-thinking" } } }
集成到IDEA--JetBrains AI Assistant
在 C:\Users\hj\.jetbrains目录下生产 acp.json文件, idea重启会自动加载
{ "default_mcp_settings": {}, "agent_servers": { "OpenCode": { "command": "C:\\Users\\hj\\AppData\\Roaming\\npm\\opencode.cmd", "args": [ "acp" ], "env": {} } } }

浙公网安备 33010602011771号