aico-cli 0.1.1 → 0.1.3

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/dist/cli.d.mts CHANGED
@@ -1 +1,6 @@
1
1
 
2
+ declare global {
3
+ interface Array<T> {
4
+ findLastIndex(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): number;
5
+ }
6
+ }
package/dist/cli.d.ts CHANGED
@@ -1 +1,6 @@
1
1
 
2
+ declare global {
3
+ interface Array<T> {
4
+ findLastIndex(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): number;
5
+ }
6
+ }
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 { J as readAicoConfig, K as updateAicoConfig, N as getTranslation, k as AI_OUTPUT_LANGUAGES, O as inquirer, P as addNumbersToChoices, Q as version, q as backupExistingConfig, r as copyConfigFiles, x as applyAiLanguageDirective, R as configureAiPersonality, C as CLAUDE_DIR, I as I18N, T as readCcrConfig, U as isCcrInstalled, V as installCcr, W as configureCcrFeature, X as handleExitPromptError, Y as handleGeneralError, Z as readAicoConfigAsync, _ as COMETIX_COMMANDS, $ as COMETIX_COMMAND_NAME, a0 as installCometixLine, o as openSettingsJson, b as importRecommendedPermissions, a as importRecommendedEnv, a1 as isWindows, z as readMcpConfig, G as fixWindowsMcpConfig, B as writeMcpConfig, a2 as selectMcpServices, D as backupMcpConfig, M as MCP_SERVICES, F as buildMcpServerConfig, a3 as EscapeKeyPressed, E as mergeMcpServers, a4 as displayBanner, a5 as selectAndInstallWorkflows, a6 as displayBannerWithInfo, i as init, a7 as executeWithEscapeSupport, a8 as checkAndUpdateTools } from './shared/aico-cli.BEzpBbNi.mjs';
4
+ import { J as readAicoConfig, K as updateAicoConfig, N as getTranslation, k as AI_OUTPUT_LANGUAGES, O as inquirer, P as addNumbersToChoices, Q as version, q as backupExistingConfig, r as copyConfigFiles, x as applyAiLanguageDirective, R as configureAiPersonality, C as CLAUDE_DIR, I as I18N, T as isWindows, U as readCcrConfig, V as isCcrInstalled, W as installCcr, X as configureCcrFeature, Y as handleExitPromptError, Z as handleGeneralError, _ as readAicoConfigAsync, $ as COMETIX_COMMANDS, a0 as COMETIX_COMMAND_NAME, a1 as installCometixLine, o as openSettingsJson, b as importRecommendedPermissions, a as importRecommendedEnv, z as readMcpConfig, G as fixWindowsMcpConfig, B as writeMcpConfig, a2 as selectMcpServices, D as backupMcpConfig, M as MCP_SERVICES, F as buildMcpServerConfig, a3 as EscapeKeyPressed, E as mergeMcpServers, a4 as displayBanner, a5 as selectAndInstallWorkflows, a6 as displayBannerWithInfo, i as init, a7 as executeWithEscapeSupport, a8 as checkAndUpdateTools } from './shared/aico-cli.Bev0wEf2.mjs';
5
5
  import inquirer$1 from 'inquirer';
6
6
  import { existsSync } from 'node:fs';
7
7
  import { x } from 'tinyexec';
@@ -116,7 +116,8 @@ async function runCcrUi(scriptLang, apiKey) {
116
116
  `));
117
117
  }
118
118
  try {
119
- const { stdout, stderr } = await execAsync$1("ccr ui");
119
+ const ccrCommand = isWindows() ? "npx ccr ui" : "ccr ui";
120
+ const { stdout, stderr } = await execAsync$1(ccrCommand);
120
121
  if (stdout) console.log(stdout);
121
122
  if (stderr) console.error(ansis.yellow(stderr));
122
123
  console.log(ansis.green(`\u2714 ${i18n.ccr.ccrUiStarted}`));
@@ -130,7 +131,8 @@ async function runCcrStatus(scriptLang) {
130
131
  console.log(ansis.cyan(`
131
132
  \u{1F4CA} ${i18n.ccr.checkingCcrStatus}`));
132
133
  try {
133
- const { stdout, stderr } = await execAsync$1("ccr status");
134
+ const ccrCommand = isWindows() ? "npx ccr status" : "ccr status";
135
+ const { stdout, stderr } = await execAsync$1(ccrCommand);
134
136
  if (stdout) {
135
137
  console.log("\n" + ansis.bold(i18n.ccr.ccrStatusTitle));
136
138
  console.log(stdout);
@@ -146,7 +148,8 @@ async function runCcrRestart(scriptLang) {
146
148
  console.log(ansis.cyan(`
147
149
  \u{1F504} ${i18n.ccr.restartingCcr}`));
148
150
  try {
149
- const { stdout, stderr } = await execAsync$1("ccr restart");
151
+ const ccrCommand = isWindows() ? "npx ccr restart" : "ccr restart";
152
+ const { stdout, stderr } = await execAsync$1(ccrCommand);
150
153
  if (stdout) console.log(stdout);
151
154
  if (stderr) console.error(ansis.yellow(stderr));
152
155
  console.log(ansis.green(`\u2714 ${i18n.ccr.ccrRestarted}`));
@@ -160,7 +163,8 @@ async function runCcrStart(scriptLang) {
160
163
  console.log(ansis.cyan(`
161
164
  \u25B6\uFE0F ${i18n.ccr.startingCcr}`));
162
165
  try {
163
- const { stdout, stderr } = await execAsync$1("ccr start");
166
+ const ccrCommand = isWindows() ? "npx ccr start" : "ccr start";
167
+ const { stdout, stderr } = await execAsync$1(ccrCommand);
164
168
  if (stdout) console.log(stdout);
165
169
  if (stderr) console.error(ansis.yellow(stderr));
166
170
  console.log(ansis.green(`\u2714 ${i18n.ccr.ccrStarted}`));
@@ -180,7 +184,8 @@ async function runCcrStop(scriptLang) {
180
184
  console.log(ansis.cyan(`
181
185
  \u23F9\uFE0F ${i18n.ccr.stoppingCcr}`));
182
186
  try {
183
- const { stdout, stderr } = await execAsync$1("ccr stop");
187
+ const ccrCommand = isWindows() ? "npx ccr stop" : "ccr stop";
188
+ const { stdout, stderr } = await execAsync$1(ccrCommand);
184
189
  if (stdout) console.log(stdout);
185
190
  if (stderr) console.error(ansis.yellow(stderr));
186
191
  console.log(ansis.green(`\u2714 ${i18n.ccr.ccrStopped}`));
@@ -906,45 +911,44 @@ async function showMainMenu() {
906
911
  },
907
912
  "2": {
908
913
  key: "2",
909
- labelKey: "startCodeEditor",
910
- processor: () => startClaudeCodeEditor(scriptLang),
914
+ labelKey: "configureCCR",
915
+ processor: () => configureCCR(scriptLang),
911
916
  section: "\u57FA\u7840\u914D\u7F6E"
912
917
  },
913
918
  "3": {
914
919
  key: "3",
915
- labelKey: "updateVersion",
916
- processor: () => updateAicoCli(),
920
+ labelKey: "startCodeEditor",
921
+ processor: () => startClaudeCodeEditor(scriptLang),
917
922
  section: "\u57FA\u7840\u914D\u7F6E"
918
923
  },
919
- // 个性化配置 - 放在后面
920
924
  "4": {
921
925
  key: "4",
922
- labelKey: "configureMcp",
923
- processor: () => configureMcpFeature(scriptLang),
924
- section: "\u4E2A\u6027\u5316\u914D\u7F6E"
926
+ labelKey: "updateVersion",
927
+ processor: () => updateAicoCli(),
928
+ section: "\u57FA\u7840\u914D\u7F6E"
925
929
  },
926
930
  "5": {
927
931
  key: "5",
928
- labelKey: "configureAiMemory",
929
- processor: () => configureAiMemoryFeature(scriptLang),
932
+ labelKey: "configureMcp",
933
+ processor: () => configureMcpFeature(scriptLang),
930
934
  section: "\u4E2A\u6027\u5316\u914D\u7F6E"
931
935
  },
932
936
  "6": {
933
937
  key: "6",
934
- labelKey: "configureEnvPermission",
935
- processor: () => configureEnvPermissionFeature(scriptLang),
938
+ labelKey: "configureAiMemory",
939
+ processor: () => configureAiMemoryFeature(scriptLang),
936
940
  section: "\u4E2A\u6027\u5316\u914D\u7F6E"
937
941
  },
938
942
  "7": {
939
943
  key: "7",
940
- labelKey: "importWorkflow",
941
- processor: () => update({ skipBanner: true }),
944
+ labelKey: "configureEnvPermission",
945
+ processor: () => configureEnvPermissionFeature(scriptLang),
942
946
  section: "\u4E2A\u6027\u5316\u914D\u7F6E"
943
947
  },
944
948
  "8": {
945
949
  key: "8",
946
- labelKey: "configureCCR",
947
- processor: () => configureCCR(scriptLang),
950
+ labelKey: "importWorkflow",
951
+ processor: () => update({ skipBanner: true }),
948
952
  section: "\u4E2A\u6027\u5316\u914D\u7F6E"
949
953
  },
950
954
  "9": {
@@ -1218,6 +1222,25 @@ function customizeHelp(sections) {
1218
1222
  return sections;
1219
1223
  }
1220
1224
 
1225
+ if (!Array.prototype.findLastIndex) {
1226
+ Array.prototype.findLastIndex = function(predicate, thisArg) {
1227
+ if (this == null) {
1228
+ throw new TypeError("Array.prototype.findLastIndex called on null or undefined");
1229
+ }
1230
+ if (typeof predicate !== "function") {
1231
+ throw new TypeError("predicate must be a function");
1232
+ }
1233
+ const array = Object(this);
1234
+ const length = array.length >>> 0;
1235
+ for (let i = length - 1; i >= 0; i--) {
1236
+ if (predicate.call(thisArg, array[i], i, array)) {
1237
+ return i;
1238
+ }
1239
+ }
1240
+ return -1;
1241
+ };
1242
+ }
1243
+
1221
1244
  async function main() {
1222
1245
  const cli = cac("aico");
1223
1246
  setupCommands(cli);
package/dist/index.d.mts CHANGED
@@ -87,7 +87,7 @@ interface InitOptions {
87
87
  skipBanner?: boolean;
88
88
  skipPrompt?: boolean;
89
89
  configAction?: 'new' | 'backup' | 'merge' | 'docs-only' | 'skip';
90
- apiType?: 'auth_token' | 'api_key' | 'ccr_proxy' | 'skip';
90
+ apiType?: 'auth_token' | 'ccr_proxy' | 'skip';
91
91
  apiKey?: string;
92
92
  apiUrl?: string;
93
93
  mcpServices?: string[] | string | boolean;
@@ -110,7 +110,6 @@ declare function installClaudeCode(lang: SupportedLang): Promise<void>;
110
110
  interface ApiConfig {
111
111
  url: string;
112
112
  key: string;
113
- authType?: 'auth_token' | 'api_key';
114
113
  }
115
114
 
116
115
  declare function ensureClaudeDir(): void;
package/dist/index.d.ts CHANGED
@@ -87,7 +87,7 @@ interface InitOptions {
87
87
  skipBanner?: boolean;
88
88
  skipPrompt?: boolean;
89
89
  configAction?: 'new' | 'backup' | 'merge' | 'docs-only' | 'skip';
90
- apiType?: 'auth_token' | 'api_key' | 'ccr_proxy' | 'skip';
90
+ apiType?: 'auth_token' | 'ccr_proxy' | 'skip';
91
91
  apiKey?: string;
92
92
  apiUrl?: string;
93
93
  mcpServices?: string[] | string | boolean;
@@ -110,7 +110,6 @@ declare function installClaudeCode(lang: SupportedLang): Promise<void>;
110
110
  interface ApiConfig {
111
111
  url: string;
112
112
  key: string;
113
- authType?: 'auth_token' | 'api_key';
114
113
  }
115
114
 
116
115
  declare function ensureClaudeDir(): void;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AICO_CONFIG_FILE, k as AI_OUTPUT_LANGUAGES, C as CLAUDE_DIR, e as CLAUDE_MD_FILE, f as ClAUDE_CONFIG_FILE, I as I18N, j as LANG_LABELS, L as LEGACY_AICO_CONFIG_FILE, M as MCP_SERVICES, S as SETTINGS_FILE, h as SUPPORTED_LANGS, H as addCompletedOnboarding, x as applyAiLanguageDirective, q as backupExistingConfig, D as backupMcpConfig, F as buildMcpServerConfig, d as cleanupPermissions, c as commandExists, s as configureApi, r as copyConfigFiles, p as ensureClaudeDir, G as fixWindowsMcpConfig, w as getExistingApiConfig, y as getMcpConfigPath, g as getPlatform, a as importRecommendedEnv, b as importRecommendedPermissions, i as init, n as installClaudeCode, l as isClaudeCodeInstalled, m as mergeAndCleanPermissions, t as mergeConfigs, E as mergeMcpServers, v as mergeSettingsFile, o as openSettingsJson, z as readMcpConfig, u as updateDefaultModel, B as writeMcpConfig } from './shared/aico-cli.BEzpBbNi.mjs';
1
+ export { A as AICO_CONFIG_FILE, k as AI_OUTPUT_LANGUAGES, C as CLAUDE_DIR, e as CLAUDE_MD_FILE, f as ClAUDE_CONFIG_FILE, I as I18N, j as LANG_LABELS, L as LEGACY_AICO_CONFIG_FILE, M as MCP_SERVICES, S as SETTINGS_FILE, h as SUPPORTED_LANGS, H as addCompletedOnboarding, x as applyAiLanguageDirective, q as backupExistingConfig, D as backupMcpConfig, F as buildMcpServerConfig, d as cleanupPermissions, c as commandExists, s as configureApi, r as copyConfigFiles, p as ensureClaudeDir, G as fixWindowsMcpConfig, w as getExistingApiConfig, y as getMcpConfigPath, g as getPlatform, a as importRecommendedEnv, b as importRecommendedPermissions, i as init, n as installClaudeCode, l as isClaudeCodeInstalled, m as mergeAndCleanPermissions, t as mergeConfigs, E as mergeMcpServers, v as mergeSettingsFile, o as openSettingsJson, z as readMcpConfig, u as updateDefaultModel, B as writeMcpConfig } from './shared/aico-cli.Bev0wEf2.mjs';
2
2
  import 'ansis';
3
3
  import 'inquirer';
4
4
  import 'node:fs';
@@ -14,7 +14,7 @@ import ora from 'ora';
14
14
  import { exec } from 'tinyexec';
15
15
  import { rm, mkdir, copyFile as copyFile$1 } from 'node:fs/promises';
16
16
 
17
- const version = "0.1.1";
17
+ const version = "0.1.3";
18
18
 
19
19
  const common$1 = {
20
20
  // Basic
@@ -71,45 +71,39 @@ const installation$1 = {
71
71
 
72
72
  const api$1 = {
73
73
  // Basic API configuration
74
- configureApi: "\u9009\u62E9 API \u8BA4\u8BC1\u65B9\u5F0F",
75
- useAuthToken: "\u4F7F\u7528 Auth Token (OAuth \u8BA4\u8BC1)",
74
+ configureApi: "\u914D\u7F6E API",
75
+ useAuthToken: "\u4F7F\u7528 Auth Token",
76
76
  authTokenDesc: "\u9002\u7528\u4E8E\u901A\u8FC7 OAuth \u6216\u6D4F\u89C8\u5668\u767B\u5F55\u83B7\u53D6\u7684\u4EE4\u724C",
77
- useApiKey: "\u4F7F\u7528 API Key (\u5BC6\u94A5\u8BA4\u8BC1)",
78
- apiKeyDesc: "\u9002\u7528\u4E8E\u4ECE Anthropic Console \u83B7\u53D6\u7684 API \u5BC6\u94A5",
79
77
  useCcrProxy: "\u4F7F\u7528 CCR \u4EE3\u7406",
80
78
  ccrProxyDesc: "\u901A\u8FC7 Claude Code Router \u4F7F\u7528\u591A\u4E2A AI \u6A21\u578B",
81
79
  skipApi: "\u8DF3\u8FC7\uFF08\u7A0D\u540E\u624B\u52A8\u914D\u7F6E\uFF09",
82
80
  enterApiUrl: "\u8BF7\u8F93\u5165 API URL",
83
81
  enterAuthToken: "\u8BF7\u8F93\u5165 Auth Token",
84
- enterApiKey: "\u8BF7\u8F93\u5165 API Key",
85
82
  apiConfigSuccess: "API \u914D\u7F6E\u5B8C\u6210",
86
83
  // API modification
87
84
  existingApiConfig: "\u68C0\u6D4B\u5230\u5DF2\u6709 API \u914D\u7F6E\uFF1A",
88
85
  apiConfigUrl: "URL",
89
- apiConfigKey: "Key",
90
- apiConfigAuthType: "\u8BA4\u8BC1\u7C7B\u578B",
86
+ apiConfigKey: "Auth Token",
91
87
  selectApiAction: "\u8BF7\u9009\u62E9API\u5904\u7406\u64CD\u4F5C",
92
88
  keepExistingConfig: "\u4FDD\u7559\u73B0\u6709\u914D\u7F6E",
93
89
  modifyAllConfig: "\u4FEE\u6539\u5168\u90E8\u914D\u7F6E",
94
90
  modifyPartialConfig: "\u4FEE\u6539\u90E8\u5206\u914D\u7F6E",
95
91
  selectModifyItems: "\u8BF7\u9009\u62E9\u8981\u4FEE\u6539\u7684\u9879",
96
92
  modifyApiUrl: "\u4FEE\u6539 API URL",
97
- modifyApiKey: "\u4FEE\u6539 API Key",
98
- modifyAuthType: "\u4FEE\u6539\u8BA4\u8BC1\u7C7B\u578B",
93
+ modifyApiKey: "\u4FEE\u6539 Auth Token",
99
94
  continueModification: "\u662F\u5426\u7EE7\u7EED\u4FEE\u6539\u5176\u4ED6\u914D\u7F6E\uFF1F",
100
95
  modificationSaved: "\u914D\u7F6E\u5DF2\u4FDD\u5B58",
101
96
  enterNewApiUrl: "\u8BF7\u8F93\u5165\u65B0\u7684 API URL\uFF08\u5F53\u524D\uFF1A{url}\uFF09",
102
- enterNewApiKey: "\u8BF7\u8F93\u5165\u65B0\u7684 API Key\uFF08\u5F53\u524D\uFF1A{key}\uFF09",
103
- selectNewAuthType: "\u9009\u62E9\u65B0\u7684\u8BA4\u8BC1\u7C7B\u578B\uFF08\u5F53\u524D\uFF1A{type}\uFF09",
97
+ enterNewApiKey: "\u8BF7\u8F93\u5165\u65B0\u7684 Auth Token\uFF08\u5F53\u524D\uFF1A{key}\uFF09",
104
98
  // API validation
105
99
  apiKeyValidation: {
106
- empty: "API Key \u4E0D\u80FD\u4E3A\u7A7A",
100
+ empty: "Auth Token \u4E0D\u80FD\u4E3A\u7A7A",
107
101
  example: "\u793A\u4F8B\u683C\u5F0F: sk-abcdef123456_789xyz"
108
102
  },
109
103
  urlRequired: "URL \u4E3A\u5FC5\u586B\u9879",
110
104
  invalidUrl: "\u65E0\u6548\u7684 URL",
111
- keyRequired: "\u5BC6\u94A5\u4E3A\u5FC5\u586B\u9879",
112
- invalidKeyFormat: "\u65E0\u6548\u7684\u5BC6\u94A5\u683C\u5F0F"
105
+ keyRequired: "Auth Token \u4E3A\u5FC5\u586B\u9879",
106
+ invalidKeyFormat: "\u65E0\u6548\u7684 Auth Token \u683C\u5F0F"
113
107
  };
114
108
 
115
109
  const configuration$1 = {
@@ -195,7 +189,7 @@ const menu$1 = {
195
189
  otherTools: "\u5176\u4ED6\u5DE5\u5177"
196
190
  },
197
191
  menuOptions: {
198
- fullInit: "\u5B8C\u6574\u521D\u59CB\u5316\u914D\u7F6E",
192
+ fullInit: "\u542F\u52A8\u516C\u53F8\u914D\u7F6E",
199
193
  importWorkflow: "\u5BFC\u5165\u5DE5\u4F5C\u6D41",
200
194
  configureApiOrCcr: "\u914D\u7F6E API \u6216 CCR \u4EE3\u7406",
201
195
  configureApi: "\u914D\u7F6E API",
@@ -203,15 +197,15 @@ const menu$1 = {
203
197
  configureModel: "\u914D\u7F6E\u9ED8\u8BA4\u6A21\u578B",
204
198
  configureAiMemory: "\u914D\u7F6E\u5168\u5C40\u8BB0\u5FC6",
205
199
  configureEnvPermission: "\u5BFC\u5165\u63A8\u8350\u73AF\u5883\u53D8\u91CF\u548C\u6743\u9650\u914D\u7F6E",
206
- startCodeEditor: "\u542F\u52A8\u4EE3\u7801\u7F16\u8F91",
200
+ startCodeEditor: "\u542F\u52A8\u4EE3\u7801\u7F16\u8F91\u5668",
207
201
  updateVersion: "\u66F4\u65B0\u7248\u672C",
208
- configureCCR: "\u914D\u7F6E\u6A21\u578B\u4EE3\u7406 (CCR)",
202
+ configureCCR: "\u542F\u52A8\u4E2A\u4EBA\u914D\u7F6E",
209
203
  configureCCUsage: "Claude Code \u7528\u91CF\u5206\u6790",
210
- configureCCometixLine: "\u914D\u7F6E CCometixLine",
204
+ configureCCometixLine: "\u914D\u7F6E\u4EE3\u7801\u7F16\u8F91\u5668\u7684\u72B6\u6001\u680F",
211
205
  exit: "\u9000\u51FA"
212
206
  },
213
207
  menuDescriptions: {
214
- fullInit: "\u4F1A\u4E3A\u60A8\u5B89\u88C5Claude Code\u5E76\u5BFC\u5165\u5DE5\u4F5C\u6D41\uFF0C\u4EE5\u53CA\u914D\u7F6E API \u548C\u914D\u7F6E MCP \u670D\u52A1",
208
+ fullInit: "\u4E00\u952E\u4F7F\u7528\u5B8C\u6574\u7684\u516C\u53F8\u914D\u7F6E\u670D\u52A1",
215
209
  importWorkflow: "\u4EC5\u5BFC\u5165/\u66F4\u65B0\u5DE5\u4F5C\u6D41\u76F8\u5173\u6587\u4EF6",
216
210
  configureApiOrCcr: "\u914D\u7F6E API URL\u3001\u8BA4\u8BC1\u4FE1\u606F\u6216 CCR \u4EE3\u7406",
217
211
  configureApi: "\u914D\u7F6E API URL \u548C\u8BA4\u8BC1\u4FE1\u606F",
@@ -219,11 +213,11 @@ const menu$1 = {
219
213
  configureModel: "\u8BBE\u7F6E\u9ED8\u8BA4\u6A21\u578B\uFF08opus/sonnet\uFF09",
220
214
  configureAiMemory: "\u914D\u7F6E AI \u8F93\u51FA\u8BED\u8A00\u548C\u89D2\u8272\u98CE\u683C",
221
215
  configureEnvPermission: "\u5BFC\u5165\u9690\u79C1\u4FDD\u62A4\u73AF\u5883\u53D8\u91CF\u548C\u7CFB\u7EDF\u6743\u9650\u914D\u7F6E",
222
- startCodeEditor: "\u542F\u52A8\u4EE3\u7801\u7F16\u8F91\u5668\u8FDB\u884C\u4EE3\u7801\u5F00\u53D1",
223
- updateVersion: "\u66F4\u65B0 aico-cli \u5230\u6700\u65B0\u7248\u672C",
224
- configureCCR: "\u914D\u7F6E Claude Code Router \u4EE5\u4F7F\u7528\u591A\u4E2A AI \u6A21\u578B",
216
+ startCodeEditor: "\u4E00\u952E\u542F\u52A8\u4EE3\u7801\u7F16\u8F91\u5668\u8FDB\u884C\u4EE3\u7801\u5F00\u53D1",
217
+ updateVersion: "\u66F4\u65B0 \u667A\u80FD\u8F6F\u4EF6\u661F\u5DE5\u5382 \u5230\u6700\u65B0\u7248\u672C",
218
+ configureCCR: "\u4E00\u952E\u914D\u7F6E\u4E2A\u4EBA\u672C\u5730\u6A21\u578B\u914D\u7F6E\u670D\u52A1",
225
219
  configureCCUsage: "\u5206\u6790 Claude Code \u4F7F\u7528\u60C5\u51B5\u548C\u7EDF\u8BA1\u4FE1\u606F",
226
- configureCCometixLine: "\u914D\u7F6E CCometixLine \u72B6\u6001\u884C\u663E\u793A",
220
+ configureCCometixLine: "\u5BF9\u4EE3\u7801\u7F16\u8F91\u5668\u72B6\u6001\u680F\u8FDB\u884C\u914D\u7F6E",
227
221
  exit: "\u9000\u51FA\u7A0B\u5E8F"
228
222
  }
229
223
  };
@@ -330,7 +324,6 @@ const errors$1 = {
330
324
  failedToBackupConfig: "\u5907\u4EFD\u914D\u7F6E\u6587\u4EF6\u5931\u8D25\uFF1A",
331
325
  invalidEnvConfig: "\u65E0\u6548\u7684 env \u914D\u7F6E\uFF1A\u671F\u671B\u5BF9\u8C61",
332
326
  invalidApiUrl: "\u65E0\u6548\u7684 ANTHROPIC_BASE_URL\uFF1A\u671F\u671B\u5B57\u7B26\u4E32",
333
- invalidApiKey: "\u65E0\u6548\u7684 ANTHROPIC_API_KEY\uFF1A\u671F\u671B\u5B57\u7B26\u4E32",
334
327
  invalidAuthToken: "\u65E0\u6548\u7684 ANTHROPIC_AUTH_TOKEN\uFF1A\u671F\u671B\u5B57\u7B26\u4E32",
335
328
  invalidPermissionsConfig: "\u65E0\u6548\u7684\u6743\u9650\u914D\u7F6E\uFF1A\u671F\u671B\u5BF9\u8C61",
336
329
  invalidPermissionsAllow: "\u65E0\u6548\u7684 permissions.allow\uFF1A\u671F\u671B\u6570\u7EC4",
@@ -366,7 +359,7 @@ const ccrMessages$1 = {
366
359
  ccrInstallFailed: "\u5B89\u88C5 Claude Code Router \u5931\u8D25",
367
360
  ccrAlreadyInstalled: "Claude Code Router \u5DF2\u5B89\u88C5",
368
361
  // Configuration
369
- configureCcr: "\u914D\u7F6E\u6A21\u578B\u4EE3\u7406 (CCR)",
362
+ configureCcr: "\u542F\u52A8\u672C\u5730\u4E2A\u4EBA\u914D\u7F6E",
370
363
  useCcrProxy: "\u4F7F\u7528 CCR \u4EE3\u7406",
371
364
  ccrProxyDesc: "\u901A\u8FC7 Claude Code Router \u8FDE\u63A5\u591A\u4E2A AI \u6A21\u578B",
372
365
  fetchingPresets: "\u6B63\u5728\u83B7\u53D6\u63D0\u4F9B\u5546\u9884\u8BBE...",
@@ -399,9 +392,9 @@ const ccrMessages$1 = {
399
392
  ccrRestartFailed: "CCR \u670D\u52A1\u91CD\u542F\u5931\u8D25",
400
393
  // Configuration tips
401
394
  configTips: "\u914D\u7F6E\u63D0\u793A",
402
- useClaudeCommand: "\u8BF7\u4F7F\u7528 claude \u547D\u4EE4\u542F\u52A8 Claude Code\uFF08\u800C\u975E ccr code\uFF09",
403
- advancedConfigTip: "\u60A8\u53EF\u4EE5\u4F7F\u7528 ccr ui \u547D\u4EE4\u8FDB\u884C\u66F4\u9AD8\u7EA7\u7684\u914D\u7F6E",
404
- manualConfigTip: "\u624B\u52A8\u4FEE\u6539\u914D\u7F6E\u6587\u4EF6\u540E\uFF0C\u8BF7\u6267\u884C ccr restart \u4F7F\u914D\u7F6E\u751F\u6548",
395
+ useClaudeCommand: "\u73B0\u5728\u542F\u52A8\u4EE3\u7801\u7F16\u8F91\u5668\u4F7F\u7528\u7684\u662F\u672C\u5730\u6A21\u578B",
396
+ advancedConfigTip: "\u672C\u5730\u6A21\u578B\u7BA1\u7406\u5730\u5740\uFF1Ahttp://127.0.0.1:3456/ui",
397
+ manualConfigTip: "\u624B\u52A8\u4FEE\u6539\u914D\u7F6E\u6587\u4EF6\u540E\uFF0C\u8BF7\u5728\u7EC8\u7AEF\u547D\u4EE4\u884C\u6267\u884C ccr restart \u4F7F\u914D\u7F6E\u751F\u6548",
405
398
  // CCR Menu
406
399
  ccrMenuTitle: "CCR - Claude Code Router \u7BA1\u7406",
407
400
  ccrMenuOptions: {
@@ -437,8 +430,8 @@ const ccrMessages$1 = {
437
430
  ccrNotConfigured: "CCR \u5C1A\u672A\u914D\u7F6E\u3002\u8BF7\u5148\u521D\u59CB\u5316 CCR\u3002",
438
431
  pleaseInitFirst: "\u8BF7\u9009\u62E9\u9009\u9879 1 \u6765\u521D\u59CB\u5316 CCR\u3002",
439
432
  // UI API Key messages
440
- ccrUiApiKey: "CCR UI \u767B\u5F55\u5BC6\u94A5",
441
- ccrUiApiKeyHint: "\u4F7F\u7528\u6B64\u5BC6\u94A5\u767B\u5F55 CCR UI \u754C\u9762"
433
+ ccrUiApiKey: "API\u5BC6\u94A5",
434
+ ccrUiApiKeyHint: "\u5728\u754C\u9762\u8F93\u5165 API \u5BC6\u94A5\u8FDB\u884C\u767B\u5F55"
442
435
  };
443
436
 
444
437
  const cometixMessages$1 = {
@@ -547,45 +540,39 @@ const installation = {
547
540
 
548
541
  const api = {
549
542
  // Basic API configuration
550
- configureApi: "Select API authentication method",
551
- useAuthToken: "Use Auth Token (OAuth authentication)",
543
+ configureApi: "Configure API",
544
+ useAuthToken: "Use Auth Token",
552
545
  authTokenDesc: "For tokens obtained via OAuth or browser login",
553
- useApiKey: "Use API Key (Key authentication)",
554
- apiKeyDesc: "For API keys from Anthropic Console",
555
546
  useCcrProxy: "Use CCR Proxy",
556
547
  ccrProxyDesc: "Use multiple AI models via Claude Code Router",
557
548
  skipApi: "Skip (configure manually later)",
558
549
  enterApiUrl: "Enter API URL",
559
550
  enterAuthToken: "Enter Auth Token",
560
- enterApiKey: "Enter API Key",
561
551
  apiConfigSuccess: "API configured",
562
552
  // API modification
563
553
  existingApiConfig: "Existing API configuration detected:",
564
554
  apiConfigUrl: "URL",
565
- apiConfigKey: "Key",
566
- apiConfigAuthType: "Auth Type",
555
+ apiConfigKey: "Auth Token",
567
556
  selectApiAction: "Select API processing operation",
568
557
  keepExistingConfig: "Keep existing configuration",
569
558
  modifyAllConfig: "Modify all configuration",
570
559
  modifyPartialConfig: "Modify partial configuration",
571
560
  selectModifyItems: "Select items to modify",
572
561
  modifyApiUrl: "Modify API URL",
573
- modifyApiKey: "Modify API Key",
574
- modifyAuthType: "Modify auth type",
562
+ modifyApiKey: "Modify Auth Token",
575
563
  continueModification: "Continue modifying other configurations?",
576
564
  modificationSaved: "Configuration saved",
577
565
  enterNewApiUrl: "Enter new API URL (current: {url})",
578
- enterNewApiKey: "Enter new API Key (current: {key})",
579
- selectNewAuthType: "Select new auth type (current: {type})",
566
+ enterNewApiKey: "Enter new Auth Token (current: {key})",
580
567
  // API validation
581
568
  apiKeyValidation: {
582
- empty: "API Key cannot be empty",
569
+ empty: "Auth Token cannot be empty",
583
570
  example: "Example format: sk-abcdef123456_789xyz"
584
571
  },
585
572
  urlRequired: "URL is required",
586
573
  invalidUrl: "Invalid URL",
587
- keyRequired: "Key is required",
588
- invalidKeyFormat: "Invalid key format"
574
+ keyRequired: "Auth Token is required",
575
+ invalidKeyFormat: "Invalid Auth Token format"
589
576
  };
590
577
 
591
578
  const configuration = {
@@ -806,7 +793,6 @@ const errors = {
806
793
  failedToBackupConfig: "Failed to backup config file:",
807
794
  invalidEnvConfig: "Invalid env configuration: expected object",
808
795
  invalidApiUrl: "Invalid ANTHROPIC_BASE_URL: expected string",
809
- invalidApiKey: "Invalid ANTHROPIC_API_KEY: expected string",
810
796
  invalidAuthToken: "Invalid ANTHROPIC_AUTH_TOKEN: expected string",
811
797
  invalidPermissionsConfig: "Invalid permissions configuration: expected object",
812
798
  invalidPermissionsAllow: "Invalid permissions.allow: expected array",
@@ -1736,13 +1722,10 @@ function configureApi(apiConfig) {
1736
1722
  if (!settings.env) {
1737
1723
  settings.env = {};
1738
1724
  }
1739
- if (apiConfig.authType === "api_key") {
1740
- settings.env.ANTHROPIC_API_KEY = apiConfig.key;
1741
- delete settings.env.ANTHROPIC_AUTH_TOKEN;
1742
- } else if (apiConfig.authType === "auth_token") {
1725
+ if (apiConfig.key) {
1743
1726
  settings.env.ANTHROPIC_AUTH_TOKEN = apiConfig.key;
1744
- delete settings.env.ANTHROPIC_API_KEY;
1745
1727
  }
1728
+ delete settings.env.ANTHROPIC_API_KEY;
1746
1729
  if (apiConfig.url) {
1747
1730
  settings.env.ANTHROPIC_BASE_URL = apiConfig.url;
1748
1731
  }
@@ -1822,23 +1805,14 @@ function getExistingApiConfig() {
1822
1805
  if (!settings || !settings.env) {
1823
1806
  return null;
1824
1807
  }
1825
- const { ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL } = settings.env;
1826
- if (!ANTHROPIC_BASE_URL && !ANTHROPIC_API_KEY && !ANTHROPIC_AUTH_TOKEN) {
1808
+ const { ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL } = settings.env;
1809
+ if (!ANTHROPIC_BASE_URL && !ANTHROPIC_AUTH_TOKEN) {
1827
1810
  return null;
1828
1811
  }
1829
- let authType;
1830
- let key;
1831
- if (ANTHROPIC_AUTH_TOKEN) {
1832
- authType = "auth_token";
1833
- key = ANTHROPIC_AUTH_TOKEN;
1834
- } else if (ANTHROPIC_API_KEY) {
1835
- authType = "api_key";
1836
- key = ANTHROPIC_API_KEY;
1837
- }
1812
+ const key = ANTHROPIC_AUTH_TOKEN;
1838
1813
  return {
1839
1814
  url: ANTHROPIC_BASE_URL || "",
1840
- key: key || "",
1841
- authType
1815
+ key: key || ""
1842
1816
  };
1843
1817
  }
1844
1818
  function applyAiLanguageDirective(aiOutputLang) {
@@ -2048,7 +2022,7 @@ async function configureCcrProxy(ccrConfig) {
2048
2022
  settings.env = {};
2049
2023
  }
2050
2024
  settings.env.ANTHROPIC_BASE_URL = `http://${host}:${port}`;
2051
- settings.env.ANTHROPIC_API_KEY = apiKey;
2025
+ settings.env.ANTHROPIC_AUTH_TOKEN = apiKey;
2052
2026
  writeJsonConfig(SETTINGS_FILE, settings);
2053
2027
  }
2054
2028
  async function selectCcrPreset(scriptLang) {
@@ -5205,11 +5179,13 @@ const execAsync$1 = promisify(exec$1);
5205
5179
  async function isCcrInstalled() {
5206
5180
  let commandExists = false;
5207
5181
  try {
5208
- await execAsync$1("ccr version");
5182
+ const ccrCommand = isWindows() ? "npx ccr version" : "ccr version";
5183
+ await execAsync$1(ccrCommand);
5209
5184
  commandExists = true;
5210
5185
  } catch {
5211
5186
  try {
5212
- await execAsync$1("which ccr");
5187
+ const whichCommand = isWindows() ? "where ccr" : "which ccr";
5188
+ await execAsync$1(whichCommand);
5213
5189
  commandExists = true;
5214
5190
  } catch {
5215
5191
  commandExists = false;
@@ -5499,7 +5475,13 @@ async function selectMcpServices(scriptLang) {
5499
5475
  type: "checkbox",
5500
5476
  name: "services",
5501
5477
  message: `${i18n.mcp.selectMcpServices}${i18n.common.multiSelectHint}`,
5502
- choices
5478
+ choices: choices.map((choice) => ({
5479
+ ...choice,
5480
+ checked: true
5481
+ //Default built choices with All option
5482
+ }))
5483
+ // Build choices without ALL option
5484
+ //choices,
5503
5485
  });
5504
5486
  return services;
5505
5487
  } catch (error) {
@@ -5811,8 +5793,7 @@ async function init(options = {}) {
5811
5793
  } else {
5812
5794
  apiConfig = {
5813
5795
  url: "http://11.0.166.20:13456",
5814
- key: "sk-4730d06849b5fea00f551bd60a0902e1",
5815
- authType: "auth_token"
5796
+ key: "sk-4730d06849b5fea00f551bd60a0902e1"
5816
5797
  };
5817
5798
  console.log(ansis.green(`\u2714 \u4F7F\u7528\u9884\u914D\u7F6EAPI\u4FE1\u606F`));
5818
5799
  }
@@ -6046,4 +6027,4 @@ async function openSettingsJson() {
6046
6027
  }
6047
6028
  }
6048
6029
 
6049
- export { COMETIX_COMMAND_NAME as $, AICO_CONFIG_FILE as A, writeMcpConfig as B, CLAUDE_DIR as C, backupMcpConfig as D, mergeMcpServers as E, buildMcpServerConfig as F, fixWindowsMcpConfig as G, addCompletedOnboarding as H, I18N as I, readAicoConfig as J, updateAicoConfig as K, LEGACY_AICO_CONFIG_FILE as L, MCP_SERVICES as M, getTranslation as N, inquirer as O, addNumbersToChoices as P, version as Q, configureAiPersonality as R, SETTINGS_FILE as S, readCcrConfig as T, isCcrInstalled as U, installCcr as V, configureCcrFeature as W, handleExitPromptError as X, handleGeneralError as Y, readAicoConfigAsync as Z, COMETIX_COMMANDS as _, importRecommendedEnv as a, installCometixLine as a0, isWindows as a1, selectMcpServices as a2, EscapeKeyPressed as a3, displayBanner as a4, selectAndInstallWorkflows as a5, displayBannerWithInfo as a6, executeWithEscapeSupport as a7, checkAndUpdateTools as a8, importRecommendedPermissions as b, commandExists as c, cleanupPermissions as d, CLAUDE_MD_FILE as e, ClAUDE_CONFIG_FILE as f, getPlatform as g, SUPPORTED_LANGS as h, init as i, LANG_LABELS as j, AI_OUTPUT_LANGUAGES as k, isClaudeCodeInstalled as l, mergeAndCleanPermissions as m, installClaudeCode as n, openSettingsJson as o, ensureClaudeDir as p, backupExistingConfig as q, copyConfigFiles as r, configureApi as s, mergeConfigs as t, updateDefaultModel as u, mergeSettingsFile as v, getExistingApiConfig as w, applyAiLanguageDirective as x, getMcpConfigPath as y, readMcpConfig as z };
6030
+ export { COMETIX_COMMANDS as $, AICO_CONFIG_FILE as A, writeMcpConfig as B, CLAUDE_DIR as C, backupMcpConfig as D, mergeMcpServers as E, buildMcpServerConfig as F, fixWindowsMcpConfig as G, addCompletedOnboarding as H, I18N as I, readAicoConfig as J, updateAicoConfig as K, LEGACY_AICO_CONFIG_FILE as L, MCP_SERVICES as M, getTranslation as N, inquirer as O, addNumbersToChoices as P, version as Q, configureAiPersonality as R, SETTINGS_FILE as S, isWindows as T, readCcrConfig as U, isCcrInstalled as V, installCcr as W, configureCcrFeature as X, handleExitPromptError as Y, handleGeneralError as Z, readAicoConfigAsync as _, importRecommendedEnv as a, COMETIX_COMMAND_NAME as a0, installCometixLine as a1, selectMcpServices as a2, EscapeKeyPressed as a3, displayBanner as a4, selectAndInstallWorkflows as a5, displayBannerWithInfo as a6, executeWithEscapeSupport as a7, checkAndUpdateTools as a8, importRecommendedPermissions as b, commandExists as c, cleanupPermissions as d, CLAUDE_MD_FILE as e, ClAUDE_CONFIG_FILE as f, getPlatform as g, SUPPORTED_LANGS as h, init as i, LANG_LABELS as j, AI_OUTPUT_LANGUAGES as k, isClaudeCodeInstalled as l, mergeAndCleanPermissions as m, installClaudeCode as n, openSettingsJson as o, ensureClaudeDir as p, backupExistingConfig as q, copyConfigFiles as r, configureApi as s, mergeConfigs as t, updateDefaultModel as u, mergeSettingsFile as v, getExistingApiConfig as w, applyAiLanguageDirective as x, getMcpConfigPath as y, readMcpConfig as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aico-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "packageManager": "pnpm@9.15.9",
5
5
  "description": "AI CLI",
6
6
  "repository": {
@@ -39,7 +39,7 @@
39
39
  "cac": "^6.7.14",
40
40
  "dayjs": "^1.11.13",
41
41
  "find-up-simple": "^1.0.1",
42
- "inquirer": "^12.9.0",
42
+ "inquirer": "^12.9.3",
43
43
  "ora": "^8.2.0",
44
44
  "pathe": "^2.0.3",
45
45
  "tinyexec": "^1.0.1"
@@ -49,8 +49,8 @@ description: '专业AI编程助手,提供结构化六阶段开发工作流(
49
49
 
50
50
  # MCP 服务
51
51
 
52
- 1. 如果用户输入的存在图片,调用`intention-coding`的图片内容理解智能体先识别图片的内容。
53
- 2. 如果用户让搜索某个网址的内容,调用`exa`去获取 URL 的内容
52
+ 1. 如果用户输入的存在图片,调用`intention-coding`中的图片内容理解智能体取识别图片的内容。
53
+ 2. 如果用户让搜索某个网址的内容,调用`exa`去获取 爬取 URL 里的内容
54
54
 
55
55
  ---
56
56