@cannbot-ai/install-helper 0.0.2-beta.2 → 0.0.2-beta.20

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
@@ -18,6 +18,36 @@ npx @cannbot-ai/install-helper
18
18
 
19
19
  交互式向导会自动检测已安装的 AI 编程工具(OpenCode / Claude Code / Trae / Cursor),通过箭头键选择场景即可完成安装。
20
20
 
21
+ ## 一键安装所有 Skills
22
+
23
+ 如果 opencode 等工具已安装,可直接一键安装全部 Skills(无需逐个点选):
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
+
33
+ > 交互式向导也支持「全选所有 Skills」和「全选当前类别」,详见下文。
34
+
35
+ ## 主要特性
36
+
37
+ ### 核心功能
38
+ - **动态 Skill 发现**:自动扫描仓库中的 SKILL.md 文件,实时发现可用 Skills
39
+ - **智能缓存机制**:扫描结果缓存 24 小时,大幅提升后续命令执行速度
40
+ - **备份与恢复**:安装新插件时自动备份 AGENTS.md,支持一键恢复
41
+ - **参数校验**:`--tool` 和 `--level` 参数支持校验,提供友好的错误提示(支持中英文)
42
+ - **智能记忆**:记住上次选择的工具和安装级别,下次运行自动填充
43
+
44
+ ### 安装管理
45
+ - **交互式向导**:箭头键选择,空格切换,回车确认
46
+ - **插件安装**:支持 10 个官方插件,自动处理依赖
47
+ - **Skill 安装**:支持 89 个 Skills,按 11 个类别组织
48
+ - **智能卸载**:根据安装记录精确删除,自动清理空目录
49
+ - **健康检查**:检测安装状态,自动修复常见问题
50
+
21
51
  ## 命令一览
22
52
 
23
53
  | 命令 | 说明 |
@@ -26,6 +56,7 @@ npx @cannbot-ai/install-helper
26
56
  | `install-helper list` | 列出可用场景及安装状态 |
27
57
  | `install-helper install <name>` | 安装指定插件或 Skill(自动识别) |
28
58
  | `install-helper install --list` | 按类别列出所有可用 Skills |
59
+ | `install-helper install --all --tool opencode --yes` | 一键安装全部 Skills |
29
60
  | `install-helper update [plugin]` | 更新已安装的 Skills |
30
61
  | `install-helper uninstall <plugin>` | 卸载指定场景 |
31
62
  | `install-helper status` | 查看已安装插件详情 |
@@ -98,14 +129,19 @@ Skills 按 11 个大类组织:知识与参考、环境与工具、调试与诊
98
129
 
99
130
  `install` 命令自动识别输入是插件还是 Skill,无需区分。
100
131
 
132
+ **交互式「全选」**:运行 `install-helper install`(不带参数)进入交互式选择时:
133
+ - 类别列表顶部有 **「全选所有 Skills」**,选中即一键安装全部 Skills。
134
+ - 进入某类别后,顶部有 **「全选当前类别」**,勾选后回车即选中该类别全部 Skills。
135
+ - 选完一个类别后会提示「继续选择其他类别 / 确认安装」,可跨类别累积选择后再统一安装。
136
+
101
137
  **选项:**
102
138
 
103
139
  | 选项 | 说明 |
104
140
  |------|------|
105
141
  | `--tool <tool>` | 指定 AI 工具(opencode, claude, trae, cursor, copilot) |
106
142
  | `--level <level>` | 安装级别(project, global),默认 project |
107
- | `--all` | 安装全部场景 |
108
- | `--yes` | 跳过所有确认提示 |
143
+ | `--all` `-a` | 安装全部 Skills(一键安装) |
144
+ | `--yes` `-y` | 跳过所有确认提示 |
109
145
 
110
146
  **已装检测**:如果插件已安装,会提示是否覆盖安装。使用 `--yes` 可跳过提示直接覆盖。
111
147
 
@@ -168,6 +204,10 @@ install-helper uninstall ops-direct-invoke --tool opencode
168
204
 
169
205
  ## 可用场景
170
206
 
207
+ install-helper 支持 **10 个官方插件** 和 **89 个 Skills**(动态发现,数量可能随仓库更新而变化)。
208
+
209
+ #### 官方插件
210
+
171
211
  | # | 场景 | ID | 别名 |
172
212
  |---|------|----|------|
173
213
  | 1 | AscendC Kernel 直调 | ops-direct-invoke | ops-direct, direct, kernel |
@@ -181,6 +221,23 @@ install-helper uninstall ops-direct-invoke --tool opencode
181
221
  | 9 | 代码检视 | ops-code-reviewer | code-review, reviewer |
182
222
  | 10 | torch.compile 图模式 | torch-compile | torch, compile |
183
223
 
224
+ #### Skills 类别
225
+
226
+ Skills 按 11 个类别组织(动态发现,数量可能随仓库更新而变化):
227
+ - 知识与参考
228
+ - 环境与工具
229
+ - 调试与诊断
230
+ - 测试与质量
231
+ - AscendC 开发
232
+ - PyPTO 开发
233
+ - TileLang 开发
234
+ - Triton 开发
235
+ - 模型推理优化
236
+ - 图模式
237
+ - 平台工具
238
+
239
+ 使用 `install-helper install --list` 查看完整的 Skills 列表。
240
+
184
241
  ## 前置条件
185
242
 
186
243
  - Node.js >= 18
@@ -192,17 +249,21 @@ install-helper uninstall ops-direct-invoke --tool opencode
192
249
  install-helper 是一个编排工具:
193
250
 
194
251
  1. **自动检测**已安装的 AI 编程工具
195
- 2. **克隆或更新** cannbot-skills 仓库(缓存到 `~/.cannbot/repo/`)
196
- 3. **调用**各插件的 `init.sh` / `install.sh` 脚本执行实际安装
197
- 4. **追踪**安装状态(`~/.cannbot/config.yaml` + manifest)
252
+ 2. **动态扫描**仓库中的 SKILL.md 文件,发现可用 Skills
253
+ 3. **缓存扫描结果**到 `~/.cannbot/scan-cache.json`(24 小时有效)
254
+ 4. **克隆或更新** cannbot-skills 仓库(缓存到 `~/.cannbot/repo/`)
255
+ 5. **备份现有配置**(如果检测到已安装的 AGENTS.md)
256
+ 6. **调用**各插件的 `init.sh` / `install.sh` 脚本执行实际安装
257
+ 7. **追踪**安装状态(`~/.cannbot/config.yaml` + manifest)
198
258
 
199
259
  安装逻辑仍由各插件的 init.sh 脚本负责,install-helper 提供统一的交互式入口和状态管理。
200
260
 
201
261
  ## 配置文件
202
262
 
203
- 配置保存在 `~/.cannbot/config.yaml`:
263
+ 配置保存在 `~/.cannbot/` 目录:
204
264
 
205
265
  ```yaml
266
+ # config.yaml - 用户配置
206
267
  language: zh_CN # 界面语言
207
268
  lastTool: opencode # 上次使用的 AI 工具
208
269
  lastLevel: project # 上次安装级别
@@ -211,11 +272,31 @@ installedPlugins: # 已安装的插件列表
211
272
  - pypto-op-orchestrator
212
273
  ```
213
274
 
275
+ ```json
276
+ // scan-cache.json - 扫描缓存(自动生成,24 小时有效)
277
+ {
278
+ "skills": [...],
279
+ "timestamp": 1234567890,
280
+ "repoPath": "/path/to/repo"
281
+ }
282
+ ```
283
+
284
+ ```json
285
+ // installs/<plugin>.json - 安装记录(每个插件一个文件)
286
+ {
287
+ "pluginId": "ops-direct-invoke",
288
+ "installTime": "2026-06-23T10:00:00Z",
289
+ "configRoot": "/path/to/config",
290
+ "files": [...],
291
+ "directories": [...]
292
+ }
293
+ ```
294
+
214
295
  ## 开发
215
296
 
216
297
  ```bash
217
298
  git clone https://gitcode.com/cann/cannbot-skills.git
218
- cd cannbot-skills/packages/install-helper
299
+ cd cannbot-skills/plugins-community/install-helper
219
300
 
220
301
  npm install
221
302
  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