ribo-cli-setup 2.1.0 → 2.3.0
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 +5 -0
- package/bin/cli.js +13 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,6 +20,10 @@ npx ribo-cli-setup --gateway https://gw.ribo.internal --target qwenwork --bin-di
|
|
|
20
20
|
# 仅下载二进制,不自动授权
|
|
21
21
|
npx ribo-cli-setup --skip-auth
|
|
22
22
|
|
|
23
|
+
# 升级:强制重下二进制 + 重新安装技能(不碰 mcp.json)
|
|
24
|
+
npx ribo-cli-setup --upgrade
|
|
25
|
+
npx ribo-cli-setup --upgrade --target qwenwork
|
|
26
|
+
|
|
23
27
|
# 解除注册
|
|
24
28
|
npx ribo-cli-setup --uninstall --target workbuddy
|
|
25
29
|
```
|
|
@@ -50,6 +54,7 @@ RIBO_GATEWAY_URL=https://gw.ribo.internal npx ribo-cli-setup
|
|
|
50
54
|
| `--workbuddy` / `--qwenwork` | target 的快捷写法 |
|
|
51
55
|
| `--bin-dir <dir>` | 二进制安装目录,默认 `~/.local/bin` |
|
|
52
56
|
| `-f, --force` | 忽略本地已有版本,强制重新下载 |
|
|
57
|
+
| `--upgrade` | 升级:强制重下二进制 + 重新安装技能(不碰 mcp.json) |
|
|
53
58
|
| `--skip-auth` | 安装后不自动执行 auth init |
|
|
54
59
|
| `--uninstall` | 解除注册 |
|
|
55
60
|
| `-y, --yes` | 跳过确认 |
|
package/bin/cli.js
CHANGED
|
@@ -25,7 +25,7 @@ const http = require('http');
|
|
|
25
25
|
const crypto = require('crypto');
|
|
26
26
|
const { execFileSync, spawnSync } = require('child_process');
|
|
27
27
|
|
|
28
|
-
const DEFAULT_GATEWAY = 'https://aigc.ribo-group.com/
|
|
28
|
+
const DEFAULT_GATEWAY = 'https://aigc.ribo-group.com/ribo/cli/gateway';
|
|
29
29
|
const BIN_NAME = process.platform === 'win32' ? 'ribo-cli.exe' : 'ribo-cli';
|
|
30
30
|
|
|
31
31
|
// ---------- 参数解析 ----------
|
|
@@ -38,7 +38,7 @@ function parseArgs(argv) {
|
|
|
38
38
|
upgrade: false,
|
|
39
39
|
uninstall: false,
|
|
40
40
|
skipAuth: false,
|
|
41
|
-
yes:
|
|
41
|
+
yes: true,
|
|
42
42
|
help: false,
|
|
43
43
|
};
|
|
44
44
|
for (let i = 0; i < argv.length; i++) {
|
|
@@ -186,7 +186,7 @@ function resolveBinDir(opts) {
|
|
|
186
186
|
if (opts.binDir) return path.resolve(opts.binDir);
|
|
187
187
|
if (process.platform === 'win32') {
|
|
188
188
|
const base = process.env.LOCALAPPDATA || path.join(os.homedir(), 'AppData', 'Local');
|
|
189
|
-
return path.join(base, 'ribo-cli
|
|
189
|
+
return path.join(base, 'ribo-cli');
|
|
190
190
|
}
|
|
191
191
|
return path.join(os.homedir(), '.local', 'bin');
|
|
192
192
|
}
|
|
@@ -218,7 +218,7 @@ async function main() {
|
|
|
218
218
|
const binPath = path.join(binDir, BIN_NAME);
|
|
219
219
|
|
|
220
220
|
console.log('┌─────────────────────────────────────────────┐');
|
|
221
|
-
console.log('│
|
|
221
|
+
console.log('│ 播AI工具(ribo-cli) 管理器 │');
|
|
222
222
|
console.log('└─────────────────────────────────────────────┘');
|
|
223
223
|
console.log(` 平台: ${plat.osName}/${plat.archName}`);
|
|
224
224
|
console.log(` 网关: ${opts.gateway}`);
|
|
@@ -338,15 +338,7 @@ async function main() {
|
|
|
338
338
|
console.log('→ 配置网关地址…');
|
|
339
339
|
run(binPath, ['config', 'set-gateway', opts.gateway]);
|
|
340
340
|
|
|
341
|
-
//
|
|
342
|
-
const tgt = opts.target || (await pickTarget(opts));
|
|
343
|
-
if (!tgt) { console.error('未指定接入目标,已取消(仅完成二进制安装)'); notePathIfMissing(binDir); return; }
|
|
344
|
-
const flag = tgt === 'qwenwork' ? '--qwenwork' : '--workbuddy';
|
|
345
|
-
|
|
346
|
-
console.log(`→ 接入 ${tgt === 'qwenwork' ? '千问办公' : 'WorkBuddy'}…`);
|
|
347
|
-
run(binPath, ['install', flag]);
|
|
348
|
-
|
|
349
|
-
// 实名授权
|
|
341
|
+
// 实名授权(先于技能安装,确保安装时已有有效凭据)
|
|
350
342
|
if (!opts.skipAuth) {
|
|
351
343
|
const doAuth = opts.yes || (await confirm('是否现在执行实名授权(ribo-cli auth init)?', false));
|
|
352
344
|
if (doAuth) {
|
|
@@ -357,6 +349,14 @@ async function main() {
|
|
|
357
349
|
}
|
|
358
350
|
}
|
|
359
351
|
|
|
352
|
+
// 选择接入目标并安装技能
|
|
353
|
+
const tgt = opts.target || (await pickTarget(opts));
|
|
354
|
+
if (!tgt) { console.error('未指定接入目标,已取消(仅完成二进制安装)'); notePathIfMissing(binDir); return; }
|
|
355
|
+
const flag = tgt === 'qwenwork' ? '--qwenwork' : '--workbuddy';
|
|
356
|
+
|
|
357
|
+
console.log(`→ 接入 ${tgt === 'qwenwork' ? '千问办公' : 'WorkBuddy'}…`);
|
|
358
|
+
run(binPath, ['install', flag]);
|
|
359
|
+
|
|
360
360
|
notePathIfMissing(binDir);
|
|
361
361
|
console.log();
|
|
362
362
|
console.log('✓ 全部完成。');
|