Oh My OpenCode

oh-my-opencode 是一个强大的 OpenCode 扩展集合,受 oh-my-zsh 启发。它提供了后台代理、预构建的工具(LSP/AST/MCP)、精选的代理配置,并且兼容 Claude Code。 最强大的是提供开箱即可用的 Sysphus Agents 赛博军团。

# 如何安装#

你可以直接请求 OpenCode 帮你安装:

  1. 打开 OpenCode。
  2. 在对话框中输入:

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

  3. OpenCode 将会自动检测并执行安装脚本。

或者,你也可以手动运行安装命令:

bash
bunx oh-my-opencode install

## 离线安装#

如果你处于无法连接互联网的环境,或者希望从源码构建,可以采用离线安装方式。

1. 构建插件

首先在有网络的环境下获取源码并构建:

bash
1# 克隆仓库
2git clone https://github.com/code-yeongyu/oh-my-opencode.git
3cd oh-my-opencode
4
5# 安装依赖并构建 (需要 Bun)
6bun install
7bun run build

构建完成后,你会得到 dist/index.js 文件。

2. 配置 OpenCode

在目标机器上,编辑 OpenCode 的配置文件(通常位于 ~/.config/opencode/opencode.json)。

添加或修改 plugin 字段,指向构建好的 index.js 文件的绝对路径:

json
1{
2  "plugin": [
3    "file:///Users/你的用户名/path/to/oh-my-opencode/dist/index.js"
4  ]
5}

注意:路径必须以 file:// 开头。

Windows 用户注意: Windows 路径中的反斜杠 \ 需替换为正斜杠 /。 例如,如果文件在 E:\project\oh-my-opencode\dist\index.js,则配置如下:

json
1{
2  "plugin": [
3    "file:///E:/project/oh-my-opencode/dist/index.js"
4  ]
5}

更多信息请访问 GitHub 仓库↗。