项目地址:
opencode : The open source coding agent.
oh-my-opencode : The Best Agent Harness.
文档:
教程:
环境
- WSL2
- Ubuntu 24.04
安装
- 安装 opencode
1 | curl -fsSL https://opencode.ai/install | bash |
- 启动 opencode
1 | $ cd /path/to/project |
- 在
opencode中安装oh-my-opencode
1 | Install and configure by following the instructions here https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/refs/heads/master/README.md |
使用
init
- 导航到想要处理的项目目录
1 | cd /path/to/project |
- 运行 OpenCode
1 | opencode |
- 项目初始化
1 | /init |
OpenCode 会分析你的项目并在项目根目录创建一个 AGENTS.md 文件。这有助于 OpenCode 理解项目结构以及所使用的编码模式。
Plan mode & Build mode
使用 Tab 键切换。
Plan mode: 该模式会禁用其直接修改代码的能力,转而建议它将如何实现该功能。
Build mode: 该模式会修改代码。
model
选择想要使用的模型:
1 | /model |
web
启动 Web 界面:
1 | opencode web |