@cannbot-ai/install-helper 0.0.2-beta.66 → 0.0.2-beta.68

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
@@ -6,79 +6,55 @@
6
6
 
7
7
  ## 快速开始
8
8
 
9
- **有 Node.js 18+ 环境(推荐):**
9
+ ### Linux / macOS
10
10
 
11
11
  ```bash
12
- npm install -g @cannbot-ai/install-helper
12
+ curl -fsSL https://raw.gitcode.com/cann/cannbot-skills/raw/master/install.sh | bash
13
13
  ```
14
14
 
15
- **无 Node.js 环境:**
15
+ ### Windows
16
16
 
17
- | 平台 | 命令 |
18
- |------|------|
19
- | Linux / macOS | `curl -fsSL https://raw.gitcode.com/cann/cannbot-skills/raw/master/install.sh \| bash` |
20
- | Windows | `irm https://cdn.jsdelivr.net/npm/@cannbot-ai/install-helper@latest/dist/install.ps1 \| iex` |
17
+ ```powershell
18
+ irm https://cdn.jsdelivr.net/npm/@cannbot-ai/install-helper@latest/dist/install.ps1 | iex
19
+ ```
20
+
21
+ ### npm(全平台,需要 Node.js 18+)
22
+
23
+ ```bash
24
+ npm install -g @cannbot-ai/install-helper
25
+ ```
21
26
 
22
27
  > 也可以免安装直接运行:`npx @cannbot-ai/install-helper`
23
28
 
24
- 安装完成后运行 `install-helper` 启动交互式向导,自动检测已安装的 AI 编程工具(OpenCode / Claude Code / Trae / Cursor / GitHub Copilot),通过箭头键选择场景即可完成安装。
29
+ ---
25
30
 
26
- ## 一键安装所有 Skills
31
+ 安装完成后运行 `install-helper` 启动向导。
27
32
 
28
- 如果 AI 编程工具已安装,可直接一键安装全部 Skills(无需逐个点选)。支持所有工具(opencode / claude / trae / cursor / copilot):
33
+ ## 一键安装所有 Skills
29
34
 
30
35
  ```bash
31
- # 一键安装全部 Skills 到当前项目(跳过确认)
36
+ # 安装全部 Skills 到当前项目
32
37
  install-helper install --all --tool opencode --yes
33
38
 
34
- # 一键安装全部 Skills 到全局
39
+ # 安装全部 Skills 到全局
35
40
  install-helper install --all --tool opencode --level global --yes
36
-
37
- # 指定其他 AI 工具
38
- install-helper install --all --tool claude --yes
39
- install-helper install --all --tool trae --yes
40
-
41
- # 不指定 --tool,交互式选择工具
42
- install-helper install --all --yes
43
41
  ```
44
42
 
45
- > 交互式向导也支持「全选所有 Skills」和「全选当前类别」,详见下文。
46
-
47
- ## 主要特性
48
-
49
- ### 核心功能
50
- - **动态 Skill 发现**:自动扫描仓库中的 SKILL.md 文件,实时发现可用 Skills
51
- - **智能缓存机制**:扫描结果缓存 24 小时,大幅提升后续命令执行速度
52
- - **备份与恢复**:安装新插件时自动备份 AGENTS.md,支持一键恢复
53
- - **参数校验**:`--tool` 和 `--level` 参数支持校验,提供友好的错误提示(支持中英文)
54
- - **智能记忆**:记住上次选择的工具和安装级别,下次运行自动填充
55
-
56
- ### 安装管理
57
- - **交互式向导**:箭头键选择,空格切换,回车确认
58
- - **列表排序**:插件和 Skills 列表按名称升序排列
59
- - **描述聚焦**:光标聚焦某项时,下方以青色 + 💡 前缀显示详细描述,支持中文自适应换行
60
- - **批量选择**:支持全选所有 Skills、全选当前类别、跨类别累积选择
61
- - **插件安装**:支持 10 个官方插件,自动处理依赖
62
- - **Skill 安装**:支持 91 个 Skills,按 11 个类别组织
63
- - **智能卸载**:根据安装记录精确删除,自动清理空目录
64
- - **健康检查**:检测安装状态,自动修复常见问题
65
-
66
43
  ## 命令一览
67
44
 
68
45
  | 命令 | 说明 |
69
46
  |------|------|
70
- | `install-helper` / `install-helper init` | 交互式安装向导 |
47
+ | `install-helper` | 交互式安装向导 |
71
48
  | `install-helper list` | 列出可用场景及安装状态 |
72
49
  | `install-helper install <name>` | 安装指定插件或 Skill(自动识别) |
73
50
  | `install-helper install --list` | 按类别列出所有可用 Skills |
74
51
  | `install-helper install --all --tool <tool> --yes` | 一键安装全部 Skills |
75
- | `install-helper update [plugin]` | 更新已安装的 Skills |
76
- | `install-helper uninstall <plugin>` | 卸载指定场景 |
52
+ | `install-helper update [plugin]` | 更新已安装的插件 |
53
+ | `install-helper uninstall <plugin>` | 卸载指定插件 |
77
54
  | `install-helper status` | 查看已安装插件详情 |
78
55
  | `install-helper doctor` | 健康检查 |
79
56
  | `install-helper doctor --fix` | 健康检查 + 自动修复 |
80
57
  | `install-helper info <plugin>` | 查看插件详情 |
81
- | `install-helper lang show` | 显示当前语言 |
82
58
  | `install-helper lang set en_US` | 切换语言 |
83
59
 
84
60
  ## 命令详解
@@ -87,22 +63,13 @@ install-helper install --all --yes
87
63
 
88
64
  ```bash
89
65
  install-helper
90
- # 或
91
- install-helper init
92
66
  ```
93
67
 
94
- 向导会引导你完成:
95
- 1. 选择安装类型(Plugin 完整工作流 / Skill 轻量知识)
96
- 2. 自动检测已安装的 AI 编程工具
97
- 3. 选择安装级别(project / global)
98
- 4. 多选要安装的插件或 Skills(空格切换,回车确认)
99
- 5. 确认并执行安装
100
-
101
- **列表展示**:插件和 Skill 列表均按名称升序排列。光标聚焦某项时,下方会以青色 + 💡 前缀显示该项的详细描述,支持中文自适应换行。
68
+ 向导引导:选择类型(Plugin/Skill)→ 检测工具 → 选择位置 → 选择插件/Skill → 确认安装。
102
69
 
103
- **智能记忆**:向导会记住你上次选择的工具和级别,下次运行无需重新选择。已安装的插件会自动标记并默认不勾选。
70
+ 已安装的插件会自动标记,上次选择的工具和级别会被记住。
104
71
 
105
- ### 安装指定场景
72
+ ### 安装指定插件
106
73
 
107
74
  ```bash
108
75
  install-helper install ops-direct-invoke # 安装单个
@@ -111,42 +78,19 @@ install-helper install ops-direct-invoke --yes # 跳过确认
111
78
  install-helper install ops-direct-invoke --level global # 全局安装
112
79
  ```
113
80
 
114
- **重要说明**:
115
-
116
- 每个插件都有独立的 `AGENTS.md` 配置文件。如果在同一目录下安装多个插件,后安装的会覆盖前一个的配置文件。建议每个项目只安装一个插件,如需使用多个插件,在不同目录下分别安装。
117
-
118
- **示例**:
119
- ```bash
120
- # 项目 A:使用 Kernel 直调
121
- cd project-a
122
- install-helper install ops-direct-invoke --tool opencode
123
-
124
- # 项目 B:使用 Triton
125
- cd project-b
126
- install-helper install triton --tool opencode
127
- ```
128
-
129
- ### 安装单个 Skill(轻量模式)
81
+ > 每个插件有独立的 `AGENTS.md`,建议每个项目只安装一个插件。
130
82
 
131
- 如果只需要让 AI agent 掌握特定领域知识,不需要完整工作流,可以直接安装单个 Skill:
83
+ ### 安装单个 Skill
132
84
 
133
85
  ```bash
134
86
  install-helper install npu-arch # 安装 NPU 架构知识
135
87
  install-helper install ascendc-precision-debug # 安装精度调试技能
136
- install-helper install model-infer-kvcache # 安装 KVCache 优化技能
137
88
  install-helper install --list # 查看所有可用 Skills
138
89
  ```
139
90
 
140
- Skills 按 11 个大类组织(另有「其他」兜底类别):知识与参考、环境与工具、调试与诊断、测试与质量、AscendC 开发、PyPTO 开发、TileLang 开发、Triton 开发、模型推理优化、图模式、平台工具。
141
-
142
- `install` 命令自动识别输入是插件还是 Skill,无需区分。
91
+ `install` 命令自动识别输入是插件还是 Skill。
143
92
 
144
- **交互式批量选择**:运行 `install-helper install`(不带参数)进入交互式选择时,支持以下批量操作:
145
-
146
- - **全选所有 Skills**:类别列表顶部有「全选所有 Skills(共 N 个)」,选中即一键安装全部。
147
- - **全选当前类别**:进入某类别后,顶部有「全选当前类别」,勾选后回车即选中该类别全部 Skills。
148
- - **跨类别累积选择**:选完一个类别后,可选择「继续选择其他类别」,已选 Skills 会保留累积,不丢失。类别列表中实时显示「确认安装(已选 N 个 Skills)」快捷入口,随时可确认安装。
149
- - **单选/多选**:在类别内用空格勾选任意多个 Skills,回车确认。
93
+ 交互式选择时支持:全选所有 Skills、全选当前类别、跨类别累积选择。
150
94
 
151
95
  **选项:**
152
96
 
@@ -154,27 +98,23 @@ Skills 按 11 个大类组织(另有「其他」兜底类别):知识与参
154
98
  |------|------|
155
99
  | `--tool <tool>` | 指定 AI 工具(opencode, claude, trae, cursor, copilot) |
156
100
  | `--level <level>` | 安装级别(project, global),默认 project |
157
- | `--all` `-a` | 安装全部 Skills(一键安装) |
101
+ | `--all` `-a` | 安装全部 Skills |
158
102
  | `--yes` `-y` | 跳过所有确认提示 |
159
103
 
160
- **已装检测**:如果插件已安装,会提示是否覆盖安装。使用 `--yes` 可跳过提示直接覆盖。
161
-
162
- ### 更新已安装的 Skills
104
+ ### 更新
163
105
 
164
106
  ```bash
165
107
  install-helper update # 更新所有已安装插件
166
108
  install-helper update triton # 更新指定插件
167
109
  ```
168
110
 
169
- 更新流程:`git pull` 拉取最新 Skills 仓库 → 重新执行安装脚本 → 软链接自动指向最新内容。
170
-
171
- ### 查看插件详情
111
+ ### 卸载
172
112
 
173
113
  ```bash
174
- install-helper info ops-direct-invoke
114
+ install-helper uninstall ops-direct-invoke --tool opencode
175
115
  ```
176
116
 
177
- 输出插件描述、包含的 Skills/Agents 列表、quickstart 文档路径、安装状态。
117
+ 根据安装记录精确删除所有产物,自动清理空目录。
178
118
 
179
119
  ### 健康检查
180
120
 
@@ -183,44 +123,14 @@ install-helper doctor # 仅检测
183
123
  install-helper doctor --fix # 检测 + 自动修复
184
124
  ```
185
125
 
186
- 检查项目:
187
- - AI 工具安装状态
188
- - 已安装插件状态
189
- - 软链接完整性
190
- - 配置文件存在性
191
-
192
- `--fix` 会自动修复:清理失效软链接、重建缺失目录。
193
-
194
126
  ### 语言管理
195
127
 
196
128
  ```bash
197
129
  install-helper lang show # 显示当前语言
198
- install-helper lang set zh_CN # 设置为中文(默认)
199
- install-helper lang set en_US # 设置为英文
130
+ install-helper lang set en_US # 切换为英文
200
131
  ```
201
132
 
202
- 语言设置保存在 `~/.cannbot/config.yaml`,重启后自动生效。
203
-
204
- ### 卸载
205
-
206
- ```bash
207
- install-helper uninstall ops-direct-invoke --tool opencode
208
- ```
209
-
210
- 卸载时根据安装记录(`~/.cannbot/installs/<plugin>.json`)精确删除所有安装产物:
211
- - Skills 软链接
212
- - Agents 软链接
213
- - Workflows 链接
214
- - 配置文件(AGENTS.md / CLAUDE.md)
215
- - Manifest 文件
216
- - 参考仓库链接(asc-devkit 等)
217
- - 空目录清理
218
-
219
- ## 可用场景
220
-
221
- install-helper 支持 **10 个官方插件** 和 **91 个 Skills**(动态发现,数量可能随仓库更新而变化)。
222
-
223
- #### 官方插件
133
+ ## 可用插件
224
134
 
225
135
  | # | 场景 | ID | 别名 |
226
136
  |---|------|----|------|
@@ -235,77 +145,11 @@ install-helper 支持 **10 个官方插件** 和 **91 个 Skills**(动态发
235
145
  | 9 | torch.compile 图模式 | torch-compile | torch, compile, graph |
236
146
  | 10 | 代码检视 | ops-code-reviewer | code-review, reviewer, review |
237
147
 
238
- #### Skills 类别
239
-
240
- Skills 按 11 个类别组织(另有「其他」兜底类别,动态发现,数量可能随仓库更新而变化):
241
- - 知识与参考
242
- - 环境与工具
243
- - 调试与诊断
244
- - 测试与质量
245
- - AscendC 开发
246
- - PyPTO 开发
247
- - TileLang 开发
248
- - Triton 开发
249
- - 模型推理优化
250
- - 图模式
251
- - 平台工具
252
- - 其他 Skills
253
-
254
- 使用 `install-helper install --list` 查看完整的 Skills 列表。
255
-
256
148
  ## 前置条件
257
149
 
258
150
  - 已安装至少一个 AI 编程工具(OpenCode / Claude Code / Trae / Cursor / GitHub Copilot)
259
151
  - Git(用于克隆 Skills 仓库)
260
152
 
261
- ## 工作原理
262
-
263
- install-helper 是一个编排工具:
264
-
265
- 1. **自动检测**已安装的 AI 编程工具
266
- 2. **动态扫描**仓库中的 SKILL.md 文件,发现可用 Skills
267
- 3. **缓存扫描结果**到 `~/.cannbot/scan-cache.json`(24 小时有效)
268
- 4. **克隆或更新** cannbot-skills 仓库(缓存到 `~/.cannbot/repo/`)
269
- 5. **备份现有配置**(如果检测到已安装的 AGENTS.md)
270
- 6. **声明式安装**:从 `plugins.d/*.yml` 读取安装清单(installSkills/installAgents/configFile/externalRepos),通过 Node.js 原生引擎执行安装(创建 symlink、克隆外部仓库、写 manifest),无需 bash/sh;无安装清单时 fallback 到 `init.sh` 脚本
271
- 7. **追踪**安装状态(`~/.cannbot/config.yaml` + manifest)
272
-
273
- 安装逻辑优先由 manifest 引擎(Node.js 原生,跨平台)负责,install-helper 提供统一的交互式入口和状态管理。
274
-
275
- ## 配置文件
276
-
277
- 配置保存在 `~/.cannbot/` 目录:
278
-
279
- ```yaml
280
- # config.yaml - 用户配置
281
- language: zh_CN # 界面语言
282
- lastTool: opencode # 上次使用的 AI 工具
283
- lastLevel: project # 上次安装级别
284
- installedPlugins: # 已安装的插件列表
285
- - ops-direct-invoke
286
- - pypto-op-orchestrator
287
- ```
288
-
289
- ```json
290
- // scan-cache.json - 扫描缓存(自动生成,24 小时有效)
291
- {
292
- "skills": [...],
293
- "repoCommit": "a1b2c3d4e5f6...",
294
- "timestamp": 1234567890
295
- }
296
- ```
297
-
298
- ```json
299
- // installs/<plugin>.json - 安装记录(每个插件一个文件)
300
- {
301
- "pluginId": "ops-direct-invoke",
302
- "installTime": "2026-06-23T10:00:00Z",
303
- "configRoot": "/path/to/config",
304
- "files": [...],
305
- "directories": [...]
306
- }
307
- ```
308
-
309
153
  ## 开发
310
154
 
311
155
  ```bash
@@ -318,5 +162,3 @@ npm run build # 构建
318
162
  npm link # 全局注册
319
163
  install-helper list # 测试
320
164
  ```
321
-
322
-
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  // ----------------------------------------------------------------------------------------------------------
2
3
  // Copyright (c) 2026 Huawei Technologies Co., Ltd.
3
4
  // This program is free software, you can redistribute it and/or modify it under the terms and conditions of
@@ -8,7 +9,6 @@
8
9
  // See LICENSE in the root of the software repository for the full text of the License.
9
10
  // ----------------------------------------------------------------------------------------------------------
10
11
 
11
- #!/usr/bin/env node
12
12
 
13
13
  const { spawn } = require("child_process");
14
14
  const { existsSync } = require("fs");
@@ -10,7 +10,7 @@
10
10
 
11
11
  # Default configuration for install-helper
12
12
  repository:
13
- url: "https://gitcode.com/yanhf/cann_skills.git"
13
+ url: "https://gitcode.com/cann/cannbot-skills.git"
14
14
  name: "cannbot-skills"
15
15
 
16
16
  scanDirs: