ribo-cli-setup 2.4.0 → 2.4.1

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.
Files changed (2) hide show
  1. package/bin/cli.js +20 -2
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -11,6 +11,7 @@
11
11
  * npx ribo-cli-setup --upgrade # 升级:强制重下二进制 + 重新安装技能(不碰 mcp.json)
12
12
  * npx ribo-cli-setup --uninstall # 解除注册
13
13
  * npx ribo-cli-setup --auth # 独立执行实名授权(需已安装 ribo-cli)
14
+ * npx ribo-cli-setup --doctor # 健康状态诊断(需已安装 ribo-cli)
14
15
  *
15
16
  * 环境变量:RIBO_GATEWAY_URL 可替代 --gateway
16
17
  * 流程:检测 os/arch → 拉 /download/manifest → 匹配平台二进制 → 下载校验 sha256
@@ -39,6 +40,7 @@ function parseArgs(argv) {
39
40
  upgrade: false,
40
41
  uninstall: false,
41
42
  auth: false,
43
+ doctor: false,
42
44
  skipAuth: false,
43
45
  yes: true,
44
46
  help: false,
@@ -55,6 +57,7 @@ function parseArgs(argv) {
55
57
  case '--upgrade': opts.upgrade = true; break;
56
58
  case '--uninstall': opts.uninstall = true; break;
57
59
  case '--auth': opts.auth = true; break;
60
+ case '--doctor': opts.doctor = true; break;
58
61
  case '--skip-auth': opts.skipAuth = true; break;
59
62
  case '--yes': case '-y': opts.yes = true; break;
60
63
  case '--help': case '-h': opts.help = true; break;
@@ -72,8 +75,10 @@ function parseArgs(argv) {
72
75
  console.error(`--upgrade 与 --uninstall 不能同时使用`);
73
76
  process.exit(2);
74
77
  }
75
- if (opts.auth && (opts.upgrade || opts.uninstall)) {
76
- console.error(`--auth 不能与 --upgrade/--uninstall 同时使用`);
78
+ const exclusive = ['upgrade', 'uninstall', 'auth', 'doctor'];
79
+ const active = exclusive.filter((k) => opts[k]);
80
+ if (active.length > 1) {
81
+ console.error(`--${active.join('/--')} 不能同时使用`);
77
82
  process.exit(2);
78
83
  }
79
84
  return opts;
@@ -95,6 +100,7 @@ function printHelp() {
95
100
  -f, --force 忽略本地已有版本,强制重新下载
96
101
  --upgrade 升级:强制重下二进制 + 重新安装技能(不碰 mcp.json)
97
102
  --auth 独立执行实名授权(需已安装 ribo-cli)
103
+ --doctor 健康状态诊断(需已安装 ribo-cli)
98
104
  --skip-auth 安装后不自动执行 auth init
99
105
  --uninstall 解除注册(移除 mcp.json 条目与 Skill 包)
100
106
  -y, --yes 跳过所有确认
@@ -245,6 +251,18 @@ async function main() {
245
251
  return;
246
252
  }
247
253
 
254
+ // 健康诊断分支:仅执行 doctor,不拉清单、不下载
255
+ if (opts.doctor) {
256
+ if (!fs.existsSync(binPath)) {
257
+ console.error(`✗ 未找到 ${binPath}`);
258
+ console.error(` 请先执行 npx ribo-cli-setup 安装 ribo-cli`);
259
+ process.exit(1);
260
+ }
261
+ console.log('→ 执行健康状态诊断…');
262
+ runInteractive(binPath, ['doctor']);
263
+ return;
264
+ }
265
+
248
266
  // 拉取清单
249
267
  let manifest;
250
268
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ribo-cli-setup",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "ribo-cli 一键安装器:检测操作系统与 CPU 架构,从 ribo 网关下载对应平台 CLI 二进制,完成 WorkBuddy / 千问办公接入与实名授权",
5
5
  "bin": {
6
6
  "ribo-cli-setup": "bin/cli.js"