stigmergy 1.2.13 → 1.3.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 (88) hide show
  1. package/README.md +39 -3
  2. package/STIGMERGY.md +3 -0
  3. package/config/builtin-skills.json +43 -0
  4. package/config/enhanced-cli-config.json +438 -0
  5. package/docs/CLI_TOOLS_AGENT_SKILL_ANALYSIS.md +463 -0
  6. package/docs/DESIGN_CLI_HELP_ANALYZER_REFACTOR.md +726 -0
  7. package/docs/ENHANCED_CLI_AGENT_SKILL_CONFIG.md +285 -0
  8. package/docs/IMPLEMENTATION_CHECKLIST_CLI_HELP_ANALYZER_REFACTOR.md +1268 -0
  9. package/docs/INSTALLER_ARCHITECTURE.md +257 -0
  10. package/docs/LESSONS_LEARNED.md +252 -0
  11. package/docs/SPECS_CLI_HELP_ANALYZER_REFACTOR.md +287 -0
  12. package/docs/SUDO_PROBLEM_AND_SOLUTION.md +529 -0
  13. package/docs/correct-skillsio-implementation.md +368 -0
  14. package/docs/development_guidelines.md +276 -0
  15. package/docs/independent-resume-implementation.md +198 -0
  16. package/docs/resumesession-final-implementation.md +195 -0
  17. package/docs/resumesession-usage.md +87 -0
  18. package/package.json +146 -136
  19. package/scripts/analyze-router.js +168 -0
  20. package/scripts/run-comprehensive-tests.js +230 -0
  21. package/scripts/run-quick-tests.js +90 -0
  22. package/scripts/test-runner.js +344 -0
  23. package/skills/resumesession/INDEPENDENT_SKILL.md +403 -0
  24. package/skills/resumesession/README.md +381 -0
  25. package/skills/resumesession/SKILL.md +211 -0
  26. package/skills/resumesession/__init__.py +33 -0
  27. package/skills/resumesession/implementations/simple-resume.js +13 -0
  28. package/skills/resumesession/independent-resume.js +750 -0
  29. package/skills/resumesession/package.json +1 -0
  30. package/skills/resumesession/skill.json +1 -0
  31. package/src/adapters/claude/install_claude_integration.js +9 -1
  32. package/src/adapters/codebuddy/install_codebuddy_integration.js +3 -1
  33. package/src/adapters/codex/install_codex_integration.js +15 -5
  34. package/src/adapters/gemini/install_gemini_integration.js +3 -1
  35. package/src/adapters/qwen/install_qwen_integration.js +3 -1
  36. package/src/cli/commands/autoinstall.js +65 -0
  37. package/src/cli/commands/errors.js +190 -0
  38. package/src/cli/commands/independent-resume.js +395 -0
  39. package/src/cli/commands/install.js +179 -0
  40. package/src/cli/commands/permissions.js +108 -0
  41. package/src/cli/commands/project.js +485 -0
  42. package/src/cli/commands/scan.js +97 -0
  43. package/src/cli/commands/simple-resume.js +377 -0
  44. package/src/cli/commands/skills.js +158 -0
  45. package/src/cli/commands/status.js +113 -0
  46. package/src/cli/commands/stigmergy-resume.js +775 -0
  47. package/src/cli/commands/system.js +301 -0
  48. package/src/cli/commands/universal-resume.js +394 -0
  49. package/src/cli/router-beta.js +471 -0
  50. package/src/cli/utils/environment.js +75 -0
  51. package/src/cli/utils/formatters.js +47 -0
  52. package/src/cli/utils/skills_cache.js +92 -0
  53. package/src/core/cache_cleaner.js +1 -0
  54. package/src/core/cli_adapters.js +345 -0
  55. package/src/core/cli_help_analyzer.js +1236 -680
  56. package/src/core/cli_path_detector.js +702 -709
  57. package/src/core/cli_tools.js +515 -160
  58. package/src/core/coordination/nodejs/CLIIntegrationManager.js +18 -0
  59. package/src/core/coordination/nodejs/HookDeploymentManager.js +242 -412
  60. package/src/core/coordination/nodejs/HookDeploymentManager.refactored.js +323 -0
  61. package/src/core/coordination/nodejs/generators/CLIAdapterGenerator.js +363 -0
  62. package/src/core/coordination/nodejs/generators/ResumeSessionGenerator.js +932 -0
  63. package/src/core/coordination/nodejs/generators/SkillsIntegrationGenerator.js +1395 -0
  64. package/src/core/coordination/nodejs/generators/index.js +12 -0
  65. package/src/core/enhanced_cli_installer.js +1208 -608
  66. package/src/core/enhanced_cli_parameter_handler.js +402 -0
  67. package/src/core/execution_mode_detector.js +222 -0
  68. package/src/core/installer.js +151 -106
  69. package/src/core/local_skill_scanner.js +732 -0
  70. package/src/core/multilingual/language-pattern-manager.js +1 -1
  71. package/src/core/skills/BuiltinSkillsDeployer.js +188 -0
  72. package/src/core/skills/StigmergySkillManager.js +123 -16
  73. package/src/core/skills/embedded-openskills/SkillParser.js +7 -3
  74. package/src/core/smart_router.js +550 -261
  75. package/src/index.js +10 -4
  76. package/src/utils.js +66 -7
  77. package/test/cli-integration.test.js +304 -0
  78. package/test/direct_smart_router_test.js +88 -0
  79. package/test/enhanced-cli-agent-skill-test.js +485 -0
  80. package/test/simple_test.js +82 -0
  81. package/test/smart_router_test_runner.js +123 -0
  82. package/test/smart_routing_edge_cases.test.js +284 -0
  83. package/test/smart_routing_simple_verification.js +139 -0
  84. package/test/smart_routing_verification.test.js +346 -0
  85. package/test/specific-cli-agent-skill-analysis.js +385 -0
  86. package/test/unit/smart_router.test.js +295 -0
  87. package/test/very_simple_test.js +54 -0
  88. package/src/cli/router.js +0 -1783
@@ -0,0 +1,529 @@
1
+ # Stigmergy CLI Sudo 问题详解
2
+
3
+ ## 目录
4
+ 1. [为什么之前需要 sudo](#为什么之前需要-sudo)
5
+ 2. [解决思路](#解决思路)
6
+ 3. [实现逻辑](#实现逻辑)
7
+ 4. [代码分析](#代码分析)
8
+ 5. [对比说明](#对比说明)
9
+
10
+ ---
11
+
12
+ ## 为什么之前需要 sudo?
13
+
14
+ ### 问题根源
15
+
16
+ npm 的全局安装命令 `npm install -g` 默认会将包安装到**系统目录**:
17
+
18
+ ```bash
19
+ # 传统全局安装
20
+ npm install -g @anthropic-ai/claude-code
21
+
22
+ # 安装位置
23
+ /usr/local/lib/node_modules/@anthropic-ai/claude-code/
24
+ /usr/local/bin/claude # 符号链接
25
+ ```
26
+
27
+ **系统目录权限:**
28
+ ```
29
+ drwxr-xr-x root root /usr/local/lib/node_modules/
30
+ drwxr-xr-x root root /usr/local/bin/
31
+ ```
32
+
33
+ 这些目录属于 `root` 用户,普通用户**无法写入**,所以需要 sudo:
34
+
35
+ ```bash
36
+ # ❌ 普通用户执行
37
+ npm install -g @anthropic-ai/claude-code
38
+ # 错误: EACCES: permission denied
39
+
40
+ # ✅ 使用 sudo
41
+ sudo npm install -g @anthropic-ai/claude-code
42
+ # 成功
43
+ ```
44
+
45
+ ### 容器环境的问题
46
+
47
+ 在容器环境中(Docker、Podman等):
48
+
49
+ 1. **通常没有安装 sudo**
50
+ ```bash
51
+ $ which sudo
52
+ # 未找到
53
+ ```
54
+
55
+ 2. **用户不是 root**
56
+ ```bash
57
+ $ whoami
58
+ nodeuser # 普通用户,不是 root
59
+
60
+ $ sudo npm install -g xxx
61
+ # 错误: sudo: command not found
62
+ ```
63
+
64
+ 3. **无法写入系统目录**
65
+ ```bash
66
+ $ npm install -g xxx
67
+ # 错误: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/xxx'
68
+ ```
69
+
70
+ ### Stigmergy 之前的实现
71
+
72
+ **旧代码** (enhanced_cli_installer.js v1.3.1):
73
+
74
+ ```javascript
75
+ async executeUnixElevatedInstallation(toolInfo) {
76
+ // 直接使用 sudo
77
+ const command = `sudo ${toolInfo.install}`;
78
+ // toolInfo.install = "npm install -g @anthropic-ai/claude-code"
79
+
80
+ const result = spawnSync('bash', ['-c', command], {
81
+ stdio: 'inherit',
82
+ timeout: this.options.timeout * 2
83
+ });
84
+
85
+ // 如果 sudo 不存在,直接失败
86
+ if (result.error?.code === 'ENOENT') {
87
+ throw new Error('sudo not found');
88
+ }
89
+ }
90
+ ```
91
+
92
+ **问题:**
93
+ - 只支持 sudo
94
+ - 没有 fallback 机制
95
+ - 在容器环境下直接失败
96
+
97
+ ---
98
+
99
+ ## 解决思路
100
+
101
+ ### 核心思想
102
+
103
+ **将全局包安装到用户目录,而不是系统目录**
104
+
105
+ ### npm 的用户目录安装
106
+
107
+ npm 支持 `--prefix` 参数指定安装目录:
108
+
109
+ ```bash
110
+ # 安装到用户目录
111
+ npm install -g --prefix ~/.npm-global @anthropic-ai/claude-code
112
+
113
+ # 安装位置
114
+ ~/.npm-global/lib/node_modules/@anthropic-ai/claude-code/
115
+ ~/.npm-global/bin/claude # 可执行文件
116
+ ```
117
+
118
+ **用户目录权限:**
119
+ ```
120
+ drwxr-xr-x user user ~/.npm-global/lib/node_modules/
121
+ drwxr-xr-x user user ~/.npm-global/bin/
122
+ ```
123
+
124
+ 这些目录属于当前用户,**不需要 sudo 就可以写入**!
125
+
126
+ ### PATH 配置
127
+
128
+ 安装到用户目录后,需要将 bin 目录添加到 PATH:
129
+
130
+ ```bash
131
+ # 添加到 PATH
132
+ export PATH="~/.npm-global/bin:$PATH"
133
+
134
+ # 现在 shell 可以找到 claude 命令
135
+ $ which claude
136
+ /home/user/.npm-global/bin/claude
137
+
138
+ $ claude --version
139
+ Claude CLI v1.x.x
140
+ ```
141
+
142
+ ### 三层策略
143
+
144
+ ```
145
+ ┌─────────────────────────────────────┐
146
+ │ 尝试检测权限提升工具 │
147
+ │ (sudo, doas, run0, pkexec) │
148
+ └─────────────────┬───────────────────┘
149
+
150
+ ┌───────────┴───────────┐
151
+ │ │
152
+ ▼ ▼
153
+ ┌─────────────┐ ┌─────────────┐
154
+ │ 找到工具 │ │ 未找到工具 │
155
+ │ 使用安装 │ │ 使用用户 │
156
+ │ sudo/doas │ │ 空间安装 │
157
+ └──────┬──────┘ └─────────────┘
158
+
159
+
160
+ ┌─────────────┐
161
+ │ 安装成功? │
162
+ └──────┬──────┘
163
+
164
+ ┌────┴────┐
165
+ │ │
166
+ ▼ ▼
167
+ ┌─────┐ ┌─────────────┐
168
+ │ 是 │ │ 否 │
169
+ └─────┘ │ 使用用户 │
170
+ │ 空间安装 │
171
+ └─────────────┘
172
+ ```
173
+
174
+ ---
175
+
176
+ ## 实现逻辑
177
+
178
+ ### 第一层:权限检测
179
+
180
+ 检测系统上有哪些权限提升工具:
181
+
182
+ ```javascript
183
+ async setupUnixElevatedContext() {
184
+ // 要检测的工具列表(按优先级排序)
185
+ const privilegeEscalationTools = [
186
+ { name: 'sudo', testCmd: 'sudo', testArgs: ['-n', 'true'] },
187
+ { name: 'doas', testCmd: 'doas', testArgs: ['-n', 'true'] },
188
+ { name: 'run0', testCmd: 'run0', testArgs: ['-n', 'true'] },
189
+ { name: 'pkexec', testCmd: 'pkexec', testArgs: ['--help'] },
190
+ ];
191
+
192
+ for (const tool of privilegeEscalationTools) {
193
+ // 尝试运行该工具
194
+ const result = spawnSync(tool.testCmd, tool.testArgs);
195
+
196
+ if (result.status === 0) {
197
+ // 找到且可以无密码运行
198
+ return {
199
+ privilegeTool: tool.name,
200
+ requiresPassword: false
201
+ };
202
+ } else if (result.error?.code !== 'ENOENT') {
203
+ // 找到但需要密码
204
+ return {
205
+ privilegeTool: tool.name,
206
+ requiresPassword: true
207
+ };
208
+ }
209
+ // 否则继续尝试下一个工具
210
+ }
211
+
212
+ // 没有找到任何工具
213
+ return {
214
+ privilegeTool: null,
215
+ userSpaceOnly: true
216
+ };
217
+ }
218
+ ```
219
+
220
+ **检测原理:**
221
+ - `sudo -n true`: `-n` 表示非交互模式,如果不需要密码则返回 0
222
+ - 如果 sudo 不存在,`spawnSync` 返回 `ENOENT` 错误
223
+ - 如果 sudo 存在但需要密码,返回非 0 状态码
224
+
225
+ ### 第二层:使用权限工具安装
226
+
227
+ 如果找到了权限提升工具,使用它安装:
228
+
229
+ ```javascript
230
+ async executeUnixElevatedInstallation(toolInfo) {
231
+ const permissionSetup = await this.setupPermissions();
232
+
233
+ // 如果没有权限工具,直接使用用户空间安装
234
+ if (permissionSetup.userSpaceOnly) {
235
+ return await this.executeUserSpaceInstallation(toolInfo);
236
+ }
237
+
238
+ // 使用检测到的工具(sudo/doas/run0/pkexec)
239
+ const privilegeTool = permissionSetup.privilegeTool;
240
+ const command = `${privilegeTool} ${toolInfo.install}`;
241
+
242
+ const result = spawnSync('bash', ['-c', command]);
243
+
244
+ if (result.status === 0) {
245
+ return { success: true }; // 成功
246
+ } else {
247
+ // 失败,回退到用户空间安装
248
+ return await this.executeUserSpaceInstallation(toolInfo);
249
+ }
250
+ }
251
+ ```
252
+
253
+ ### 第三层:用户空间安装
254
+
255
+ 如果没有权限工具,或者权限工具失败,使用用户空间安装:
256
+
257
+ ```javascript
258
+ async executeUserSpaceInstallation(toolInfo) {
259
+ const os = require('os');
260
+ const path = require('path');
261
+
262
+ // 1. 确定用户目录
263
+ let userNpmDir = process.env.NPM_CONFIG_PREFIX ||
264
+ path.join(os.homedir(), '.npm-global');
265
+
266
+ // 2. 创建目录(如果不存在)
267
+ const fs = require('fs');
268
+ if (!fs.existsSync(userNpmDir)) {
269
+ fs.mkdirSync(userNpmDir, { recursive: true, mode: 0o755 });
270
+ }
271
+
272
+ // 3. 解析包名
273
+ // toolInfo.install = "npm install -g @anthropic-ai/claude-code"
274
+ const installMatch = toolInfo.install.match(/npm\s+(?:install|upgrade)\s+(?:-g\s+)?(.+)/);
275
+ const packageName = installMatch[1].trim(); // "@anthropic-ai/claude-code"
276
+
277
+ // 4. 构建用户空间安装命令
278
+ const userCommand = `npm install -g --prefix "${userNpmDir}" ${packageName}`;
279
+
280
+ // 5. 设置 PATH 环境变量
281
+ const env = {
282
+ ...process.env,
283
+ PATH: `${path.join(userNpmDir, 'bin')}:${process.env.PATH}`
284
+ };
285
+
286
+ // 6. 执行安装
287
+ const result = spawnSync('bash', ['-c', userCommand], {
288
+ env: env,
289
+ timeout: this.options.timeout * 3
290
+ });
291
+
292
+ if (result.status === 0) {
293
+ // 7. 配置 PATH
294
+ const binDir = path.join(userNpmDir, 'bin');
295
+ await this.addPathToShellConfig(binDir);
296
+
297
+ return { success: true, userSpace: true, binDir };
298
+ } else {
299
+ return { success: false, error: 'Installation failed' };
300
+ }
301
+ }
302
+ ```
303
+
304
+ ### PATH 配置
305
+
306
+ 自动将 bin 目录添加到 shell 配置文件:
307
+
308
+ ```javascript
309
+ async addPathToShellConfig(binDir) {
310
+ const shellConfigs = [
311
+ { file: '~/.bashrc', marker: '# Stigmergy CLI PATH' },
312
+ { file: '~/.zshrc', marker: '# Stigmergy CLI PATH' },
313
+ { file: '~/.profile', marker: '# Stigmergy CLI PATH' },
314
+ ];
315
+
316
+ const pathLine = `export PATH="${binDir}:$PATH"\n`;
317
+
318
+ for (const config of shellConfigs) {
319
+ let content = '';
320
+ try {
321
+ content = await fs.readFile(config.file, 'utf8');
322
+ } catch {
323
+ // 文件不存在,会创建
324
+ }
325
+
326
+ // 检查是否已经添加过(避免重复)
327
+ if (content.includes(config.marker)) {
328
+ continue;
329
+ }
330
+
331
+ // 添加 PATH 配置
332
+ await fs.appendFile(config.file, `\n${config.marker}\n${pathLine}`);
333
+ }
334
+ }
335
+ ```
336
+
337
+ **添加的内容:**
338
+ ```bash
339
+ # ~/.bashrc
340
+ # Stigmergy CLI PATH
341
+ export PATH="/home/user/.npm-global/bin:$PATH"
342
+ ```
343
+
344
+ ---
345
+
346
+ ## 代码分析
347
+
348
+ ### 关键文件
349
+
350
+ **src/core/enhanced_cli_installer.js**
351
+
352
+ | 方法 | 行数 | 功能 |
353
+ |------|------|------|
354
+ | `setupUnixElevatedContext()` | 221-285 | 检测权限提升工具 |
355
+ | `executeUnixElevatedInstallation()` | 473-506 | 执行权限提升安装 |
356
+ | `executeUserSpaceInstallation()` | 511-574 | 执行用户空间安装 |
357
+ | `addPathToShellConfig()` | 579-613 | 配置 PATH |
358
+
359
+ ### 数据流图
360
+
361
+ ```
362
+ 用户执行: stigmergy install claude
363
+
364
+ installTool('claude', toolInfo)
365
+
366
+ executeInstallation(toolInfo)
367
+
368
+ executeElevatedInstallation(toolInfo)
369
+
370
+ executeUnixElevatedInstallation(toolInfo)
371
+
372
+ setupPermissions()
373
+
374
+ setupUnixElevatedContext()
375
+
376
+ 检测: sudo? doas? run0? pkexec?
377
+
378
+ ├─ 找到工具 → executeUnixElevatedInstallation()
379
+ │ ↓
380
+ │ 使用该工具安装
381
+ │ ↓
382
+ │ 成功? ─→ 是 → 完成
383
+ │ ↓
384
+ │ 否
385
+ │ ↓
386
+ └─ 未找到/失败 ─────→ executeUserSpaceInstallation()
387
+
388
+ 安装到 ~/.npm-global
389
+
390
+ addPathToShellConfig()
391
+
392
+ 完成
393
+ ```
394
+
395
+ ---
396
+
397
+ ## 对比说明
398
+
399
+ ### 之前 vs 现在
400
+
401
+ | 方面 | 之前 (v1.3.1) | 现在 (v1.3.2) |
402
+ |------|---------------|---------------|
403
+ | **权限检测** | 只支持 sudo | 支持 sudo, doas, run0, pkexec |
404
+ | **容器支持** | ❌ 不支持 | ✅ 完全支持 |
405
+ | **失败处理** | 直接报错 | 自动回退到用户空间安装 |
406
+ | **PATH 配置** | 需要手动配置 | 自动配置 |
407
+ | **用户友好** | ❌ 差 | ✅ 好 |
408
+ | **适用场景** | 有 sudo 的系统 | 任何 Linux/Unix 系统 |
409
+
410
+ ### 安装命令对比
411
+
412
+ **场景 1: Ubuntu Desktop (有密码less sudo)**
413
+
414
+ | 版本 | 命令 | 结果 |
415
+ |------|------|------|
416
+ | v1.3.1 | `sudo npm install -g @anthropic-ai/claude-code` | ✅ 成功 |
417
+ | v1.3.2 | `sudo npm install -g @anthropic-ai/claude-code` | ✅ 成功 (相同) |
418
+
419
+ **场景 2: Docker 容器 (无 sudo)**
420
+
421
+ | 版本 | 命令 | 结果 |
422
+ |------|------|------|
423
+ | v1.3.1 | `sudo npm install -g @anthropic-ai/claude-code` | ❌ 失败: sudo not found |
424
+ | v1.3.2 | `npm install -g --prefix ~/.npm-global @anthropic-ai/claude-code` | ✅ 成功 |
425
+
426
+ **场景 3: Arch Linux (有 doas)**
427
+
428
+ | 版本 | 命令 | 结果 |
429
+ |------|------|------|
430
+ | v1.3.1 | `sudo npm install -g @anthropic-ai/claude-code` | ❌ 失败: sudo not found |
431
+ | v1.3.2 | `doas npm install -g @anthropic-ai/claude-code` | ✅ 成功 |
432
+
433
+ ### 目录结构对比
434
+
435
+ **系统安装 (需要 sudo)**
436
+
437
+ ```
438
+ /usr/local/
439
+ ├── lib/
440
+ │ └── node_modules/
441
+ │ └── @anthropic-ai/
442
+ │ └── claude-code/
443
+ └── bin/
444
+ └── claude -> ../lib/node_modules/@anthropic-ai/claude-code/bin/claude.js
445
+ ```
446
+
447
+ **用户空间安装 (无需 sudo)**
448
+
449
+ ```
450
+ ~/.npm-global/
451
+ ├── lib/
452
+ │ └── node_modules/
453
+ │ └── @anthropic-ai/
454
+ │ └── claude-code/
455
+ └── bin/
456
+ └── claude -> ../lib/node_modules/@anthropic-ai/claude-code/bin/claude.js
457
+ ```
458
+
459
+ **结构完全相同,只是位置不同!**
460
+
461
+ ---
462
+
463
+ ## 总结
464
+
465
+ ### 核心原理
466
+
467
+ 1. **npm 的 -g 参数的本质**:
468
+ ```bash
469
+ npm install -g <package>
470
+ # 等价于
471
+ npm install --prefix $(npm config get prefix) -g <package>
472
+ ```
473
+
474
+ 2. **npm prefix 的默认值**:
475
+ ```bash
476
+ # 系统安装
477
+ npm config get prefix
478
+ # 输出: /usr/local
479
+
480
+ # 用户安装(配置后)
481
+ npm config set prefix ~/.npm-global
482
+ npm config get prefix
483
+ # 输出: /home/user/.npm-global
484
+ ```
485
+
486
+ 3. **--prefix 参数的作用**:
487
+ ```bash
488
+ # 临时改变安装位置
489
+ npm install -g --prefix ~/.npm-global <package>
490
+ # 安装到 ~/.npm-global/lib/node_modules/
491
+ ```
492
+
493
+ ### 为什么这样可以工作?
494
+
495
+ 1. **npm 的设计**:
496
+ - npm 支持自定义安装位置
497
+ - `-g` 只是表示"全局可访问",不是"必须安装到系统目录"
498
+
499
+ 2. **PATH 的作用**:
500
+ - Shell 在 PATH 中查找命令
501
+ - 只要 bin 目录在 PATH 中,任何位置都可以
502
+
503
+ 3. **用户目录的权限**:
504
+ - 用户对自己的 home 目录有完全权限
505
+ - 不需要 root 就可以创建文件和目录
506
+
507
+ ### 最佳实践
508
+
509
+ **推荐配置(一次性设置)**:
510
+
511
+ ```bash
512
+ # 1. 配置 npm 使用用户目录
513
+ npm config set prefix '~/.npm-global'
514
+
515
+ # 2. 添加到 PATH(一次性)
516
+ echo 'export PATH="~/.npm-global/bin:$PATH"' >> ~/.bashrc
517
+ source ~/.bashrc
518
+
519
+ # 3. 现在所有安装都不需要 sudo
520
+ npm install -g @anthropic-ai/claude-code # ✅ 无需 sudo
521
+ npm install -g @google/gemini-cli # ✅ 无需 sudo
522
+ npm install -g @qwen/cli # ✅ 无需 sudo
523
+ ```
524
+
525
+ ---
526
+
527
+ **更新日期**: 2025-12-24
528
+ **版本**: 1.3.2-beta.0
529
+ **作者**: Stigmergy CLI Team