From ec0aff272824be79217f11407e7f87626073c9c6 Mon Sep 17 00:00:00 2001 From: imbytecat Date: Fri, 20 Mar 2026 10:21:13 +0800 Subject: [PATCH 1/7] =?UTF-8?q?docs:=20=E9=87=8D=E5=86=99=20README=20?= =?UTF-8?q?=E4=BD=BF=E5=85=B6=E5=8C=B9=E9=85=8D=E5=AE=9E=E9=99=85=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..b9e8980 --- /dev/null +++ b/README.md @@ -0,0 +1,72 @@ +# opencode-config + +我的 [OpenCode](https://opencode.ai) 配置,对应 `~/.config/opencode` 目录。 + +## 特性 + +- 通过 [LiteLLM](https://docs.litellm.ai/) 代理统一接入多家模型 +- 使用 [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode) 插件,支持多 Agent 模型分配 +- 默认主模型 `anthropic/claude-opus-4-6`,小模型 `anthropic/claude-haiku-4-5` +- 配置了 Anthropic / OpenAI / Google / LiteLLM 四个 Provider + +## 快速开始 + +### 安装 OpenCode + +```bash +curl -fsSL https://opencode.ai/install | bash +``` + +### 克隆配置 + +```bash +# 如果已有该目录,请先备份 +git clone ~/.config/opencode +``` + +### 配置环境变量 + +参考 `.env.example`,设置以下环境变量: + +```bash +export LITELLM_BASE_URL="https://your-litellm-endpoint" +export LITELLM_API_KEY="your-api-key" +``` + +> 可选:如果使用了 Exa 或 Context7 的 MCP 工具,还需设置 `EXA_API_KEY` 和 `CONTEXT7_API_KEY`。 + +### 启动 + +```bash +opencode +``` + +## 文件说明 + +| 文件 | 说明 | +|------|------| +| `opencode.jsonc` | 主配置:Provider、模型定义、插件 | +| `oh-my-opencode.jsonc` | oh-my-opencode 插件配置:Agent 模型分配、任务分类 | +| `tui.jsonc` | TUI 主题配置 | +| `AGENTS.md` | 运行时行为指令(如默认使用简体中文回复) | +| `.env.example` | 环境变量模板 | + +## 模型配置概览 + +| Provider | 模型 | 用途 | +|----------|------|------| +| Anthropic | Claude Opus 4.6 | 主模型 / Sisyphus / Prometheus / Metis | +| Anthropic | Claude Sonnet 4.6 | Atlas / Sisyphus-Junior | +| Anthropic | Claude Haiku 4.5 | 小模型(快速任务) | +| OpenAI | GPT-5.4 | Oracle / Multimodal / Momus | +| OpenAI | GPT-5.3-Codex | Hephaestus / Deep 任务 | +| OpenAI | GPT-5.4 mini | Quick 任务 | +| Google | Gemini 3.1 Pro | Visual Engineering / Artistry | +| Google | Gemini 3 Flash | Writing 任务 | +| LiteLLM | Grok Code Fast 1 | Explore | +| LiteLLM | MiniMax M2.5 | Librarian | +| LiteLLM | Kimi K2.5 / GLM-5 | 备用 | + +## License + +个人配置,仅供参考。 From 14402916552d0afc15f529bead2db73acf887dd8 Mon Sep 17 00:00:00 2001 From: imbytecat Date: Fri, 20 Mar 2026 10:26:50 +0800 Subject: [PATCH 2/7] =?UTF-8?q?docs:=20=E7=B2=BE=E7=AE=80=20README=20?= =?UTF-8?q?=E8=87=B3=E6=9C=80=E5=B0=8F=E5=8F=AF=E7=94=A8=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 80 +++++++++++++------------------------------------------ 1 file changed, 18 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index b9e8980..cb5fdc0 100644 --- a/README.md +++ b/README.md @@ -1,72 +1,28 @@ # opencode-config -我的 [OpenCode](https://opencode.ai) 配置,对应 `~/.config/opencode` 目录。 +我的 [OpenCode](https://opencode.ai) 配置。 -## 特性 +## 使用 -- 通过 [LiteLLM](https://docs.litellm.ai/) 代理统一接入多家模型 -- 使用 [oh-my-opencode](https://github.com/code-yeongyu/oh-my-opencode) 插件,支持多 Agent 模型分配 -- 默认主模型 `anthropic/claude-opus-4-6`,小模型 `anthropic/claude-haiku-4-5` -- 配置了 Anthropic / OpenAI / Google / LiteLLM 四个 Provider +1. 安装 OpenCode -## 快速开始 + ```bash + npm i -g opencode-ai + # 或 + bun add -g opencode-ai + ``` -### 安装 OpenCode +2. 克隆配置到 `~/.config/opencode` -```bash -curl -fsSL https://opencode.ai/install | bash -``` + ```bash + git clone ~/.config/opencode + ``` -### 克隆配置 +3. 参考 `.env.example` 配置环境变量 -```bash -# 如果已有该目录,请先备份 -git clone ~/.config/opencode -``` + ```bash + export LITELLM_BASE_URL="https://your-litellm-endpoint" + export LITELLM_API_KEY="your-api-key" + ``` -### 配置环境变量 - -参考 `.env.example`,设置以下环境变量: - -```bash -export LITELLM_BASE_URL="https://your-litellm-endpoint" -export LITELLM_API_KEY="your-api-key" -``` - -> 可选:如果使用了 Exa 或 Context7 的 MCP 工具,还需设置 `EXA_API_KEY` 和 `CONTEXT7_API_KEY`。 - -### 启动 - -```bash -opencode -``` - -## 文件说明 - -| 文件 | 说明 | -|------|------| -| `opencode.jsonc` | 主配置:Provider、模型定义、插件 | -| `oh-my-opencode.jsonc` | oh-my-opencode 插件配置:Agent 模型分配、任务分类 | -| `tui.jsonc` | TUI 主题配置 | -| `AGENTS.md` | 运行时行为指令(如默认使用简体中文回复) | -| `.env.example` | 环境变量模板 | - -## 模型配置概览 - -| Provider | 模型 | 用途 | -|----------|------|------| -| Anthropic | Claude Opus 4.6 | 主模型 / Sisyphus / Prometheus / Metis | -| Anthropic | Claude Sonnet 4.6 | Atlas / Sisyphus-Junior | -| Anthropic | Claude Haiku 4.5 | 小模型(快速任务) | -| OpenAI | GPT-5.4 | Oracle / Multimodal / Momus | -| OpenAI | GPT-5.3-Codex | Hephaestus / Deep 任务 | -| OpenAI | GPT-5.4 mini | Quick 任务 | -| Google | Gemini 3.1 Pro | Visual Engineering / Artistry | -| Google | Gemini 3 Flash | Writing 任务 | -| LiteLLM | Grok Code Fast 1 | Explore | -| LiteLLM | MiniMax M2.5 | Librarian | -| LiteLLM | Kimi K2.5 / GLM-5 | 备用 | - -## License - -个人配置,仅供参考。 +4. 运行 `opencode` From 645011729662b62724d3ab4e4f5fc6997ee6c8cb Mon Sep 17 00:00:00 2001 From: imbytecat Date: Fri, 20 Mar 2026 10:27:20 +0800 Subject: [PATCH 3/7] =?UTF-8?q?docs:=20=E6=94=B9=E8=BF=9B=20README=20?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cb5fdc0..06c96f9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # opencode-config -我的 [OpenCode](https://opencode.ai) 配置。 +个人 [OpenCode](https://opencode.ai) 配置文件,通过 LiteLLM 代理接入多家模型。 ## 使用 From f3a95623017162e3a20be2ad34b96126f15eee3f Mon Sep 17 00:00:00 2001 From: imbytecat Date: Fri, 20 Mar 2026 10:28:13 +0800 Subject: [PATCH 4/7] =?UTF-8?q?docs:=20=E7=A7=BB=E9=99=A4=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0=E4=B8=AD=E7=9A=84=E5=85=B7=E4=BD=93=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 06c96f9..86b86e4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # opencode-config -个人 [OpenCode](https://opencode.ai) 配置文件,通过 LiteLLM 代理接入多家模型。 +个人 [OpenCode](https://opencode.ai) 配置文件。 ## 使用 From cc388353001b306e1a7c0971a264eeb468ea9c54 Mon Sep 17 00:00:00 2001 From: imbytecat Date: Fri, 20 Mar 2026 10:31:22 +0800 Subject: [PATCH 5/7] =?UTF-8?q?docs:=20=E5=B1=95=E5=BC=80=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=8F=98=E9=87=8F=E9=85=8D=E7=BD=AE=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 86b86e4..b5118fe 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,18 @@ git clone ~/.config/opencode ``` -3. 参考 `.env.example` 配置环境变量 +3. 复制 `.env.example` 为 `.env` 并填写环境变量 ```bash - export LITELLM_BASE_URL="https://your-litellm-endpoint" - export LITELLM_API_KEY="your-api-key" + cp .env.example .env ``` + | 变量 | 必填 | 说明 | + |------|------|------| + | `LITELLM_BASE_URL` | 是 | 模型服务端点 | + | `LITELLM_API_KEY` | 是 | 模型服务密钥 | + | `EXA_API_KEY` | 否 | [Exa](https://exa.ai) 搜索,提供联网能力 | + | `CONTEXT7_API_KEY` | 否 | [Context7](https://context7.com) 文档查询,提供库文档检索 | + | `OPENCODE_GIT_BASH_PATH` | 否 | Windows 用户需指定 Git Bash 路径,否则工具调用可能异常 | + 4. 运行 `opencode` From b5717759ba2c82f083d15d6526f5433377422981 Mon Sep 17 00:00:00 2001 From: imbytecat Date: Fri, 20 Mar 2026 10:34:38 +0800 Subject: [PATCH 6/7] =?UTF-8?q?docs:=20=E4=BF=AE=E6=AD=A3=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=8F=98=E9=87=8F=E9=85=8D=E7=BD=AE=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E4=B8=BA=E7=B3=BB=E7=BB=9F=E7=BA=A7=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index b5118fe..9ff5532 100644 --- a/README.md +++ b/README.md @@ -18,11 +18,7 @@ git clone ~/.config/opencode ``` -3. 复制 `.env.example` 为 `.env` 并填写环境变量 - - ```bash - cp .env.example .env - ``` +3. 参考 `.env.example` 将以下环境变量配置到系统中 | 变量 | 必填 | 说明 | |------|------|------| From 1ab05fac8770c3f98463fc8bfbd32a99233e7162 Mon Sep 17 00:00:00 2001 From: imbytecat Date: Fri, 20 Mar 2026 13:11:35 +0800 Subject: [PATCH 7/7] =?UTF-8?q?docs:=20=E8=A1=A5=E5=85=85=20MCP=20key=20?= =?UTF-8?q?=E5=8F=AF=E9=80=89=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9ff5532..5b7e15c 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ |------|------|------| | `LITELLM_BASE_URL` | 是 | 模型服务端点 | | `LITELLM_API_KEY` | 是 | 模型服务密钥 | - | `EXA_API_KEY` | 否 | [Exa](https://exa.ai) 搜索,提供联网能力 | - | `CONTEXT7_API_KEY` | 否 | [Context7](https://context7.com) 文档查询,提供库文档检索 | + | `EXA_API_KEY` | 否 | [Exa](https://exa.ai) 搜索,提供联网能力,不配则使用默认额度 | + | `CONTEXT7_API_KEY` | 否 | [Context7](https://context7.com) 文档查询,提供库文档检索,不配则使用默认额度 | | `OPENCODE_GIT_BASH_PATH` | 否 | Windows 用户需指定 Git Bash 路径,否则工具调用可能异常 | 4. 运行 `opencode`