Skip to content

Commit 02f0da3

Browse files
committed
docs: use opencode plugin command as primary install method
1 parent 52848f0 commit 02f0da3

1 file changed

Lines changed: 21 additions & 20 deletions

File tree

‎README.md‎

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,27 @@
2222

2323
## 安装
2424

25-
### 方式一:npm 包(推荐)
25+
### 方式一:opencode plugin(推荐)
26+
27+
```bash
28+
opencode plugin @herouucn/opencode-commandcode
29+
```
30+
31+
opencode 自动完成:
32+
1. 安装 npm 包到缓存目录
33+
2. 更新 `~/.config/opencode/opencode.json`,追加 plugin 和 provider 配置
34+
35+
重启 opencode 即可使用。
36+
37+
### 方式二:npm 包
38+
39+
```bash
40+
npm install @herouucn/opencode-commandcode
41+
# 或
42+
bun add @herouucn/opencode-commandcode
43+
```
44+
45+
然后在 `opencode.json` 中声明:
2646

2747
```jsonc
2848
// opencode.json
@@ -42,25 +62,6 @@
4262
}
4363
```
4464

45-
安装 npm 包:
46-
47-
```bash
48-
npm install @herouucn/opencode-commandcode
49-
# 或
50-
bun add @herouucn/opencode-commandcode
51-
```
52-
53-
### 方式二:一键脚本(推荐)
54-
55-
```bash
56-
curl -fsSL https://raw.githubusercontent.com/herouu/opencode-commandcode/main/install.sh | bash
57-
```
58-
59-
脚本自动完成:
60-
1. 检查 opencode 是否已安装
61-
2. 创建 `~/.config/opencode/opencode.json`(如已存在则合并)
62-
3. 追加 plugin 和 provider.commandcode 配置
63-
6465
### 方式三:本地路径(开发用)
6566

6667
```bash

0 commit comments

Comments
 (0)