aico-cli 0.3.4 → 0.3.5

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.
@@ -13,7 +13,7 @@ import { join as join$1 } from 'node:path';
13
13
  import { join, dirname, basename } from 'pathe';
14
14
  import { fileURLToPath } from 'node:url';
15
15
 
16
- const version = "0.3.4";
16
+ const version = "0.3.5";
17
17
 
18
18
  function displayBanner(subtitle) {
19
19
  const defaultSubtitle = "\u4E00\u952E\u914D\u7F6E\u4F60\u7684\u5F00\u53D1\u73AF\u5883";
@@ -5560,4 +5560,4 @@ async function openSettingsJson() {
5560
5560
  }
5561
5561
  }
5562
5562
 
5563
- export { AICO_CONFIG_FILE as A, getMcpConfigPath as B, CLAUDE_DIR as C, DEFAULT_FILE_COPY_CONFIGS as D, readMcpConfig as E, writeMcpConfig as F, backupMcpConfig as G, mergeMcpServers as H, buildMcpServerConfig as I, fixWindowsMcpConfig as J, addCompletedOnboarding as K, LEGACY_AICO_CONFIG_FILE as L, MCP_SERVICES as M, createEscapablePrompt as N, displayBannerWithInfo as O, executeWithEscapeSupport as P, handleExitPromptError as Q, handleGeneralError as R, SETTINGS_FILE as S, EscapeKeyPressed as T, displayBanner as U, version as V, ConfigCheckerInstaller as W, readAicoConfig as X, init$1 as Y, init as a, getPlatform as b, commandExists as c, importRecommendedEnv as d, importRecommendedPermissions as e, cleanupPermissions as f, getTermuxPrefix as g, mergeAndCleanPermissions as h, isTermux as i, CLAUDE_MD_FILE as j, ClAUDE_CONFIG_FILE as k, SUPPORTED_LANGS as l, messages as m, LANG_LABELS as n, openSettingsJson as o, AI_OUTPUT_LANGUAGES as p, ensureClaudeDir as q, backupExistingConfig as r, copyConfigFiles as s, copyConfigFilesWithConfig as t, configureApi as u, mergeConfigs as v, updateDefaultModel as w, mergeSettingsFile as x, getExistingApiConfig as y, applyAiLanguageDirective as z };
5563
+ export { AICO_CONFIG_FILE as A, getMcpConfigPath as B, CLAUDE_DIR as C, DEFAULT_FILE_COPY_CONFIGS as D, readMcpConfig as E, writeMcpConfig as F, backupMcpConfig as G, mergeMcpServers as H, buildMcpServerConfig as I, fixWindowsMcpConfig as J, addCompletedOnboarding as K, LEGACY_AICO_CONFIG_FILE as L, MCP_SERVICES as M, createEscapablePrompt as N, displayBannerWithInfo as O, executeWithEscapeSupport as P, handleExitPromptError as Q, handleGeneralError as R, SETTINGS_FILE as S, EscapeKeyPressed as T, displayBanner as U, ConfigCheckerInstaller as V, InstallationComposer as W, version as X, readAicoConfig as Y, init$1 as Z, init as a, getPlatform as b, commandExists as c, importRecommendedEnv as d, importRecommendedPermissions as e, cleanupPermissions as f, getTermuxPrefix as g, mergeAndCleanPermissions as h, isTermux as i, CLAUDE_MD_FILE as j, ClAUDE_CONFIG_FILE as k, SUPPORTED_LANGS as l, messages as m, LANG_LABELS as n, openSettingsJson as o, AI_OUTPUT_LANGUAGES as p, ensureClaudeDir as q, backupExistingConfig as r, copyConfigFiles as s, copyConfigFilesWithConfig as t, configureApi as u, mergeConfigs as v, updateDefaultModel as w, mergeSettingsFile as x, getExistingApiConfig as y, applyAiLanguageDirective as z };
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import cac from 'cac';
3
3
  import ansis from 'ansis';
4
- import { N as createEscapablePrompt, O as displayBannerWithInfo, a as init, P as executeWithEscapeSupport, Q as handleExitPromptError, R as handleGeneralError, T as EscapeKeyPressed, U as displayBanner, V as version, W as ConfigCheckerInstaller, X as readAicoConfig } from './chunks/simple-config.mjs';
4
+ import { N as createEscapablePrompt, O as displayBannerWithInfo, a as init, P as executeWithEscapeSupport, Q as handleExitPromptError, R as handleGeneralError, T as EscapeKeyPressed, U as displayBanner, V as ConfigCheckerInstaller, W as InstallationComposer, X as version, Y as readAicoConfig } from './chunks/simple-config.mjs';
5
5
  import inquirer$1 from 'inquirer';
6
6
  import { spawn, exec as exec$1 } from 'node:child_process';
7
7
  import 'tinyexec';
@@ -322,7 +322,41 @@ async function update(options = {}) {
322
322
  if (!options.skipBanner) {
323
323
  displayBanner("Update AICO CLI to latest version");
324
324
  }
325
+ const context = createDefaultContext();
326
+ const checker = new ConfigCheckerInstaller(context);
327
+ const configType = await checker.detectConfigType();
328
+ console.log(ansis.cyan(`\u{1F4CB} \u68C0\u6D4B\u5230\u914D\u7F6E\u7C7B\u578B: ${configType === "company" ? "\u516C\u53F8\u914D\u7F6E" : configType === "personal" ? "\u4E2A\u4EBA\u914D\u7F6E" : "\u65E0\u914D\u7F6E"}`));
325
329
  await updateAicoCli();
330
+ if (configType === "none") {
331
+ console.log(ansis.yellow("\n\u26A0\uFE0F \u672A\u68C0\u6D4B\u5230\u914D\u7F6E\uFF0C\u5C06\u6267\u884C\u521D\u59CB\u5316..."));
332
+ const { init } = await import('./chunks/simple-config.mjs').then(function (n) { return n.Z; });
333
+ await init({
334
+ force: false,
335
+ skipBanner: true,
336
+ skipPrompt: true
337
+ });
338
+ console.log(ansis.green("\u2705 \u521D\u59CB\u5316\u5B8C\u6210\uFF01"));
339
+ } else {
340
+ console.log(ansis.cyan(`\u{1F504} \u66F4\u65B0${configType === "company" ? "\u516C\u53F8" : "\u4E2A\u4EBA"}\u914D\u7F6E\u5185\u5BB9...`));
341
+ try {
342
+ const composer = new InstallationComposer(context);
343
+ if (configType === "company") {
344
+ await composer.installCompanySetup({
345
+ force: true,
346
+ skipPrompt: true
347
+ });
348
+ } else {
349
+ await composer.installPersonalSetup({
350
+ force: true,
351
+ skipPrompt: true
352
+ });
353
+ }
354
+ console.log(ansis.green(`\u2705 ${configType === "company" ? "\u516C\u53F8" : "\u4E2A\u4EBA"}\u914D\u7F6E\u66F4\u65B0\u5B8C\u6210\uFF01`));
355
+ } catch (updateError) {
356
+ console.log(ansis.yellow(`\u26A0\uFE0F \u914D\u7F6E\u66F4\u65B0\u5931\u8D25: ${updateError instanceof Error ? updateError.message : String(updateError)}`));
357
+ console.log(ansis.gray(" \u60A8\u53EF\u4EE5\u7A0D\u540E\u624B\u52A8\u8FD0\u884C\u914D\u7F6E\u66F4\u65B0\u547D\u4EE4"));
358
+ }
359
+ }
326
360
  console.log(ansis.green("\n\u2705 AICO CLI \u66F4\u65B0\u5B8C\u6210\uFF01"));
327
361
  console.log(ansis.gray(" \u60A8\u53EF\u4EE5\u7EE7\u7EED\u4F7F\u7528\u5176\u4ED6\u547D\u4EE4\u914D\u7F6E\u63D0\u793A\u8BCD\u548C\u5DE5\u4F5C\u6D41\u3002"));
328
362
  } catch (error) {
@@ -333,7 +367,7 @@ async function update(options = {}) {
333
367
  }
334
368
 
335
369
  function setupCommands(cli) {
336
- cli.command("", "\u542F\u52A8\u4EE3\u7801\u7F16\u8F91\u5668\uFF08\u9ED8\u8BA4\uFF09").option("--menu", "\u663E\u793A\u4EA4\u4E92\u5F0F\u83DC\u5355").option("--init", "\u521D\u59CB\u5316\u667A\u80FD\u8F6F\u4EF6\u661F\u5DE5\u5382AI\u914D\u7F6E").option("--update", "\u66F4\u65B0\u667A\u80FD\u8F6F\u4EF6\u661F\u5DE5\u5382\u5230\u6700\u65B0\u7248\u672C").option("--company", "\u914D\u7F6E\u516C\u53F8\u914D\u7F6E").option("--personal", "\u914D\u7F6E\u4E2A\u4EBA\u914D\u7F6E").option("--help", "\u663E\u793A\u5E2E\u52A9\u4FE1\u606F").alias("i").alias("u").alias("c").alias("p").alias("h").action(async (options) => {
370
+ cli.command("", "\u542F\u52A8\u4EE3\u7801\u7F16\u8F91\u5668\uFF08\u9ED8\u8BA4\uFF09").option("--menu", "\u663E\u793A\u4EA4\u4E92\u5F0F\u83DC\u5355").option("--init", "\u521D\u59CB\u5316\u667A\u80FD\u8F6F\u4EF6\u661F\u5DE5\u5382AI\u914D\u7F6E").option("--update", "\u66F4\u65B0\u667A\u80FD\u8F6F\u4EF6\u661F\u5DE5\u5382\u5230\u6700\u65B0\u7248\u672C").option("--company", "\u914D\u7F6E\u516C\u53F8\u914D\u7F6E").option("--personal", "\u914D\u7F6E\u4E2A\u4EBA\u914D\u7F6E").option("--help", "\u663E\u793A\u5E2E\u52A9\u4FE1\u606F").action(async (options) => {
337
371
  if (options.menu) {
338
372
  await showMainMenu();
339
373
  } else if (options.init) {
@@ -341,7 +375,7 @@ function setupCommands(cli) {
341
375
  } else if (options.update) {
342
376
  await update({});
343
377
  } else if (options.company) {
344
- const { init: init2 } = await import('./chunks/simple-config.mjs').then(function (n) { return n.Y; });
378
+ const { init: init2 } = await import('./chunks/simple-config.mjs').then(function (n) { return n.Z; });
345
379
  await init2({
346
380
  apiType: "auth_token",
347
381
  force: options.force,
@@ -349,7 +383,7 @@ function setupCommands(cli) {
349
383
  skipPrompt: true
350
384
  });
351
385
  } else if (options.personal) {
352
- const { init: init2 } = await import('./chunks/simple-config.mjs').then(function (n) { return n.Y; });
386
+ const { init: init2 } = await import('./chunks/simple-config.mjs').then(function (n) { return n.Z; });
353
387
  await init2({
354
388
  apiType: "ccr_proxy",
355
389
  force: options.force,
@@ -362,6 +396,33 @@ function setupCommands(cli) {
362
396
  await startCodeEditor();
363
397
  }
364
398
  });
399
+ cli.command("i", "\u5FEB\u901F\u521D\u59CB\u5316\u914D\u7F6E").action(async () => {
400
+ await init({ force: false });
401
+ });
402
+ cli.command("u", "\u5FEB\u901F\u66F4\u65B0").action(async () => {
403
+ await update({});
404
+ });
405
+ cli.command("c", "\u5FEB\u901F\u914D\u7F6E\u516C\u53F8\u8BBE\u7F6E").action(async () => {
406
+ const { init: init2 } = await import('./chunks/simple-config.mjs').then(function (n) { return n.Z; });
407
+ await init2({
408
+ apiType: "auth_token",
409
+ force: false,
410
+ skipBanner: false,
411
+ skipPrompt: true
412
+ });
413
+ });
414
+ cli.command("p", "\u5FEB\u901F\u914D\u7F6E\u4E2A\u4EBA\u8BBE\u7F6E").action(async () => {
415
+ const { init: init2 } = await import('./chunks/simple-config.mjs').then(function (n) { return n.Z; });
416
+ await init2({
417
+ apiType: "ccr_proxy",
418
+ force: false,
419
+ skipBanner: false,
420
+ skipPrompt: true
421
+ });
422
+ });
423
+ cli.command("h", "\u663E\u793A\u5E2E\u52A9\u4FE1\u606F").action(() => {
424
+ cli.outputHelp();
425
+ });
365
426
  cli.help((sections) => customizeHelp(sections));
366
427
  cli.version(version);
367
428
  return cli;
@@ -380,7 +441,7 @@ async function startCodeEditor() {
380
441
  console.log(ansis.yellow(`\u26A0\uFE0F \u68C0\u6D4B\u5230\u65B0\u7248\u672C (\u5F53\u524D: ${version}, \u914D\u7F6E: ${aicoConfig?.version || "\u65E0"})\uFF0C\u5C06\u81EA\u52A8\u5347\u7EA7...`));
381
442
  }
382
443
  if (configType === "company") {
383
- const { init: init2 } = await import('./chunks/simple-config.mjs').then(function (n) { return n.Y; });
444
+ const { init: init2 } = await import('./chunks/simple-config.mjs').then(function (n) { return n.Z; });
384
445
  await init2({
385
446
  apiType: "auth_token",
386
447
  skipBanner: true,
@@ -388,7 +449,7 @@ async function startCodeEditor() {
388
449
  force: true
389
450
  });
390
451
  } else if (configType === "personal") {
391
- const { init: init2 } = await import('./chunks/simple-config.mjs').then(function (n) { return n.Y; });
452
+ const { init: init2 } = await import('./chunks/simple-config.mjs').then(function (n) { return n.Z; });
392
453
  await init2({
393
454
  apiType: "ccr_proxy",
394
455
  skipBanner: true,
@@ -396,7 +457,7 @@ async function startCodeEditor() {
396
457
  force: true
397
458
  });
398
459
  } else {
399
- const { init: init2 } = await import('./chunks/simple-config.mjs').then(function (n) { return n.Y; });
460
+ const { init: init2 } = await import('./chunks/simple-config.mjs').then(function (n) { return n.Z; });
400
461
  await init2({ skipBanner: true, skipPrompt: true });
401
462
  }
402
463
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aico-cli",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "packageManager": "pnpm@9.15.9",
5
5
  "description": "AI CLI",
6
6
  "repository": {
@@ -10,9 +10,9 @@ description: 架构师级软件工程师,以工程卓越为信仰,为追求
10
10
  ## 核心原则
11
11
 
12
12
  - **立即执行** — 禁止只回答不写入文件的情况,重要一定要写入到文件中
13
- - **工具优先** — 优先通过命令行工具进行处理,尽可能的通过多任务并行执行方式进行处理
14
- - **事实确认** — 自行搜集并确认信息来源,不将猜测作为事实陈述
15
- - **优先现有文件** — 优先编辑现有文件而非创建新文件
13
+ - **工具优先** — 优先通过命令行工具进行处理,尽可能使用你的多任务并行执行能力进行处理
14
+ - **事实确认** — 自行搜集并充分的收集信息,不将猜测作为事实陈述
15
+ - **优先现有文件** — 优先编辑现有文件而非创建新文件,用最简洁优雅的解决方案,尽可能少地修改代码。
16
16
 
17
17
  ## 上下文管理
18
18
 
@@ -61,9 +61,8 @@ description: 架构师级软件工程师,以工程卓越为信仰,为追求
61
61
  4. 如果以上条件均不能满足,请使用系统命令,确保完成执行
62
62
 
63
63
  **Chrome DevTools 使用:**
64
- - 优先使用 `mcp__chrome-devtools` 进行浏览器调试和自动化操作
65
- - 支持页面截图、元素交互、网络请求监控等开发调试功能
66
- - 适用于网页内容分析、自动化测试和前端调试场景
64
+ - 自动调用 `mcp__chrome-devtools` 处理网页调试
65
+ - 支持截图、交互、网络监控
67
66
 
68
67
  **图片处理**
69
68
  - 图片处理规范禁止使用你的 read 工具进行读取图片,因为你的读取图片工具失效了。所以请使用mcp server提供的 read_image 工具读取。
@@ -72,41 +71,42 @@ description: 架构师级软件工程师,以工程卓越为信仰,为追求
72
71
 
73
72
  **TODO清单标准流程:**
74
73
  1. **需求分析**
75
- - 清晰完整的复述用户需求,确认理解无误
74
+ - 充分搜索与用户输入内容相关的资源
76
75
  - 明确当前可用工具、环境约束和可用资源
77
- - 系统扫描现有功能库,识别可复用模式,能力以及代码编写风格
76
+ - 扫描功能库,识别复用点
77
+ - 根据充分了解到的信息,清晰完整的复述用户需求
78
78
 
79
79
  2. **场景识别**
80
- - 基于需求分析和资源盘点,定位核心问题关键节点
80
+ - 基于需求分析的内容,找出主要矛盾点,定位核心问题节点
81
81
  - 从系统层面拆解为可执行子任务
82
82
 
83
83
  3. **方案设计**
84
- - 检查并确认完成需求的必要条件是否充分
85
- - 优先基于已有解决方案和相似功能模块进行设计,能复用的尽可能复用
86
- - 输出具体技术实现路径(注明参考来源和复用组件)
87
- - 提供可直接运行的验证脚本/测试用例
84
+ - 确认必要条件
85
+ - 优先复用现有方案,组件,工具方法等,能复用的尽可能复用
86
+ - 输出技术路径(注明复用来源)
87
+ - 扫描项目中使用的测试框架和脚本,生成本次需求的测试脚本
88
88
 
89
89
  4. **执行验证**
90
- - 按方案逐步输出代码/解决方案
91
- - 调用测试脚本验证输出有效性
90
+ - 按方案输出代码
91
+ - 运行测试脚本并修正直到测试脚本全部通过
92
92
 
93
93
  5. **总结反馈**
94
- - 输出最终可落地方案
95
- - 附具体优化建议和改进点
96
- - 标注方案中复用的现有组件及改进点
94
+ - 输出最终方案
95
+ - 附优化建议
96
+ - 标注复用组件
97
97
 
98
- **执行原则:**
99
- - 必须创建TODO清单并实时更新完成状态
100
- - 复杂问题拆分为可执行子任务
101
- - 持续工作直到问题完全解决
102
- - 基于事实分析,充分使用工具收集信息
103
- - 操作前充分规划,理解现有代码再修改
98
+ **执行原则(AI优化版):**
99
+ - 创建并更新TODO清单
100
+ - 拆解复杂问题
101
+ - 持续工作至完成
102
+ - 基于事实分析
103
+ - 规划后再操作
104
104
 
105
105
  ## 专业回答风格
106
106
 
107
107
  ### 语言特征
108
108
  **老朋友语气**
109
- - 使用口头禅:"懂你的意思",像多年技术伙伴一样交流
109
+ - 开场要用:"懂你的意思"
110
110
  - 基于实战经验给出肯定建议,避免模棱两可
111
111
  - 展现深厚技术功底和丰富的项目经验
112
112
  - 语气亲切自然,像坐在旁边的技术搭档