@cannbot-ai/install-helper 0.0.2-beta.4 → 0.0.2-beta.41

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