@cannbot-ai/install-helper 0.0.2-beta.3 → 0.0.2-beta.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,7 +16,49 @@ install-helper
16
16
  npx @cannbot-ai/install-helper
17
17
  ```
18
18
 
19
- 交互式向导会自动检测已安装的 AI 编程工具(OpenCode / Claude Code / Trae / Cursor),通过箭头键选择场景即可完成安装。
19
+ > 全局安装后也可使用短命令 `ihelper`,如 `ihelper list`、`ihelper install --all --tool opencode --yes`。
20
+
21
+ 交互式向导会自动检测已安装的 AI 编程工具(OpenCode / Claude Code / Trae / Cursor / GitHub Copilot),通过箭头键选择场景即可完成安装。
22
+
23
+ ## 一键安装所有 Skills
24
+
25
+ 如果 AI 编程工具已安装,可直接一键安装全部 Skills(无需逐个点选)。支持所有工具(opencode / claude / trae / cursor / copilot):
26
+
27
+ ```bash
28
+ # 一键安装全部 Skills 到当前项目(跳过确认)
29
+ install-helper install --all --tool opencode --yes
30
+
31
+ # 一键安装全部 Skills 到全局
32
+ install-helper install --all --tool opencode --level global --yes
33
+
34
+ # 指定其他 AI 工具
35
+ install-helper install --all --tool claude --yes
36
+ install-helper install --all --tool trae --yes
37
+
38
+ # 不指定 --tool,交互式选择工具
39
+ install-helper install --all --yes
40
+ ```
41
+
42
+ > 交互式向导也支持「全选所有 Skills」和「全选当前类别」,详见下文。
43
+
44
+ ## 主要特性
45
+
46
+ ### 核心功能
47
+ - **动态 Skill 发现**:自动扫描仓库中的 SKILL.md 文件,实时发现可用 Skills
48
+ - **智能缓存机制**:扫描结果缓存 24 小时,大幅提升后续命令执行速度
49
+ - **备份与恢复**:安装新插件时自动备份 AGENTS.md,支持一键恢复
50
+ - **参数校验**:`--tool` 和 `--level` 参数支持校验,提供友好的错误提示(支持中英文)
51
+ - **智能记忆**:记住上次选择的工具和安装级别,下次运行自动填充
52
+
53
+ ### 安装管理
54
+ - **交互式向导**:箭头键选择,空格切换,回车确认
55
+ - **列表排序**:插件和 Skills 列表按名称升序排列
56
+ - **描述聚焦**:光标聚焦某项时,下方以青色 + 💡 前缀显示详细描述,支持中文自适应换行
57
+ - **批量选择**:支持全选所有 Skills、全选当前类别、跨类别累积选择
58
+ - **插件安装**:支持 10 个官方插件,自动处理依赖
59
+ - **Skill 安装**:支持 91 个 Skills,按 11 个类别组织
60
+ - **智能卸载**:根据安装记录精确删除,自动清理空目录
61
+ - **健康检查**:检测安装状态,自动修复常见问题
20
62
 
21
63
  ## 命令一览
22
64
 
@@ -26,6 +68,7 @@ npx @cannbot-ai/install-helper
26
68
  | `install-helper list` | 列出可用场景及安装状态 |
27
69
  | `install-helper install <name>` | 安装指定插件或 Skill(自动识别) |
28
70
  | `install-helper install --list` | 按类别列出所有可用 Skills |
71
+ | `install-helper install --all --tool <tool> --yes` | 一键安装全部 Skills |
29
72
  | `install-helper update [plugin]` | 更新已安装的 Skills |
30
73
  | `install-helper uninstall <plugin>` | 卸载指定场景 |
31
74
  | `install-helper status` | 查看已安装插件详情 |
@@ -46,10 +89,13 @@ install-helper init
46
89
  ```
47
90
 
48
91
  向导会引导你完成:
49
- 1. 自动检测已安装的 AI 编程工具
50
- 2. 选择安装级别(project / global)
51
- 3. 多选要安装的场景(空格切换,回车确认)
52
- 4. 确认并执行安装
92
+ 1. 选择安装类型(Plugin 完整工作流 / Skill 轻量知识)
93
+ 2. 自动检测已安装的 AI 编程工具
94
+ 3. 选择安装级别(project / global)
95
+ 4. 多选要安装的插件或 Skills(空格切换,回车确认)
96
+ 5. 确认并执行安装
97
+
98
+ **列表展示**:插件和 Skill 列表均按名称升序排列。光标聚焦某项时,下方会以青色 + 💡 前缀显示该项的详细描述,支持中文自适应换行。
53
99
 
54
100
  **智能记忆**:向导会记住你上次选择的工具和级别,下次运行无需重新选择。已安装的插件会自动标记并默认不勾选。
55
101
 
@@ -64,11 +110,7 @@ install-helper install ops-direct-invoke --level global # 全局安装
64
110
 
65
111
  **重要说明**:
66
112
 
67
- 每个插件都有独立的 `AGENTS.md` 配置文件。如果在同一目录下安装多个插件,后安装的会覆盖前一个的配置文件。
68
-
69
- **推荐做法**:
70
- - 每个项目只安装一个插件
71
- - 如需使用多个插件,在不同目录下分别安装
113
+ 每个插件都有独立的 `AGENTS.md` 配置文件。如果在同一目录下安装多个插件,后安装的会覆盖前一个的配置文件。建议每个项目只安装一个插件,如需使用多个插件,在不同目录下分别安装。
72
114
 
73
115
  **示例**:
74
116
  ```bash
@@ -81,8 +123,6 @@ cd project-b
81
123
  install-helper install triton --tool opencode
82
124
  ```
83
125
 
84
- > **注意**:每个插件有独立的 `AGENTS.md` 配置文件。同一项目目录下安装多个插件时,后安装的会覆盖前一个的 `AGENTS.md`。如需同时使用多个插件,建议分别在不同项目目录中安装。
85
-
86
126
  ### 安装单个 Skill(轻量模式)
87
127
 
88
128
  如果只需要让 AI agent 掌握特定领域知识,不需要完整工作流,可以直接安装单个 Skill:
@@ -94,18 +134,25 @@ install-helper install model-infer-kvcache # 安装 KVCache 优化
94
134
  install-helper install --list # 查看所有可用 Skills
95
135
  ```
96
136
 
97
- Skills 按 11 个大类组织:知识与参考、环境与工具、调试与诊断、测试与质量、AscendC 开发、PyPTO 开发、TileLang 开发、Triton 开发、模型推理优化、图模式、平台工具。
137
+ Skills 按 11 个大类组织(另有「其他」兜底类别):知识与参考、环境与工具、调试与诊断、测试与质量、AscendC 开发、PyPTO 开发、TileLang 开发、Triton 开发、模型推理优化、图模式、平台工具。
98
138
 
99
139
  `install` 命令自动识别输入是插件还是 Skill,无需区分。
100
140
 
141
+ **交互式批量选择**:运行 `install-helper install`(不带参数)进入交互式选择时,支持以下批量操作:
142
+
143
+ - **全选所有 Skills**:类别列表顶部有「全选所有 Skills(共 N 个)」,选中即一键安装全部。
144
+ - **全选当前类别**:进入某类别后,顶部有「全选当前类别」,勾选后回车即选中该类别全部 Skills。
145
+ - **跨类别累积选择**:选完一个类别后,可选择「继续选择其他类别」,已选 Skills 会保留累积,不丢失。类别列表中实时显示「确认安装(已选 N 个 Skills)」快捷入口,随时可确认安装。
146
+ - **单选/多选**:在类别内用空格勾选任意多个 Skills,回车确认。
147
+
101
148
  **选项:**
102
149
 
103
150
  | 选项 | 说明 |
104
151
  |------|------|
105
152
  | `--tool <tool>` | 指定 AI 工具(opencode, claude, trae, cursor, copilot) |
106
153
  | `--level <level>` | 安装级别(project, global),默认 project |
107
- | `--all` | 安装全部场景 |
108
- | `--yes` | 跳过所有确认提示 |
154
+ | `--all` `-a` | 安装全部 Skills(一键安装) |
155
+ | `--yes` `-y` | 跳过所有确认提示 |
109
156
 
110
157
  **已装检测**:如果插件已安装,会提示是否覆盖安装。使用 `--yes` 可跳过提示直接覆盖。
111
158
 
@@ -168,23 +215,45 @@ install-helper uninstall ops-direct-invoke --tool opencode
168
215
 
169
216
  ## 可用场景
170
217
 
218
+ install-helper 支持 **10 个官方插件** 和 **91 个 Skills**(动态发现,数量可能随仓库更新而变化)。
219
+
220
+ #### 官方插件
221
+
171
222
  | # | 场景 | ID | 别名 |
172
223
  |---|------|----|------|
173
- | 1 | AscendC Kernel 直调 | ops-direct-invoke | ops-direct, direct, kernel |
174
- | 2 | AscendC Kernel 从零构建 | ops-direct-invoke-flash | flash |
175
- | 3 | AscendC 算子注册调用 | ops-registry-invoke | ops-registry, registry |
176
- | 4 | PyPTO 算子 | pypto-op-orchestrator | pypto |
177
- | 5 | Triton 算子生成 | triton-op-generator | triton |
178
- | 6 | TileLang 算子 | tilelang-op-orchestrator | tilelang |
179
- | 7 | NPU 推理优化 | model-infer-optimize | model-infer, infer |
180
- | 8 | Catlass 算子直调 | catlass-op-generator | catlass |
181
- | 9 | 代码检视 | ops-code-reviewer | code-review, reviewer |
182
- | 10 | torch.compile 图模式 | torch-compile | torch, compile |
224
+ | 1 | AscendC Kernel 直调 | ops-direct-invoke | ops-direct, ascendc-direct, direct, kernel |
225
+ | 2 | AscendC Kernel 直调(快速版) | ops-direct-invoke-flash | flash, kernel-flash |
226
+ | 3 | AscendC 算子注册调用 | ops-registry-invoke | ops-registry, ascendc-registry, registry |
227
+ | 4 | Catlass 算子直调 | catlass-op-generator | catlass |
228
+ | 5 | NPU 推理优化 | model-infer-optimize | model-infer, infer, inference |
229
+ | 6 | PyPTO 算子开发 | pypto-op-orchestrator | pypto, pytorch |
230
+ | 7 | TileLang 算子开发 | tilelang-op-orchestrator | tilelang |
231
+ | 8 | Triton 算子开发 | triton-op-generator | triton |
232
+ | 9 | torch.compile 图模式 | torch-compile | torch, compile, graph |
233
+ | 10 | 代码检视 | ops-code-reviewer | code-review, reviewer, review |
234
+
235
+ #### Skills 类别
236
+
237
+ Skills 按 11 个类别组织(另有「其他」兜底类别,动态发现,数量可能随仓库更新而变化):
238
+ - 知识与参考
239
+ - 环境与工具
240
+ - 调试与诊断
241
+ - 测试与质量
242
+ - AscendC 开发
243
+ - PyPTO 开发
244
+ - TileLang 开发
245
+ - Triton 开发
246
+ - 模型推理优化
247
+ - 图模式
248
+ - 平台工具
249
+ - 其他 Skills
250
+
251
+ 使用 `install-helper install --list` 查看完整的 Skills 列表。
183
252
 
184
253
  ## 前置条件
185
254
 
186
255
  - Node.js >= 18
187
- - 已安装至少一个 AI 编程工具(OpenCode / Claude Code / Trae / Cursor)
256
+ - 已安装至少一个 AI 编程工具(OpenCode / Claude Code / Trae / Cursor / GitHub Copilot)
188
257
  - Git(用于克隆 Skills 仓库)
189
258
 
190
259
  ## 工作原理
@@ -192,17 +261,21 @@ install-helper uninstall ops-direct-invoke --tool opencode
192
261
  install-helper 是一个编排工具:
193
262
 
194
263
  1. **自动检测**已安装的 AI 编程工具
195
- 2. **克隆或更新** cannbot-skills 仓库(缓存到 `~/.cannbot/repo/`)
196
- 3. **调用**各插件的 `init.sh` / `install.sh` 脚本执行实际安装
197
- 4. **追踪**安装状态(`~/.cannbot/config.yaml` + manifest)
264
+ 2. **动态扫描**仓库中的 SKILL.md 文件,发现可用 Skills
265
+ 3. **缓存扫描结果**到 `~/.cannbot/scan-cache.json`(24 小时有效)
266
+ 4. **克隆或更新** cannbot-skills 仓库(缓存到 `~/.cannbot/repo/`)
267
+ 5. **备份现有配置**(如果检测到已安装的 AGENTS.md)
268
+ 6. **调用**各插件的 `init.sh` / `install.sh` 脚本执行实际安装
269
+ 7. **追踪**安装状态(`~/.cannbot/config.yaml` + manifest)
198
270
 
199
271
  安装逻辑仍由各插件的 init.sh 脚本负责,install-helper 提供统一的交互式入口和状态管理。
200
272
 
201
273
  ## 配置文件
202
274
 
203
- 配置保存在 `~/.cannbot/config.yaml`:
275
+ 配置保存在 `~/.cannbot/` 目录:
204
276
 
205
277
  ```yaml
278
+ # config.yaml - 用户配置
206
279
  language: zh_CN # 界面语言
207
280
  lastTool: opencode # 上次使用的 AI 工具
208
281
  lastLevel: project # 上次安装级别
@@ -211,11 +284,31 @@ installedPlugins: # 已安装的插件列表
211
284
  - pypto-op-orchestrator
212
285
  ```
213
286
 
287
+ ```json
288
+ // scan-cache.json - 扫描缓存(自动生成,24 小时有效)
289
+ {
290
+ "skills": [...],
291
+ "repoCommit": "a1b2c3d4e5f6...",
292
+ "timestamp": 1234567890
293
+ }
294
+ ```
295
+
296
+ ```json
297
+ // installs/<plugin>.json - 安装记录(每个插件一个文件)
298
+ {
299
+ "pluginId": "ops-direct-invoke",
300
+ "installTime": "2026-06-23T10:00:00Z",
301
+ "configRoot": "/path/to/config",
302
+ "files": [...],
303
+ "directories": [...]
304
+ }
305
+ ```
306
+
214
307
  ## 开发
215
308
 
216
309
  ```bash
217
310
  git clone https://gitcode.com/cann/cannbot-skills.git
218
- cd cannbot-skills/packages/install-helper
311
+ cd cannbot-skills/plugins-community/install-helper
219
312
 
220
313
  npm install
221
314
  npm run dev # watch 模式
@@ -0,0 +1,25 @@
1
+ # ----------------------------------------------------------------------------------------------------------
2
+ # Copyright (c) 2026 Huawei Technologies Co., Ltd.
3
+ # This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4
+ # CANN Open Software License Agreement Version 2.0 (the "License").
5
+ # Please refer to the License for details. You may not use this file except in compliance with the License.
6
+ # THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7
+ # INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8
+ # See LICENSE in the root of the software repository for the full text of the License.
9
+ # ----------------------------------------------------------------------------------------------------------
10
+
11
+ # Default configuration for install-helper
12
+ repository:
13
+ url: "https://gitcode.com/cann/cannbot-skills.git"
14
+ name: "cannbot-skills"
15
+
16
+ scanDirs:
17
+ - ops
18
+ - model
19
+ - graph
20
+ - infra
21
+ - ops-lab
22
+
23
+ pluginDirs:
24
+ - plugins-official
25
+ - plugins-community