Skip to content

oh-my-opencode

必装生态:oh-my-opencode

这一步的目标:让 opencode 具备"可用、好用、可扩展"的基础体验。

一句话总结:oh-my-opencode 是经过 $24,000 token 验证的生产级配置,装上就能用。

为什么需要 oh-my-opencode?

裸装的 opencode 虽然强大,但需要大量配置才能发挥威力。oh-my-opencode 提供:

  1. 预置 Agent 团队:Sisyphus(主编排)、Oracle(架构师)、Librarian(文档专家)等,各司其职
  2. 订阅直接用:Claude Pro/Max、ChatGPT Plus/Pro、Gemini 订阅无需 API Key
  3. LSP 重构工具:不只分析,还能重命名、跳转、代码操作
  4. 后台并行 Agent:多个 Agent 同时干活,不用干等
  5. Claude Code 兼容:现有的.claude/配置直接迁移
  6. 精选 MCP:Context7(官方文档)、grep.app(GitHub 代码搜索)内置

安装方式

让 Agent 自动装(推荐)

进入 opencode 后,直接输入并回车

bash
Install and configure by following the instructions here https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/refs/heads/master/README.md

命令行安装

bash
# 全套订阅 + max20
bunx oh-my-opencode install --no-tui --claude=max20 --chatgpt=yes --gemini=yes

# 只有 Claude(没 max20)
bunx oh-my-opencode install --no-tui --claude=yes --chatgpt=no --gemini=no

# 什么订阅都没有(用免费 Provider)
bunx oh-my-opencode install --no-tui --claude=no --chatgpt=no --gemini=no

验证安装成功

bash
# 检查版本(需要 1.0.150+)
opencode --version

# 检查插件是否加载
cat ~/.config/opencode/opencode.json | grep -A5 '"plugin"'

使用百度千帆模型

配置模型

apiKey申请:大模型编程工具使用说明

json
{
  "$schema": "https://opencode.ai/config.json",
  "plugin": [
    "oh-my-opencode@latest"
  ],
  "provider": {
    "qianfan": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "百度千帆",
      "options": {
        "baseURL": "https://qianfan.baidubce.com/v2",
        "apiKey": "bce-v3/ALTAK-7lyWjwLOsm5oC......"
      },
      "models": {
        "deepseek-v3.2": {
          "name": "deepseek-v3.2"
        },
        "deepseek-v3.1-250821": {
          "name": "deepseek-v3.1-250821"
        },
        "qwen3-coder-480b-a35b-instruct": {
          "name": "qwen3-coder-480b-a35b-instruct"
        },
        "qwen3-coder-30b-a3b-instruct": {
          "name": "qwen3-coder-30b-a3b-instruct"
        },
        "glm-4.7": {
          "name": "glm-4.7"
        },
        "kimi-k2-instruct": {
          "name": "kimi-k2-instruct"
        },
        "qianfan-check-vl": {
          "name": "qianfan-check-vl"
        }
      }
    }
  },
  "model": "qianfan/deepseek-v3.2"
}

配置oh-my-opencode

json
{
  "$schema": "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/master/assets/oh-my-opencode.schema.json",
  "agents": {
    "sisyphus": {
      "model": "opencode/ernie-5.0-thinking-preview",
      "variant": "max",
      "description": "项目总指挥,负责整体规划与项目管理"
    },
    "hephaestus": {
      "model": "opencode/ernie-4.5-turbo-128k",
      "variant": "medium",
      "description": "代码构建专家,负责代码生成和工程实现"
    },
    "oracle": {
      "model": "opencode/deepseek-r1",
      "variant": "high",
      "description": "洞察分析专家,提供深度见解与预测"
    },
    "librarian": {
      "model": "opencode/ernie-4.5-turbo-128k",
      "description": "知识管理专家,负责信息检索与知识整合"
    },
    "explore": {
      "model": "opencode/ernie-x1.1",
      "description": "探索研究员,负责深入调查与研究"
    },
    "multimodal-looker": {
      "model": "opencode/ernie-4.5-turbo-vl",
      "description": "多模态分析专家,处理图像与视觉内容"
    },
    "prometheus": {
      "model": "opencode/ernie-4.5-turbo-128k",
      "variant": "max",
      "description": "质量审查员,负责代码审查与质量保证"
    },
    "metis": {
      "model": "opencode/ernie-5.0-thinking-preview",
      "variant": "max",
      "description": "战略规划师,负责架构设计与战略决策"
    },
    "momus": {
      "model": "opencode/ernie-x1.1",
      "variant": "medium",
      "description": "创意生成专家,负责创新思维与幽默内容"
    },
    "atlas": {
      "model": "opencode/ernie-speed-pro-128k",
      "description": "信息整理专家,负责数据组织与地图构建"
    }
  },
  "categories": {
    "visual-engineering": {
      "model": "opencode/ernie-4.5-turbo-vl",
      "description": "视觉工程任务类别"
    },
    "ultrabrain": {
      "model": "opencode/ernie-5.0-thinking-preview",
      "variant": "xhigh",
      "description": "超高复杂度思考任务"
    },
    "deep": {
      "model": "opencode/deepseek-r1",
      "variant": "medium",
      "description": "深度思考任务类别"
    },
    "artistry": {
      "model": "opencode/ernie-x1.1",
      "variant": "high",
      "description": "艺术创作类别"
    },
    "quick": {
      "model": "opencode/ernie-speed-pro-128k",
      "description": "需要快速响应的任务"
    },
    "unspecified-low": {
      "model": "opencode/ernie-lite-pro-128k",
      "description": "低复杂度未指定任务"
    },
    "unspecified-high": {
      "model": "opencode/ernie-4.5-turbo-128k",
      "description": "高复杂度未指定任务"
    },
    "writing": {
      "model": "opencode/ernie-x1.1",
      "description": "写作与内容生成类别"
    }
  },
  "comment_checker": {
    "custom_prompt": "请检查代码注释是否清晰、准确,并提供改进建议。注释应该遵循最佳实践,解释代码的意图而不仅仅是描述代码做了什么。"
  },
  "claude_code": {
    "mcp": true,
    "commands": true,
    "skills": true,
    "agents": true,
    "hooks": true,
    "plugins": true
  },
  "auto_update": true
}