Merge pull request #94 from KurobaKaitou/main

docs: add Chinese and English introductions for OpenCode
This commit is contained in:
Sanbu 散步
2026-05-19 09:53:04 +08:00
committed by GitHub
12 changed files with 227 additions and 33 deletions
+111 -16
View File
@@ -41,7 +41,7 @@ To compare more intuitively, we can look at the difference between Claude Code a
| Context length | ✅ Very long | ⚠️ Good | Claude Code |
| Debug assistance | ✅ Automated | ⚠️ More manual work | Claude Code |
Table source: https://northflank.com/blog/claude-code-vs-cursor-comparison
Table source: <https://northflank.com/blog/claude-code-vs-cursor-comparison>
In short, CLI AI coding tools usually can:
@@ -57,6 +57,7 @@ Although there are many open-source implementations now, in practice we only rec
- Codex uses GPT-5 and is stronger overall in capability.
- Claude Code, routed through GLM 4.6 compatible APIs, offers an experience close to Claude 4 at a lower cost.
- OpenCode lets you freely switch and combine models, includes free model options, and gives you better cost control.
However, which one works better in your real project can only be determined by hands-on testing. Mastering multiple AI coding tools is always beneficial. Once you are skilled, you can switch flexibly among Claude Code, Codex, or Trae in different scenarios. If one tool does not perform well after multiple tries, just switch to another tool or model and continue experimenting.
@@ -77,7 +78,7 @@ In actual use, you can ask it through chat to create new projects, perform CLI o
![](/zh-cn/stage-2/backend/modern-cli/images/image9.png)![](/zh-cn/stage-2/backend/modern-cli/images/image10.png)
If you want to systematically learn Claude Code, you can refer to the course jointly launched by Andrew Ng and Anthropic:
https://www.bilibili.com/video/BV176t2zSEpr
<https://www.bilibili.com/video/BV176t2zSEpr>
Next, we will learn how to use Claude Code. Because directly using the official Claude Code is often very expensive (as shown below), we will instead use API platforms that are compatible with Claude Code protocol but based on other large models.
@@ -122,8 +123,8 @@ Next, we need to change Claude Code's default API request endpoint so it support
First, you need to obtain your GLM API key and store it in whatever way is most convenient for you.
Domestic URL: https://bigmodel.cn/usercenter/proj-mgmt/apikeys
International URL: https://z.ai/manage-apikey/apikey-list
Domestic URL: <https://bigmodel.cn/usercenter/proj-mgmt/apikeys>
International URL: <https://z.ai/manage-apikey/apikey-list>
If you are using the **domestic GLM** service, use the following variable configuration:
@@ -192,11 +193,11 @@ Kimi K2 is a new-generation large language model released by Moonshot AI, with e
**Get API Key:**
Visit https://platform.moonshot.cn/console/account to register and obtain an API key.
Visit <https://platform.moonshot.cn/console/account> to register and obtain an API key.
**Configuration method:**
Reference docs: https://platform.moonshot.cn/docs/guide/agent-support
Reference docs: <https://platform.moonshot.cn/docs/guide/agent-support>
```bash
export ANTHROPIC_BASE_URL=https://api.moonshot.cn/anthropic
@@ -215,7 +216,7 @@ Minimax is a new-generation large language model released by MiniMax, with excel
**Get API Key:**
Visit https://platform.minimax.io/ to register and obtain an API key.
Visit <https://platform.minimax.io/> to register and obtain an API key.
**Configuration method:**
@@ -237,7 +238,7 @@ DeepSeek is an open-source large language model released by DeepSeek, popular am
**Get API Key:**
Visit https://platform.deepseek.com/usage to register and obtain an API key.
Visit <https://platform.deepseek.com/usage> to register and obtain an API key.
**Configuration method:**
@@ -262,7 +263,7 @@ Volcano Engine is ByteDance's cloud service platform, providing enterprise-level
**Get API Key:**
Visit https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey to register and obtain an API key.
Visit <https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey> to register and obtain an API key.
**Configuration method:**
@@ -282,7 +283,7 @@ export ANTHROPIC_MODEL="moonshotai/Kimi-K2-Instruct-0905" # You can change to
export ANTHROPIC_API_KEY="YOUR_SILICONCLOUD_API_KEY" # Replace with your API key
```
Aliyun DashScope (Aliyuncs): https://help.aliyun.com/zh/model-studio/get-api-key
Aliyun DashScope (Aliyuncs): <https://help.aliyun.com/zh/model-studio/get-api-key>
```python
export ANTHROPIC_BASE_URL="https://dashscope.aliyuncs.com/apps/anthropic"
@@ -355,8 +356,8 @@ Many people initially use Claude Code only as a normal chat tool. But in fact it
Reference docs:
https://docs.claude.com/en/docs/claude-code/cli-reference
https://docs.claude.com/en/docs/claude-code/slash-commands
<https://docs.claude.com/en/docs/claude-code/cli-reference>
<https://docs.claude.com/en/docs/claude-code/slash-commands>
| Command | Purpose | Example |
| ----------------- | ----------------------------------------- | ---------------------------------------- |
@@ -380,7 +381,7 @@ https://docs.claude.com/en/docs/claude-code/slash-commands
**CLAUDE.md**
Reference: https://www.anthropic.com/engineering/claude-code-best-practices
Reference: <https://www.anthropic.com/engineering/claude-code-best-practices>
`CLAUDE.md` is a special file that Claude automatically reads and includes in context at the beginning of a session. So it is very suitable for recording:
@@ -411,7 +412,7 @@ Reference: https://www.anthropic.com/engineering/claude-code-best-practices
#### Internal Principles of Claude Code
Reference: https://github.com/shareAI-lab/analysis_claude_code
Reference: <https://github.com/shareAI-lab/analysis_claude_code>
If you are curious why Claude Code performs better than Trae or Cursor agent tools in many scenarios, we can briefly look at its internal working mechanism.
@@ -458,8 +459,8 @@ Because official OpenAI API can have issues such as high cost and strict network
With this approach, we only need to buy corresponding Codex API quota on a third-party relay platform, and we can get an experience close to native OpenAI Codex.
Reference: https://open-dev.feishu.cn/wiki/PAqUwWG4IiuwTvkQ2sGcaQuPnXc
Recharge URL: https://api.zyai.online/account/topup/recharge
Reference: <https://open-dev.feishu.cn/wiki/PAqUwWG4IiuwTvkQ2sGcaQuPnXc>
Recharge URL: <https://api.zyai.online/account/topup/recharge>
One thing to note: after obtaining token quota, we still need to configure the API key locally.
@@ -516,6 +517,100 @@ I can use the command `codex --profile myrelay` to run it
After configuration, you can launch Codex with relayed API through `codex --profile myrelay`. Usage afterward is similar to Claude Code: just keep entering your ideas and requirements in chat at any time.
### OpenCode
![](/zh-cn/stage-2/backend/modern-cli/images/image32.png)
![](/zh-cn/stage-2/backend/modern-cli/images/image33.png)
OpenCode is an open-source AI coding agent platform for developers, positioned like a "multi-model version of Claude Code." It uses the terminal as the core interaction entry, while also supporting editor integrations (such as VS Code and Neovim). It can deeply connect with local repositories and complete an end-to-end workflow through natural language, from code understanding to engineering execution.
It is not bound to one single model. Instead, it is an open platform where you can switch freely among GPT, Claude, Gemini, and even local models. OpenAI itself also supports connecting Codex/OpenAI subscription access through OpenCode.
![](/zh-cn/stage-2/backend/modern-cli/images/image34.png)
You can install OpenCode with the following commands:
```bash
# Linux / Unix
curl -fsSL https://opencode.ai/install | bash
# Windows
npm i -g opencode-ai
```
#### Use Free Models in OpenCode
OpenCode periodically provides free models, and setup is very simple. In any folder where you want to use OpenCode, run `opencode` in terminal to open the chat panel. Then use `/models` and search for the keyword `free` to find models marked as free.
![](/zh-cn/stage-2/backend/modern-cli/images/image35.png)
In most cases, free models are slower than paid/subscription models for coding tasks. This usually depends on route congestion, peak usage hours, and the model's own capability.
#### Use Third-Party Models as OpenCode's Main Coding Model
This is OpenCode's core advantage: with the same MCP, Skills, and context, you can freely switch models for different coding tasks. Below we use OpenAI's official GPT-5.3 Codex as an example for connecting OpenCode as the main coding model.
In OpenCode chat, enter `/connect`, select the first relevant command, and press Enter to choose third-party provider authentication.
![](/zh-cn/stage-2/backend/modern-cli/images/image36.png)
Here we use OpenAI as an example and press Enter to choose an authentication method.
![](/zh-cn/stage-2/backend/modern-cli/images/image37.png)
Either option works; the only difference is the auth flow. Here we choose browser login.
![](/zh-cn/stage-2/backend/modern-cli/images/image38.png)
Copy the link to your browser and complete normal OpenAI login. After "Authorization Successful" appears in the browser, OpenCode will automatically move to the OpenAI model selection screen.
![](/zh-cn/stage-2/backend/modern-cli/images/image39.png)
![](/zh-cn/stage-2/backend/modern-cli/images/image40.png)
#### Install the Oh My OpenAgent Plugin
Another strength of OpenCode is its active community ecosystem. You can find many OpenCode-related plugins on GitHub. If OpenCode is a model-switchable AI collaboration tool, then Oh-My-OpenAgent is a "multi-agent AI coding orchestration system" running on top of OpenCode. It can split a complex task into sub-tasks and assign them to different models for specialized execution.
![](/zh-cn/stage-2/backend/modern-cli/images/image41.png)
You can copy the following prompt and send it to the model you already configured in OpenCode to install Oh My OpenAgent:
```text
Install and configure oh-my-openagent by following the instructions here:
https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/refs/heads/dev/docs/guide/installation.md
```
Below is a brief feature overview of Oh-My-OpenAgent.
| Feature | Description |
| :-------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Discipline Agents** | Sisyphus coordinates Hephaestus, Oracle, Librarian, and Explore. A complete AI dev team works in parallel. |
| **Team Mode** (v4.0, optional) | One leader agent + up to 8 parallel members, real-time tmux visualization, dedicated `team_*` tool family. Powers `hyperplan` (5 adversarial reviewers) and `security-research` (3 hunters + 2 PoC engineers). [Docs →](docs/guide/team-mode.md) |
| **`ultrawork` / `ulw`** | One command launch; all agents mobilize. They do not stop until the task is done. |
| **[IntentGate](https://factory.ai/news/terminal-bench)** | Analyze true user intent before acting. Avoid literal-interpretation AI noise. |
| **Hash-based editing tools** | Every edit is validated with `LINE#ID` content hashes for 0% wrong-line edits. Inspired by [oh-my-pi](https://github.com/can1357/oh-my-pi). [The Harness Problem →](https://blog.can.ac/2026/02/12/the-harness-problem/) |
| **LSP + AST-Grep** | Workspace-level rename, pre-build diagnostics, AST-based rewrites. IDE-grade precision for agents. |
| **Background agents** | Launch 5+ experts in parallel while keeping the main context clean. |
| **Built-in MCP** | Exa (web search), Context7 (official docs), Grep.app (GitHub code search). Enabled by default. |
| **Ralph Loop / `/ulw-loop`** | Self-referential loop. It does not stop before 100% completion. |
| **Forced todo execution** | If an agent drifts, the system pulls it back. Your task must be finished. |
| **Comment reviewer** | Removes AI-flavored noisy comments so code reads like senior-engineer output. |
| **Tmux integration** | Full interactive terminal support: REPL, debugger, TUI tools in live sessions. |
| **Claude Code compatibility** | Existing hooks, commands, skills, MCPs, and plugins can migrate seamlessly. |
| **Skill-embedded MCP** | Skills can carry their own MCP servers, loaded on demand to protect context window size. |
| **Prometheus planner** | Strategic interview-style planning before writing code. |
| **`/init-deep`** | Auto-generates `AGENTS.md` through the project tree. Saves tokens and improves agent understanding. |
Sisyphus (claude-opus-4-7 / kimi-k2.6 / glm-5.1) is your chief orchestrator. It plans, delegates to specialists, and pushes tasks with aggressive parallel execution until complete.
Hephaestus (gpt-5.5) is your autonomous deep worker. Give goals, not hand-holding steps. It explores repo patterns and executes tasks end-to-end without babysitting.
Prometheus (claude-opus-4-7 / kimi-k2.6 / glm-5.1) is your strategic planner. Through interview-style clarification, it defines scope and builds a detailed execution plan before any coding starts.
After this, you can use OpenCode with the Oh-My-OpenAgent plugin to complete coding tasks.
## More Use Cases for CLI AI Coding Tools
### Use AI to Write Requirement Documents: Learn to "Concretize Requirements"
Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

+116 -17
View File
@@ -41,7 +41,7 @@ CLI 天生适合文本命令操作,在一小部分极客(追求极致的编
| 上下文长度 | ✅ 非常长 | ⚠️ 较好 | Claude Code |
| 调试辅助 | ✅ 自动化 | ⚠️ 较多需手动 | Claude Code |
表格来源:https://northflank.com/blog/claude-code-vs-cursor-comparison
表格来源:<https://northflank.com/blog/claude-code-vs-cursor-comparison>
简单说,CLI AI 编程工具通常可以:
@@ -57,6 +57,7 @@ CLI 天生适合文本命令操作,在一小部分极客(追求极致的编
- Codex 使用 GPT-5,在整体能力上更强;
- Claude Code 通过 GLM 4.6 转发 API,整体体验接近 Claude 4,但价格更便宜。
- OpenCode 可以随意切换并搭配模型, 提供免费模型, 可以更好的控制成本。
不过,哪一个在实际项目中更好用,只能通过亲自测试来判断。掌握多种 AI 编程工具始终是有益的:熟练以后,你可以在不同场景下灵活切换 Claude Code、Codex 或 Trae。如果尝试多次后发现某个工具效果一般,可以直接换一个工具或模型继续试验。
@@ -77,7 +78,7 @@ Claude Code 的优势主要体现在:极长的上下文窗口(可以处理
![](images/image9.png)![](images/image10.png)
如果你想系统地学习 Claude Code,可以参考 Andrew Ng 与 Anthropic 联合推出的课程:
https://www.bilibili.com/video/BV176t2zSEpr
<https://www.bilibili.com/video/BV176t2zSEpr>
接下来,我们将学习如何使用 Claude Code。由于直接使用官方 Claude Code 的成本往往非常高(如下图所示),我们会转而使用兼容 Claude Code 协议、但基于其他大模型的 API 平台。
@@ -122,8 +123,8 @@ claude
首先,你需要先获取 GLM 的 API Key,并用你自己觉得最方便的方式保存好。
国内版地址:https://bigmodel.cn/usercenter/proj-mgmt/apikeys
国际版地址:https://z.ai/manage-apikey/apikey-list
国内版地址:<https://bigmodel.cn/usercenter/proj-mgmt/apikeys>
国际版地址:<https://z.ai/manage-apikey/apikey-list>
如果你使用的是 **国内版 GLM**,请使用以下变量配置:
@@ -185,6 +186,7 @@ please help me configure and start Claude Code
Kimi K2 是月之暗面(Moonshot AI)推出的新一代大语言模型,在代码理解和生成能力上表现出色。Kimi K2 支持超长上下文窗口(最高可达 200K tokens),能够轻松处理大型代码库和复杂项目。
**核心优势:**
- **超长上下文**:支持 200K 上下文窗口,可以一次性处理整个项目的代码
- **代码能力强**:在代码生成、重构和调试方面表现优异
- **中文理解好**:对中文编程需求的理解更加准确
@@ -192,11 +194,11 @@ Kimi K2 是月之暗面(Moonshot AI)推出的新一代大语言模型,在
**获取 API Key**
访问 https://platform.moonshot.cn/console/account 注册并获取 API Key。
访问 <https://platform.moonshot.cn/console/account> 注册并获取 API Key。
**配置方法:**
参考文档:https://platform.moonshot.cn/docs/guide/agent-support
参考文档:<https://platform.moonshot.cn/docs/guide/agent-support>
```bash
export ANTHROPIC_BASE_URL=https://api.moonshot.cn/anthropic
@@ -208,6 +210,7 @@ export ANTHROPIC_AUTH_TOKEN=sk-YOURKEY
Minimax 是稀宇科技(MiniMax)推出的新一代大语言模型,在编程任务上表现优异。Minimax 模型以其出色的推理能力和代码生成质量而闻名,特别适合复杂的编程场景。
**核心优势:**
- **推理能力强**:在复杂逻辑推理和代码架构设计方面表现出色
- **代码质量高**:生成的代码结构清晰、可读性好
- **多语言支持**:支持多种编程语言的代码生成和转换
@@ -215,7 +218,7 @@ Minimax 是稀宇科技(MiniMax)推出的新一代大语言模型,在编
**获取 API Key**
访问 https://platform.minimax.io/ 注册并获取 API Key。
访问 <https://platform.minimax.io/> 注册并获取 API Key。
**配置方法:**
@@ -230,6 +233,7 @@ export ANTHROPIC_MODEL=MiniMax-M2.7
DeepSeek 是深度求索推出的开源大语言模型,以其出色的代码能力和高性价比受到开发者欢迎。DeepSeek Coder 专门针对编程任务进行了优化训练。
**核心优势:**
- **代码能力突出**:在代码生成、代码理解和 Bug 修复方面表现优异
- **开源可定制**:模型开源,可以根据需求进行微调
- **性价比高**:API 价格相对较低,适合高频使用
@@ -237,7 +241,7 @@ DeepSeek 是深度求索推出的开源大语言模型,以其出色的代码
**获取 API Key**
访问 https://platform.deepseek.com/usage 注册并获取 API Key。
访问 <https://platform.deepseek.com/usage> 注册并获取 API Key。
**配置方法:**
@@ -255,6 +259,7 @@ export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
火山引擎(Volcano Engine)是字节跳动旗下的云服务平台,提供企业级的 AI 模型服务。火山引擎的 Coding Plan 专门为编程场景优化,提供稳定、高效的代码生成能力。
**核心优势:**
- **企业级稳定性**:提供服务等级协议(SLA),保障服务稳定性
- **代码场景优化**:针对编程任务进行了专门优化
- **丰富模型选择**:支持多种模型,包括 Doubao-pro、Doubao-lite 等
@@ -262,7 +267,7 @@ export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
**获取 API Key**
访问 https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey 注册并获取 API Key。
访问 <https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey> 注册并获取 API Key。
**配置方法:**
@@ -282,7 +287,7 @@ export ANTHROPIC_MODEL="moonshotai/Kimi-K2-Instruct-0905" # 可以自行修
export ANTHROPIC_API_KEY="YOUR_SILICONCLOUD_API_KEY" # 请替换 API Key
```
阿里云 DashScopeAliyuncs):https://help.aliyun.com/zh/model-studio/get-api-key
阿里云 DashScopeAliyuncs):<https://help.aliyun.com/zh/model-studio/get-api-key>
```python
export ANTHROPIC_BASE_URL="https://dashscope.aliyuncs.com/apps/anthropic"
@@ -355,8 +360,8 @@ npm install -g @musistudio/claude-code-router
参考文档:
https://docs.claude.com/en/docs/claude-code/cli-reference
https://docs.claude.com/en/docs/claude-code/slash-commands
<https://docs.claude.com/en/docs/claude-code/cli-reference>
<https://docs.claude.com/en/docs/claude-code/slash-commands>
| 命令 | 作用 | 示例 |
| ----------------- | ----------------------------------------- | ---------------------------------------- |
@@ -380,7 +385,7 @@ https://docs.claude.com/en/docs/claude-code/slash-commands
**CLAUDE.md**
参考: https://www.anthropic.com/engineering/claude-code-best-practices
参考: <https://www.anthropic.com/engineering/claude-code-best-practices>
`CLAUDE.md` 是 Claude 在开始对话时会自动读取并加入上下文的特殊文件。因此,它非常适合用来记录:
@@ -411,7 +416,7 @@ https://docs.claude.com/en/docs/claude-code/slash-commands
#### Claude Code 的内部原理
参考: https://github.com/shareAI-lab/analysis_claude_code
参考: <https://github.com/shareAI-lab/analysis_claude_code>
如果你好奇为什么 Claude Code 在很多场景下比 Trae 或 Cursor 等 Agent 编程工具更好用,我们可以简单看一下它的内部工作机制。
@@ -458,8 +463,8 @@ npm i -g @openai/codex
在这种方式下,我们只需要在第三方转发平台上购买对应的 Codex API 配额,就能获得接近原生 OpenAI Codex 的使用体验。
参考: https://open-dev.feishu.cn/wiki/PAqUwWG4IiuwTvkQ2sGcaQuPnXc
充值地址: https://api.zyai.online/account/topup/recharge
参考: <https://open-dev.feishu.cn/wiki/PAqUwWG4IiuwTvkQ2sGcaQuPnXc>
充值地址: <https://api.zyai.online/account/topup/recharge>
需要注意的是,在拿到 token 配额后,我们还需要在本地配置好 API Key。
@@ -516,6 +521,100 @@ I can use the command `codex --profile myrelay` to run it
配置完成后,你就可以通过 `codex --profile myrelay` 启动使用转发 API 的 Codex 了。之后的使用方式与 Claude Code 类似:只需要在对话框中随时输入你的想法和需求即可。
### OpenCode
![](images/image32.png)
![](images/image33.png)
OpenCode 是一款面向开发者的开源 AI Coding Agent 平台,定位类似于 “多模型版的 Claude Code”。它以 Terminal 为核心交互入口,同时也支持编辑器集成(如 VS Code、Neovim 等),能够深度接入本地代码仓库,并通过自然语言完成从代码理解到工程执行的一整套开发流程。
它不是绑定单一模型的 AI 编程工具,而是一个可自由切换 GPT、Claude、Gemini 乃至本地模型的开放式 AI Coding Agent 平台。就连 OpenAI 官方也持 OpenCode 接入 Codex / OpenAI 订阅。
![](images/image34.png)
你可以通过下面的命令安装 OpenCode:
```bash
# Linux / Unix
curl -fsSL https://opencode.ai/install | bash
# Windows
npm i -g opencode-ai
```
#### 使用 OpenCode 中的免费模型
在 OpenCode 中不定期会提供免费模型可以进行使用, 配置也非常简单。你可以在你需要使用 OpenCode 的位置在命令行输入 `opencode` 启动 Opencode 程序进入聊天面板。输入 `/models`命令搜索 free 关键词就可以看到带有 free 字眼的免费模型
![](images/image35.png)
在一般情况下免费模型完成编码任务会比付费 / 订阅模型要慢一些,这通常取决于模型线路是否阻塞, 是否编码高峰期以及模型本身的能力。
#### 使用第三方模型来作为 OpenCode 的主编码模型
这是 OpenCode 的核心优势, 它可以在使用同样的 MCP, Skills, 上下文的情况下允许你自由切换模型来完成不同的编码任务。下文以 OpenAI 官方的 GPT-5.3 Codex 为例,接入 OpenCode 作为主编码模型。
在 OpenCode 的聊天窗口中输入 `/connect` 命令选中第一条最相关指令按下 enter 键,就可以进行选择第三方模型提供商的认证授权。
![](images/image36.png)
这里以选择 OpenAI 为例,进行回车选择认证方式。
![](images/image37.png)
选哪种都可以,只是认证方式不同。这里选择第一种进行浏览器登录。
![](images/image38.png)
复制此链接到浏览器上进行正常的 OpenAI 登录操作,浏览器上出现 Authorization Successful 后 OpenCode 客户端会自动跳转至选择 OpenAI 的模型界面。
![](images/image39.png)
![](images/image40.png)
#### 安装 Oh My OpenAgent 插件
OpenCode 的强大之处还在于他有非常活跃的社区生态,你可以在 Github 上搜索出非常多与 OpenCode 相关的插件。如果说 OpenCode 是一款可以任意切换模型的 AI 协作工具的话,那么 Oh-My-OpenAgent 就是一款运行在 OpenCode 之上的 "多 Agent AI 编程指挥系统"。它可以将一个复杂任务拆给多个子任务分给不同的模型进行各司其职的工作。
![](images/image41.png)
你可以将以下话术复制之后粘贴给上文在 OpenCode 中配置好的模型进行安装 OpenCode。
```text
Install and configure oh-my-openagent by following the instructions here:
https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/refs/heads/dev/docs/guide/installation.md
```
以下是 Oh-My-OpenAgent 的特性以及功能说明。
| 特性 | 功能说明 |
| :-------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **自律军团 (Discipline Agents)** | Sisyphus 负责调度 Hephaestus、Oracle、Librarian 和 Explore。一支完整的 AI 开发团队并行工作。 |
| **Team Mode** (v4.0, 选择性启用) | 领导 Agent + 最多 8 个并行成员,实时 tmux 可视化,专用 `team_*` 工具家族。驱动 `hyperplan`(5 个敌对评论者) 和 `security-research`(3 个猎手 + 2 个 PoC 工程师)。[文档 →](docs/guide/team-mode.md) |
| **`ultrawork` / `ulw`** | 一键触发,所有智能体出动。任务完成前绝不罢休。 |
| **[IntentGate 意图门](https://factory.ai/news/terminal-bench)** | 真正行动前,先分析用户的真实意图。彻底告别被字面意思误导的 AI 废话。 |
| **基于哈希的编辑工具** | 每次修改都通过 `LINE#ID` 内容哈希验证、0% 错误修改。灵感来自 [oh-my-pi](https://github.com/can1357/oh-my-pi)。[The Harness Problem →](https://blog.can.ac/2026/02/12/the-harness-problem/) |
| **LSP + AST-Grep** | 工作区级别的重命名、构建前诊断、基于 AST 的重写。为 Agent 提供 IDE 级别的精度。 |
| **后台智能体** | 同时发射 5+ 个专家并行工作。保持上下文干净,随时获取成果。 |
| **内置 MCP** | Exa(网络搜索)、Context7(官方文档)、Grep.app(GitHub 源码搜索)。默认开启。 |
| **Ralph Loop / `/ulw-loop`** | 自我引用闭环。达不到 100% 完成度绝不停止。 |
| **Todo 强制执行** | Agent 想要摸鱼?系统直接揪着领子拽回来。你的任务,必须完成。 |
| **注释审查员** | 剔除带有浓烈 AI 味的冗余注释。写出的代码就像老练的高级工程师写的。 |
| **Tmux 集成** | 完整的交互式终端支持。跑 REPL、用调试器、用 TUI 工具,全都在实时会话中完成。 |
| **Claude Code 兼容** | 你现有的 Hooks、命令、技能、MCP 和插件?全都能无缝迁移过来。 |
| **技能内嵌 MCP** | 技能自带其所需的 MCP 服务器。按需开启,不会撑爆你的上下文窗口。 |
| **Prometheus 规划师** | 动手写代码前,先通过访谈模式做好战略规划。 |
| **`/init-deep`** | 在整个项目目录层级中自动生成 `AGENTS.md`。不仅省 Token,还能大幅提升 Agent 理解力。 |
Sisyphus (claude-opus-4-7 / kimi-k2.6 / glm-5.1) 是你的主指挥官。他负责制定计划、分配任务给专家团队,并以极其激进的并行策略推动任务直至完成。他从不半途而废。
Hephaestus (gpt-5.5) 是你的自主深度工作者。你只需要给他目标,不要给他具体做法。他会自动探索代码库模式,从头到尾独立执行任务,绝不会中途要你当保姆。名副其实的正牌工匠。
Prometheus (claude-opus-4-7 / kimi-k2.6 / glm-5.1) 是你的战略规划师。他通过访谈模式,在动一行代码之前,先通过提问确定范围并构建详尽的执行计划。
了解完这些, 你就可以使用装好 Oh-My-OpenAgent 插件之后的 OpenCode 来完成编码任务了。
## CLI AI 编程工具的更多用法
### 用 AI 写需求文档:学会“具体化需求”
@@ -671,7 +770,7 @@ Features: Add “Templates,” “Themes & Personalization,” and start develop
对于刚接触计算机的同学来说,从 GitHub 上部署一个开源项目往往很有难度。但我们完全可以把这件事交给 Claude Code,就像我们在 Dify 教程中做的那样:
https://github.com/langgenius/dify
<https://github.com/langgenius/dify>
如果我想在本地跑起自己的 Dify,只需要把这个链接扔给 Claude Code,然后输入: