使用opencode

5月 26, 2026 · 1 分钟阅读时长 · 178 字 · -阅读 -评论

有些AI服务本身没有自己的CLI工具,为方便使用可以使用统一的CLI终端,比如就是OpenCode。

配置sample

配置位置参考~/.config/opencode/opencode.json

{
  "$schema": "https://opencode.ai/config.json",
  "model": "Kimi-K2.5",
  "provider": {
    "haihub": {
      "api": "openai",
      "options": {
        "baseURL": "https://xxxx.cccc/v1",
        "apiKey": "sk-"
      },
      "models": {
        "Kimi-K2.5": {
          "id": "Kimi-K2.5"
        },
        "gemma-4-31B-it": {
          "id": "gemma-4-31B-it"
        }
      }
    }
  }

api key配置

路径:.local/share/opencode/auth.json

{

  "minimax-cn-coding-plan": {
    "type": "api",
    "key": ""
  },

}
Alan H
Authors
开发者,数码产品爱好者,喜欢折腾,喜欢分享,喜欢开源