ccjk 5.2.0 → 5.2.2
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/chunks/api.mjs +6 -6
- package/dist/chunks/auto-updater.mjs +80 -133
- package/dist/chunks/ccm.mjs +7 -7
- package/dist/chunks/ccr.mjs +7 -4
- package/dist/chunks/ccu.mjs +6 -6
- package/dist/chunks/check-updates.mjs +3 -3
- package/dist/chunks/claude-code-incremental-manager.mjs +38 -38
- package/dist/chunks/cloud-v5.mjs +1651 -0
- package/dist/chunks/codex.mjs +70 -70
- package/dist/chunks/commands.mjs +25 -25
- package/dist/chunks/commit.mjs +16 -16
- package/dist/chunks/config-consolidator.mjs +9 -9
- package/dist/chunks/config-switch.mjs +39 -39
- package/dist/chunks/config.mjs +5 -5
- package/dist/chunks/config2.mjs +85 -85
- package/dist/chunks/context.mjs +2 -2
- package/dist/chunks/doctor.mjs +31 -31
- package/dist/chunks/features.mjs +84 -83
- package/dist/chunks/help.mjs +116 -116
- package/dist/chunks/index4.mjs +46 -46
- package/dist/chunks/init.mjs +214 -191
- package/dist/chunks/interview.mjs +102 -102
- package/dist/chunks/manager.mjs +238 -0
- package/dist/chunks/marketplace.mjs +59 -59
- package/dist/chunks/mcp.mjs +82 -82
- package/dist/chunks/menu.mjs +441 -379
- package/dist/chunks/notification.mjs +112 -112
- package/dist/chunks/onboarding.mjs +7 -7
- package/dist/chunks/package.mjs +1 -1
- package/dist/chunks/permission-manager.mjs +8 -8
- package/dist/chunks/plugin.mjs +100 -100
- package/dist/chunks/prompts.mjs +15 -15
- package/dist/chunks/providers.mjs +65 -65
- package/dist/chunks/session.mjs +83 -83
- package/dist/chunks/skills-sync.mjs +72 -72
- package/dist/chunks/skills.mjs +88 -88
- package/dist/chunks/team.mjs +6 -6
- package/dist/chunks/uninstall.mjs +35 -35
- package/dist/chunks/update.mjs +6 -6
- package/dist/chunks/upgrade-manager.mjs +4 -4
- package/dist/chunks/workflows2.mjs +13 -13
- package/dist/cli.mjs +21 -0
- package/dist/i18n/locales/en/menu.json +16 -1
- package/dist/i18n/locales/en/skills.json +29 -0
- package/dist/i18n/locales/zh-CN/menu.json +16 -1
- package/dist/i18n/locales/zh-CN/skills.json +29 -0
- package/dist/index.mjs +4 -4
- package/dist/shared/{ccjk.f40us0yY.mjs → ccjk.BiJujy5w.mjs} +4 -4
- package/dist/shared/{ccjk.CQzwtnZ1.mjs → ccjk.C_3BYaWc.mjs} +50 -50
- package/dist/shared/{ccjk.Zwx-YR_P.mjs → ccjk.DjD9Rzxq.mjs} +32 -32
- package/dist/shared/{ccjk.DtWIPt8E.mjs → ccjk.XgW1H2t3.mjs} +68 -68
- package/dist/shared/{ccjk.BlPCiSHj.mjs → ccjk.tI4PJA0c.mjs} +30 -30
- package/package.json +3 -3
package/dist/chunks/config2.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import process__default from 'node:process';
|
|
3
|
-
import
|
|
3
|
+
import ansis__default from 'ansis';
|
|
4
4
|
import inquirer from 'inquirer';
|
|
5
5
|
import { getApiProviderPresets } from './api-providers.mjs';
|
|
6
6
|
import { SETTINGS_FILE } from './constants.mjs';
|
|
@@ -24,14 +24,14 @@ async function getConfig(key, options = {}) {
|
|
|
24
24
|
try {
|
|
25
25
|
const config = readClaudeConfig();
|
|
26
26
|
if (!config) {
|
|
27
|
-
console.log(
|
|
28
|
-
console.log(
|
|
27
|
+
console.log(ansis__default.yellow(isZh ? "\u26A0\uFE0F \u914D\u7F6E\u6587\u4EF6\u4E0D\u5B58\u5728" : "\u26A0\uFE0F Configuration file not found"));
|
|
28
|
+
console.log(ansis__default.dim(isZh ? '\u8FD0\u884C "ccjk init" \u521D\u59CB\u5316\u914D\u7F6E' : 'Run "ccjk init" to initialize configuration'));
|
|
29
29
|
console.log("");
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
32
|
const value = getNestedValue(config, key);
|
|
33
33
|
if (value === void 0) {
|
|
34
|
-
console.log(
|
|
34
|
+
console.log(ansis__default.yellow(isZh ? `\u26A0\uFE0F \u914D\u7F6E\u9879 "${key}" \u4E0D\u5B58\u5728` : `\u26A0\uFE0F Configuration key "${key}" not found`));
|
|
35
35
|
console.log("");
|
|
36
36
|
return;
|
|
37
37
|
}
|
|
@@ -39,16 +39,16 @@ async function getConfig(key, options = {}) {
|
|
|
39
39
|
console.log(JSON.stringify(value, null, 2));
|
|
40
40
|
} else {
|
|
41
41
|
console.log("");
|
|
42
|
-
console.log(
|
|
43
|
-
console.log(
|
|
42
|
+
console.log(ansis__default.bold.cyan(isZh ? `\u{1F4CB} \u914D\u7F6E\u9879: ${key}` : `\u{1F4CB} Configuration: ${key}`));
|
|
43
|
+
console.log(ansis__default.dim("\u2500".repeat(60)));
|
|
44
44
|
console.log("");
|
|
45
45
|
displayValue(value, 0);
|
|
46
46
|
console.log("");
|
|
47
47
|
}
|
|
48
48
|
} catch (error) {
|
|
49
|
-
console.error(
|
|
49
|
+
console.error(ansis__default.red(isZh ? "\u274C \u8BFB\u53D6\u914D\u7F6E\u5931\u8D25" : "\u274C Failed to read configuration"));
|
|
50
50
|
if (error instanceof Error) {
|
|
51
|
-
console.error(
|
|
51
|
+
console.error(ansis__default.dim(error.message));
|
|
52
52
|
}
|
|
53
53
|
console.log("");
|
|
54
54
|
}
|
|
@@ -58,14 +58,14 @@ async function setConfig(key, value, _options = {}) {
|
|
|
58
58
|
try {
|
|
59
59
|
const config = readClaudeConfig();
|
|
60
60
|
if (!config) {
|
|
61
|
-
console.log(
|
|
62
|
-
console.log(
|
|
61
|
+
console.log(ansis__default.yellow(isZh ? "\u26A0\uFE0F \u914D\u7F6E\u6587\u4EF6\u4E0D\u5B58\u5728" : "\u26A0\uFE0F Configuration file not found"));
|
|
62
|
+
console.log(ansis__default.dim(isZh ? '\u8FD0\u884C "ccjk init" \u521D\u59CB\u5316\u914D\u7F6E' : 'Run "ccjk init" to initialize configuration'));
|
|
63
63
|
console.log("");
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
66
|
const backupPath = backupExistingConfig();
|
|
67
67
|
if (backupPath) {
|
|
68
|
-
console.log(
|
|
68
|
+
console.log(ansis__default.dim(isZh ? `\u{1F4E6} \u5DF2\u5907\u4EFD\u914D\u7F6E\u5230: ${backupPath}` : `\u{1F4E6} Configuration backed up to: ${backupPath}`));
|
|
69
69
|
}
|
|
70
70
|
let parsedValue = value;
|
|
71
71
|
try {
|
|
@@ -75,15 +75,15 @@ async function setConfig(key, value, _options = {}) {
|
|
|
75
75
|
setNestedValue(config, key, parsedValue);
|
|
76
76
|
writeClaudeConfig(config);
|
|
77
77
|
console.log("");
|
|
78
|
-
console.log(
|
|
78
|
+
console.log(ansis__default.green(isZh ? `\u2705 \u914D\u7F6E\u9879 "${key}" \u5DF2\u66F4\u65B0` : `\u2705 Configuration "${key}" updated`));
|
|
79
79
|
console.log("");
|
|
80
|
-
console.log(
|
|
80
|
+
console.log(ansis__default.bold(isZh ? "\u65B0\u503C:" : "New value:"));
|
|
81
81
|
displayValue(parsedValue, 0);
|
|
82
82
|
console.log("");
|
|
83
83
|
} catch (error) {
|
|
84
|
-
console.error(
|
|
84
|
+
console.error(ansis__default.red(isZh ? "\u274C \u8BBE\u7F6E\u914D\u7F6E\u5931\u8D25" : "\u274C Failed to set configuration"));
|
|
85
85
|
if (error instanceof Error) {
|
|
86
|
-
console.error(
|
|
86
|
+
console.error(ansis__default.dim(error.message));
|
|
87
87
|
}
|
|
88
88
|
console.log("");
|
|
89
89
|
}
|
|
@@ -93,8 +93,8 @@ async function listConfig(options = {}) {
|
|
|
93
93
|
try {
|
|
94
94
|
const config = readClaudeConfig();
|
|
95
95
|
if (!config) {
|
|
96
|
-
console.log(
|
|
97
|
-
console.log(
|
|
96
|
+
console.log(ansis__default.yellow(isZh ? "\u26A0\uFE0F \u914D\u7F6E\u6587\u4EF6\u4E0D\u5B58\u5728" : "\u26A0\uFE0F Configuration file not found"));
|
|
97
|
+
console.log(ansis__default.dim(isZh ? '\u8FD0\u884C "ccjk init" \u521D\u59CB\u5316\u914D\u7F6E' : 'Run "ccjk init" to initialize configuration'));
|
|
98
98
|
console.log("");
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
@@ -103,8 +103,8 @@ async function listConfig(options = {}) {
|
|
|
103
103
|
return;
|
|
104
104
|
}
|
|
105
105
|
console.log("");
|
|
106
|
-
console.log(
|
|
107
|
-
console.log(
|
|
106
|
+
console.log(ansis__default.bold.cyan(isZh ? "\u{1F4CB} Claude Code \u914D\u7F6E" : "\u{1F4CB} Claude Code Configuration"));
|
|
107
|
+
console.log(ansis__default.dim("\u2500".repeat(60)));
|
|
108
108
|
console.log("");
|
|
109
109
|
displayConfigSection(isZh ? "API \u914D\u7F6E" : "API Configuration", {
|
|
110
110
|
baseUrl: config.baseUrl,
|
|
@@ -126,13 +126,13 @@ async function listConfig(options = {}) {
|
|
|
126
126
|
}, isZh);
|
|
127
127
|
}
|
|
128
128
|
console.log("");
|
|
129
|
-
console.log(
|
|
130
|
-
console.log(
|
|
129
|
+
console.log(ansis__default.dim("\u2500".repeat(60)));
|
|
130
|
+
console.log(ansis__default.dim(isZh ? `\u914D\u7F6E\u6587\u4EF6: ${SETTINGS_FILE}` : `Config file: ${SETTINGS_FILE}`));
|
|
131
131
|
console.log("");
|
|
132
132
|
} catch (error) {
|
|
133
|
-
console.error(
|
|
133
|
+
console.error(ansis__default.red(isZh ? "\u274C \u8BFB\u53D6\u914D\u7F6E\u5931\u8D25" : "\u274C Failed to read configuration"));
|
|
134
134
|
if (error instanceof Error) {
|
|
135
|
-
console.error(
|
|
135
|
+
console.error(ansis__default.dim(error.message));
|
|
136
136
|
}
|
|
137
137
|
console.log("");
|
|
138
138
|
}
|
|
@@ -142,7 +142,7 @@ async function resetConfig(_options = {}) {
|
|
|
142
142
|
try {
|
|
143
143
|
const config = readClaudeConfig();
|
|
144
144
|
if (!config) {
|
|
145
|
-
console.log(
|
|
145
|
+
console.log(ansis__default.yellow(isZh ? "\u26A0\uFE0F \u914D\u7F6E\u6587\u4EF6\u4E0D\u5B58\u5728" : "\u26A0\uFE0F Configuration file not found"));
|
|
146
146
|
console.log("");
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
@@ -153,26 +153,26 @@ async function resetConfig(_options = {}) {
|
|
|
153
153
|
default: false
|
|
154
154
|
});
|
|
155
155
|
if (!confirm) {
|
|
156
|
-
console.log(
|
|
156
|
+
console.log(ansis__default.yellow(isZh ? "\u5DF2\u53D6\u6D88" : "Cancelled"));
|
|
157
157
|
console.log("");
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
160
|
const backupPath = backupExistingConfig();
|
|
161
161
|
if (backupPath) {
|
|
162
|
-
console.log(
|
|
162
|
+
console.log(ansis__default.dim(isZh ? `\u{1F4E6} \u5DF2\u5907\u4EFD\u914D\u7F6E\u5230: ${backupPath}` : `\u{1F4E6} Configuration backed up to: ${backupPath}`));
|
|
163
163
|
}
|
|
164
164
|
const minimalConfig = {
|
|
165
165
|
completedOnboarding: true
|
|
166
166
|
};
|
|
167
167
|
writeClaudeConfig(minimalConfig);
|
|
168
168
|
console.log("");
|
|
169
|
-
console.log(
|
|
170
|
-
console.log(
|
|
169
|
+
console.log(ansis__default.green(isZh ? "\u2705 \u914D\u7F6E\u5DF2\u91CD\u7F6E" : "\u2705 Configuration reset"));
|
|
170
|
+
console.log(ansis__default.dim(isZh ? '\u8FD0\u884C "ccjk init" \u91CD\u65B0\u914D\u7F6E' : 'Run "ccjk init" to reconfigure'));
|
|
171
171
|
console.log("");
|
|
172
172
|
} catch (error) {
|
|
173
|
-
console.error(
|
|
173
|
+
console.error(ansis__default.red(isZh ? "\u274C \u91CD\u7F6E\u914D\u7F6E\u5931\u8D25" : "\u274C Failed to reset configuration"));
|
|
174
174
|
if (error instanceof Error) {
|
|
175
|
-
console.error(
|
|
175
|
+
console.error(ansis__default.dim(error.message));
|
|
176
176
|
}
|
|
177
177
|
console.log("");
|
|
178
178
|
}
|
|
@@ -184,9 +184,9 @@ async function setProvider(providerId, options = {}) {
|
|
|
184
184
|
const providers = await getApiProviderPresets(codeType);
|
|
185
185
|
const provider = providers.find((p) => p.id === providerId);
|
|
186
186
|
if (!provider) {
|
|
187
|
-
console.log(
|
|
187
|
+
console.log(ansis__default.yellow(isZh ? `\u26A0\uFE0F \u4F9B\u5E94\u5546 "${providerId}" \u4E0D\u5B58\u5728` : `\u26A0\uFE0F Provider "${providerId}" not found`));
|
|
188
188
|
console.log("");
|
|
189
|
-
console.log(
|
|
189
|
+
console.log(ansis__default.dim(isZh ? "\u53EF\u7528\u7684\u4F9B\u5E94\u5546:" : "Available providers:"));
|
|
190
190
|
for (const p of providers) {
|
|
191
191
|
console.log(` - ${p.id} (${p.name})`);
|
|
192
192
|
}
|
|
@@ -195,14 +195,14 @@ async function setProvider(providerId, options = {}) {
|
|
|
195
195
|
}
|
|
196
196
|
const config = readClaudeConfig();
|
|
197
197
|
if (!config) {
|
|
198
|
-
console.log(
|
|
199
|
-
console.log(
|
|
198
|
+
console.log(ansis__default.yellow(isZh ? "\u26A0\uFE0F \u914D\u7F6E\u6587\u4EF6\u4E0D\u5B58\u5728" : "\u26A0\uFE0F Configuration file not found"));
|
|
199
|
+
console.log(ansis__default.dim(isZh ? '\u8FD0\u884C "ccjk init" \u521D\u59CB\u5316\u914D\u7F6E' : 'Run "ccjk init" to initialize configuration'));
|
|
200
200
|
console.log("");
|
|
201
201
|
return;
|
|
202
202
|
}
|
|
203
203
|
const backupPath = backupExistingConfig();
|
|
204
204
|
if (backupPath) {
|
|
205
|
-
console.log(
|
|
205
|
+
console.log(ansis__default.dim(isZh ? `\u{1F4E6} \u5DF2\u5907\u4EFD\u914D\u7F6E\u5230: ${backupPath}` : `\u{1F4E6} Configuration backed up to: ${backupPath}`));
|
|
206
206
|
}
|
|
207
207
|
if (codeType === "claude-code" && provider.claudeCode) {
|
|
208
208
|
config.baseUrl = provider.claudeCode.baseUrl;
|
|
@@ -215,24 +215,24 @@ async function setProvider(providerId, options = {}) {
|
|
|
215
215
|
}
|
|
216
216
|
writeClaudeConfig(config);
|
|
217
217
|
console.log("");
|
|
218
|
-
console.log(
|
|
218
|
+
console.log(ansis__default.green(isZh ? `\u2705 \u5DF2\u5207\u6362\u5230\u4F9B\u5E94\u5546: ${provider.name}` : `\u2705 Switched to provider: ${provider.name}`));
|
|
219
219
|
console.log("");
|
|
220
|
-
console.log(
|
|
221
|
-
console.log(` ${
|
|
222
|
-
console.log(` ${
|
|
220
|
+
console.log(ansis__default.bold(isZh ? "\u914D\u7F6E\u8BE6\u60C5:" : "Configuration details:"));
|
|
221
|
+
console.log(` ${ansis__default.green(isZh ? "\u4F9B\u5E94\u5546" : "Provider")}: ${provider.name}`);
|
|
222
|
+
console.log(` ${ansis__default.green(isZh ? "\u63A5\u53E3\u5730\u5740" : "Base URL")}: ${config.baseUrl}`);
|
|
223
223
|
if (config.model) {
|
|
224
|
-
console.log(` ${
|
|
224
|
+
console.log(` ${ansis__default.green(isZh ? "\u4E3B\u6A21\u578B" : "Primary Model")}: ${config.model}`);
|
|
225
225
|
}
|
|
226
226
|
if (config.fastModel) {
|
|
227
|
-
console.log(` ${
|
|
227
|
+
console.log(` ${ansis__default.green(isZh ? "\u5FEB\u901F\u6A21\u578B" : "Fast Model")}: ${config.fastModel}`);
|
|
228
228
|
}
|
|
229
229
|
console.log("");
|
|
230
|
-
console.log(
|
|
230
|
+
console.log(ansis__default.dim(isZh ? "\u{1F4A1} \u63D0\u793A: \u8BF7\u786E\u4FDD\u5DF2\u8BBE\u7F6E\u6B63\u786E\u7684 API \u5BC6\u94A5\u6216\u8BA4\u8BC1\u4EE4\u724C" : "\u{1F4A1} Tip: Make sure to set the correct API key or auth token"));
|
|
231
231
|
console.log("");
|
|
232
232
|
} catch (error) {
|
|
233
|
-
console.error(
|
|
233
|
+
console.error(ansis__default.red(isZh ? "\u274C \u8BBE\u7F6E\u4F9B\u5E94\u5546\u5931\u8D25" : "\u274C Failed to set provider"));
|
|
234
234
|
if (error instanceof Error) {
|
|
235
|
-
console.error(
|
|
235
|
+
console.error(ansis__default.dim(error.message));
|
|
236
236
|
}
|
|
237
237
|
console.log("");
|
|
238
238
|
}
|
|
@@ -242,8 +242,8 @@ async function configCommand(action, args, options = {}) {
|
|
|
242
242
|
case "get":
|
|
243
243
|
if (args.length === 0) {
|
|
244
244
|
const isZh = i18n.language === "zh-CN";
|
|
245
|
-
console.log(
|
|
246
|
-
console.log(
|
|
245
|
+
console.log(ansis__default.yellow(isZh ? "\u26A0\uFE0F \u8BF7\u6307\u5B9A\u914D\u7F6E\u9879" : "\u26A0\uFE0F Please specify a configuration key"));
|
|
246
|
+
console.log(ansis__default.dim(isZh ? "\u7528\u6CD5: ccjk config get <key>" : "Usage: ccjk config get <key>"));
|
|
247
247
|
console.log("");
|
|
248
248
|
return;
|
|
249
249
|
}
|
|
@@ -252,8 +252,8 @@ async function configCommand(action, args, options = {}) {
|
|
|
252
252
|
case "set":
|
|
253
253
|
if (args.length < 2) {
|
|
254
254
|
const isZh = i18n.language === "zh-CN";
|
|
255
|
-
console.log(
|
|
256
|
-
console.log(
|
|
255
|
+
console.log(ansis__default.yellow(isZh ? "\u26A0\uFE0F \u8BF7\u6307\u5B9A\u914D\u7F6E\u9879\u548C\u503C" : "\u26A0\uFE0F Please specify key and value"));
|
|
256
|
+
console.log(ansis__default.dim(isZh ? "\u7528\u6CD5: ccjk config set <key> <value>" : "Usage: ccjk config set <key> <value>"));
|
|
257
257
|
console.log("");
|
|
258
258
|
return;
|
|
259
259
|
}
|
|
@@ -269,8 +269,8 @@ async function configCommand(action, args, options = {}) {
|
|
|
269
269
|
case "provider":
|
|
270
270
|
if (args.length === 0) {
|
|
271
271
|
const isZh = i18n.language === "zh-CN";
|
|
272
|
-
console.log(
|
|
273
|
-
console.log(
|
|
272
|
+
console.log(ansis__default.yellow(isZh ? "\u26A0\uFE0F \u8BF7\u6307\u5B9A\u4F9B\u5E94\u5546 ID" : "\u26A0\uFE0F Please specify provider ID"));
|
|
273
|
+
console.log(ansis__default.dim(isZh ? "\u7528\u6CD5: ccjk config provider <id>" : "Usage: ccjk config provider <id>"));
|
|
274
274
|
console.log("");
|
|
275
275
|
return;
|
|
276
276
|
}
|
|
@@ -279,22 +279,22 @@ async function configCommand(action, args, options = {}) {
|
|
|
279
279
|
default: {
|
|
280
280
|
const isZh = i18n.language === "zh-CN";
|
|
281
281
|
console.log("");
|
|
282
|
-
console.log(
|
|
282
|
+
console.log(ansis__default.bold.cyan(isZh ? "\u2699\uFE0F \u914D\u7F6E\u7BA1\u7406\u547D\u4EE4" : "\u2699\uFE0F Configuration Management Commands"));
|
|
283
283
|
console.log("");
|
|
284
|
-
console.log(` ${
|
|
285
|
-
console.log(` ${
|
|
286
|
-
console.log(` ${
|
|
287
|
-
console.log(` ${
|
|
288
|
-
console.log(` ${
|
|
284
|
+
console.log(` ${ansis__default.green("ccjk config get <key>")} ${isZh ? "\u83B7\u53D6\u914D\u7F6E\u9879" : "Get configuration value"}`);
|
|
285
|
+
console.log(` ${ansis__default.green("ccjk config set <key> <value>")} ${isZh ? "\u8BBE\u7F6E\u914D\u7F6E\u9879" : "Set configuration value"}`);
|
|
286
|
+
console.log(` ${ansis__default.green("ccjk config list")} ${isZh ? "\u5217\u51FA\u6240\u6709\u914D\u7F6E" : "List all configuration"}`);
|
|
287
|
+
console.log(` ${ansis__default.green("ccjk config reset")} ${isZh ? "\u91CD\u7F6E\u914D\u7F6E" : "Reset configuration"}`);
|
|
288
|
+
console.log(` ${ansis__default.green("ccjk config provider <id>")} ${isZh ? "\u5207\u6362\u4F9B\u5E94\u5546" : "Switch provider"}`);
|
|
289
289
|
console.log("");
|
|
290
|
-
console.log(
|
|
291
|
-
console.log(` ${
|
|
292
|
-
console.log(` ${
|
|
290
|
+
console.log(ansis__default.bold(isZh ? "\u9009\u9879" : "Options"));
|
|
291
|
+
console.log(` ${ansis__default.green("--code-type, -T")} <type> ${isZh ? "\u4EE3\u7801\u5DE5\u5177\u7C7B\u578B (claude-code, codex)" : "Code tool type (claude-code, codex)"}`);
|
|
292
|
+
console.log(` ${ansis__default.green("--json, -j")} ${isZh ? "JSON \u683C\u5F0F\u8F93\u51FA" : "JSON format output"}`);
|
|
293
293
|
console.log("");
|
|
294
|
-
console.log(
|
|
295
|
-
console.log(` ${
|
|
296
|
-
console.log(` ${
|
|
297
|
-
console.log(` ${
|
|
294
|
+
console.log(ansis__default.bold(isZh ? "\u793A\u4F8B" : "Examples"));
|
|
295
|
+
console.log(` ${ansis__default.dim("ccjk config get baseUrl")}`);
|
|
296
|
+
console.log(` ${ansis__default.dim('ccjk config set model "claude-3-5-sonnet-20241022"')}`);
|
|
297
|
+
console.log(` ${ansis__default.dim("ccjk config provider glm")}`);
|
|
298
298
|
console.log("");
|
|
299
299
|
}
|
|
300
300
|
}
|
|
@@ -342,22 +342,22 @@ function setNestedValue(obj, path, value) {
|
|
|
342
342
|
function displayValue(value, indent) {
|
|
343
343
|
const prefix = " ".repeat(indent);
|
|
344
344
|
if (value === null) {
|
|
345
|
-
console.log(`${prefix}${
|
|
345
|
+
console.log(`${prefix}${ansis__default.dim("null")}`);
|
|
346
346
|
} else if (typeof value === "boolean") {
|
|
347
|
-
console.log(`${prefix}${
|
|
347
|
+
console.log(`${prefix}${ansis__default.green(value.toString())}`);
|
|
348
348
|
} else if (typeof value === "number") {
|
|
349
|
-
console.log(`${prefix}${
|
|
349
|
+
console.log(`${prefix}${ansis__default.yellow(value.toString())}`);
|
|
350
350
|
} else if (typeof value === "string") {
|
|
351
|
-
console.log(`${prefix}${
|
|
351
|
+
console.log(`${prefix}${ansis__default.green(value)}`);
|
|
352
352
|
} else if (Array.isArray(value)) {
|
|
353
|
-
console.log(`${prefix}${
|
|
353
|
+
console.log(`${prefix}${ansis__default.dim("[")}`);
|
|
354
354
|
for (const item of value) {
|
|
355
355
|
displayValue(item, indent + 1);
|
|
356
356
|
}
|
|
357
|
-
console.log(`${prefix}${
|
|
357
|
+
console.log(`${prefix}${ansis__default.dim("]")}`);
|
|
358
358
|
} else if (typeof value === "object") {
|
|
359
359
|
for (const [key, val] of Object.entries(value)) {
|
|
360
|
-
console.log(`${prefix}${
|
|
360
|
+
console.log(`${prefix}${ansis__default.bold(key)}:`);
|
|
361
361
|
displayValue(val, indent + 1);
|
|
362
362
|
}
|
|
363
363
|
} else {
|
|
@@ -365,14 +365,14 @@ function displayValue(value, indent) {
|
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
function displayConfigSection(title, data, _isZh) {
|
|
368
|
-
console.log(
|
|
368
|
+
console.log(ansis__default.bold(title));
|
|
369
369
|
console.log("");
|
|
370
370
|
for (const [key, value] of Object.entries(data)) {
|
|
371
371
|
if (value !== void 0) {
|
|
372
372
|
if (Array.isArray(value)) {
|
|
373
|
-
console.log(` ${
|
|
373
|
+
console.log(` ${ansis__default.green(key)}: ${value.join(", ")}`);
|
|
374
374
|
} else {
|
|
375
|
-
console.log(` ${
|
|
375
|
+
console.log(` ${ansis__default.green(key)}: ${value}`);
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
}
|
|
@@ -381,7 +381,7 @@ function displayConfigSection(title, data, _isZh) {
|
|
|
381
381
|
async function unsetConfig(key, _options = {}) {
|
|
382
382
|
const isZh = i18n.language === "zh-CN";
|
|
383
383
|
if (!key) {
|
|
384
|
-
console.log(
|
|
384
|
+
console.log(ansis__default.yellow(isZh ? "\u26A0\uFE0F \u8BF7\u6307\u5B9A\u914D\u7F6E\u9879" : "\u26A0\uFE0F Please specify a configuration key"));
|
|
385
385
|
return;
|
|
386
386
|
}
|
|
387
387
|
const config = readClaudeConfig();
|
|
@@ -389,36 +389,36 @@ async function unsetConfig(key, _options = {}) {
|
|
|
389
389
|
let current = config;
|
|
390
390
|
for (let i = 0; i < keys.length - 1; i++) {
|
|
391
391
|
if (current[keys[i]] === void 0) {
|
|
392
|
-
console.log(
|
|
392
|
+
console.log(ansis__default.yellow(isZh ? `\u26A0\uFE0F \u914D\u7F6E\u9879 "${key}" \u4E0D\u5B58\u5728` : `\u26A0\uFE0F Configuration key "${key}" does not exist`));
|
|
393
393
|
return;
|
|
394
394
|
}
|
|
395
395
|
current = current[keys[i]];
|
|
396
396
|
}
|
|
397
397
|
const lastKey = keys[keys.length - 1];
|
|
398
398
|
if (current[lastKey] === void 0) {
|
|
399
|
-
console.log(
|
|
399
|
+
console.log(ansis__default.yellow(isZh ? `\u26A0\uFE0F \u914D\u7F6E\u9879 "${key}" \u4E0D\u5B58\u5728` : `\u26A0\uFE0F Configuration key "${key}" does not exist`));
|
|
400
400
|
return;
|
|
401
401
|
}
|
|
402
402
|
delete current[lastKey];
|
|
403
403
|
writeClaudeConfig(config);
|
|
404
|
-
console.log(
|
|
404
|
+
console.log(ansis__default.green(isZh ? `\u2705 \u5DF2\u5220\u9664\u914D\u7F6E\u9879: ${key}` : `\u2705 Removed configuration: ${key}`));
|
|
405
405
|
}
|
|
406
406
|
async function editConfig(_options = {}) {
|
|
407
407
|
const isZh = i18n.language === "zh-CN";
|
|
408
408
|
const configPath = getClaudeConfigPath();
|
|
409
409
|
const editor = process__default.env.EDITOR || process__default.env.VISUAL || "vi";
|
|
410
|
-
console.log(
|
|
410
|
+
console.log(ansis__default.green(isZh ? `\u{1F4DD} \u6B63\u5728\u6253\u5F00\u914D\u7F6E\u6587\u4EF6: ${configPath}` : `\u{1F4DD} Opening config file: ${configPath}`));
|
|
411
411
|
const { spawn } = await import('node:child_process');
|
|
412
412
|
const child = spawn(editor, [configPath], { stdio: "inherit" });
|
|
413
413
|
child.on("exit", (code) => {
|
|
414
414
|
if (code === 0) {
|
|
415
|
-
console.log(
|
|
415
|
+
console.log(ansis__default.green(isZh ? "\u2705 \u914D\u7F6E\u6587\u4EF6\u5DF2\u4FDD\u5B58" : "\u2705 Config file saved"));
|
|
416
416
|
}
|
|
417
417
|
});
|
|
418
418
|
}
|
|
419
419
|
async function validateConfig(_options = {}) {
|
|
420
420
|
const isZh = i18n.language === "zh-CN";
|
|
421
|
-
console.log(
|
|
421
|
+
console.log(ansis__default.green(isZh ? "\u{1F50D} \u6B63\u5728\u9A8C\u8BC1\u914D\u7F6E..." : "\u{1F50D} Validating configuration..."));
|
|
422
422
|
console.log("");
|
|
423
423
|
const config = readClaudeConfig();
|
|
424
424
|
const errors = [];
|
|
@@ -433,19 +433,19 @@ async function validateConfig(_options = {}) {
|
|
|
433
433
|
errors.push(isZh ? "model \u683C\u5F0F\u65E0\u6548" : "model format is invalid");
|
|
434
434
|
}
|
|
435
435
|
if (errors.length === 0 && warnings.length === 0) {
|
|
436
|
-
console.log(
|
|
436
|
+
console.log(ansis__default.green(isZh ? "\u2705 \u914D\u7F6E\u9A8C\u8BC1\u901A\u8FC7" : "\u2705 Configuration is valid"));
|
|
437
437
|
} else {
|
|
438
438
|
if (errors.length > 0) {
|
|
439
|
-
console.log(
|
|
439
|
+
console.log(ansis__default.red(isZh ? "\u274C \u9519\u8BEF:" : "\u274C Errors:"));
|
|
440
440
|
for (const error of errors) {
|
|
441
|
-
console.log(
|
|
441
|
+
console.log(ansis__default.red(` \u2022 ${error}`));
|
|
442
442
|
}
|
|
443
443
|
console.log("");
|
|
444
444
|
}
|
|
445
445
|
if (warnings.length > 0) {
|
|
446
|
-
console.log(
|
|
446
|
+
console.log(ansis__default.yellow(isZh ? "\u26A0\uFE0F \u8B66\u544A:" : "\u26A0\uFE0F Warnings:"));
|
|
447
447
|
for (const warning of warnings) {
|
|
448
|
-
console.log(
|
|
448
|
+
console.log(ansis__default.yellow(` \u2022 ${warning}`));
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
451
|
}
|
package/dist/chunks/context.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as nodeFs from 'node:fs';
|
|
2
2
|
import * as os from 'node:os';
|
|
3
3
|
import * as path from 'node:path';
|
|
4
|
-
import
|
|
4
|
+
import ansis__default from 'ansis';
|
|
5
5
|
import * as crypto from 'node:crypto';
|
|
6
6
|
import process__default from 'node:process';
|
|
7
7
|
|
|
@@ -406,7 +406,7 @@ ${currentContent}`;
|
|
|
406
406
|
}
|
|
407
407
|
const contextManager = new ContextManager();
|
|
408
408
|
|
|
409
|
-
const chalk =
|
|
409
|
+
const chalk = ansis__default;
|
|
410
410
|
function formatBytes(bytes) {
|
|
411
411
|
if (bytes < 1024)
|
|
412
412
|
return `${bytes} B`;
|
package/dist/chunks/doctor.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, statSync, writeFileSync, readFileSync, readdirSync } from 'node:fs';
|
|
2
2
|
import process__default from 'node:process';
|
|
3
|
-
import
|
|
3
|
+
import ansis__default from 'ansis';
|
|
4
4
|
import inquirer from 'inquirer';
|
|
5
5
|
import { resolve, join, dirname } from 'pathe';
|
|
6
6
|
import { getApiProviderPresets } from './api-providers.mjs';
|
|
@@ -11,7 +11,7 @@ import { P as ProviderHealthMonitor } from '../shared/ccjk.J8YiPsOw.mjs';
|
|
|
11
11
|
import { platform, userInfo, homedir } from 'node:os';
|
|
12
12
|
import ora from 'ora';
|
|
13
13
|
import { exec } from 'tinyexec';
|
|
14
|
-
import { S as STATUS } from '../shared/ccjk.
|
|
14
|
+
import { S as STATUS } from '../shared/ccjk.DjD9Rzxq.mjs';
|
|
15
15
|
import { writeFileAtomic } from './fs-operations.mjs';
|
|
16
16
|
import 'node:url';
|
|
17
17
|
import 'i18next';
|
|
@@ -436,10 +436,10 @@ async function runWorkspaceCheck(targetDir) {
|
|
|
436
436
|
};
|
|
437
437
|
}
|
|
438
438
|
function displayWorkspaceReport(report) {
|
|
439
|
-
console.log(
|
|
439
|
+
console.log(ansis__default.green(`
|
|
440
440
|
\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550 ${t("workspace:title")} \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550
|
|
441
441
|
`));
|
|
442
|
-
console.log(
|
|
442
|
+
console.log(ansis__default.white.bold(`${t("workspace:currentDir")}: ${ansis__default.yellow(report.cwd)}
|
|
443
443
|
`));
|
|
444
444
|
for (const check of report.checks) {
|
|
445
445
|
let icon;
|
|
@@ -447,42 +447,42 @@ function displayWorkspaceReport(report) {
|
|
|
447
447
|
switch (check.status) {
|
|
448
448
|
case "pass":
|
|
449
449
|
icon = "\u2705";
|
|
450
|
-
color =
|
|
450
|
+
color = ansis__default.green;
|
|
451
451
|
break;
|
|
452
452
|
case "warn":
|
|
453
453
|
icon = "\u26A0\uFE0F";
|
|
454
|
-
color =
|
|
454
|
+
color = ansis__default.yellow;
|
|
455
455
|
break;
|
|
456
456
|
case "fail":
|
|
457
457
|
icon = "\u274C";
|
|
458
|
-
color =
|
|
458
|
+
color = ansis__default.red;
|
|
459
459
|
break;
|
|
460
460
|
case "info":
|
|
461
461
|
default:
|
|
462
462
|
icon = "\u2139\uFE0F";
|
|
463
|
-
color =
|
|
463
|
+
color = ansis__default.gray;
|
|
464
464
|
break;
|
|
465
465
|
}
|
|
466
|
-
console.log(`${icon} ${
|
|
466
|
+
console.log(`${icon} ${ansis__default.bold(check.name.padEnd(20))} ${color(check.message)}`);
|
|
467
467
|
if (check.details) {
|
|
468
|
-
console.log(
|
|
468
|
+
console.log(ansis__default.gray(` ${check.details}`));
|
|
469
469
|
}
|
|
470
470
|
if (check.fixDescription && (check.status === "fail" || check.status === "warn")) {
|
|
471
|
-
console.log(
|
|
471
|
+
console.log(ansis__default.dim(` \u{1F4A1} ${check.fixDescription}`));
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
474
|
console.log("");
|
|
475
|
-
console.log(
|
|
475
|
+
console.log(ansis__default.dim("\u2500".repeat(50)));
|
|
476
476
|
if (report.isValid) {
|
|
477
477
|
console.log(STATUS.success(t("workspace:summary.valid")));
|
|
478
478
|
} else {
|
|
479
479
|
console.log(STATUS.error(t("workspace:summary.invalid")));
|
|
480
480
|
}
|
|
481
481
|
if (report.recommendations.length > 0) {
|
|
482
|
-
console.log(
|
|
482
|
+
console.log(ansis__default.yellow(`
|
|
483
483
|
${t("workspace:recommendations.title")}:`));
|
|
484
484
|
for (const rec of report.recommendations) {
|
|
485
|
-
console.log(
|
|
485
|
+
console.log(ansis__default.yellow(` \u2022 ${rec}`));
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
488
|
console.log("");
|
|
@@ -502,7 +502,7 @@ async function runWorkspaceWizard(targetDir) {
|
|
|
502
502
|
return;
|
|
503
503
|
}
|
|
504
504
|
console.log("");
|
|
505
|
-
console.log(
|
|
505
|
+
console.log(ansis__default.green(t("workspace:wizard.autoFixing", { count: fixableChecks.length })));
|
|
506
506
|
for (const check of fixableChecks) {
|
|
507
507
|
const spinner = ora(`${t("workspace:wizard.fixing")} ${check.name}...`).start();
|
|
508
508
|
try {
|
|
@@ -517,7 +517,7 @@ async function runWorkspaceWizard(targetDir) {
|
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
console.log("");
|
|
520
|
-
console.log(
|
|
520
|
+
console.log(ansis__default.green(t("workspace:wizard.verifying")));
|
|
521
521
|
const newReport = await runWorkspaceCheck(targetDir);
|
|
522
522
|
if (newReport.isValid) {
|
|
523
523
|
console.log(STATUS.success(t("workspace:wizard.allFixed")));
|
|
@@ -706,8 +706,8 @@ async function checkProviders(codeType = "claude-code") {
|
|
|
706
706
|
async function doctor(options = {}) {
|
|
707
707
|
const isZh = i18n.language === "zh-CN";
|
|
708
708
|
console.log("");
|
|
709
|
-
console.log(
|
|
710
|
-
console.log(
|
|
709
|
+
console.log(ansis__default.bold.cyan("\u{1F50D} CCJK Health Check"));
|
|
710
|
+
console.log(ansis__default.dim("\u2500".repeat(50)));
|
|
711
711
|
console.log("");
|
|
712
712
|
const checks = [
|
|
713
713
|
checkClaudeCode,
|
|
@@ -725,11 +725,11 @@ async function doctor(options = {}) {
|
|
|
725
725
|
let hasWarnings = false;
|
|
726
726
|
for (const check of checks) {
|
|
727
727
|
const result = await check();
|
|
728
|
-
const statusIcon = result.status === "ok" ?
|
|
729
|
-
const statusColor = result.status === "ok" ?
|
|
730
|
-
console.log(`${statusIcon} ${
|
|
728
|
+
const statusIcon = result.status === "ok" ? ansis__default.green("\u2705") : result.status === "warning" ? ansis__default.yellow("\u26A0\uFE0F") : ansis__default.red("\u274C");
|
|
729
|
+
const statusColor = result.status === "ok" ? ansis__default.green : result.status === "warning" ? ansis__default.yellow : ansis__default.red;
|
|
730
|
+
console.log(`${statusIcon} ${ansis__default.bold(result.name)}: ${statusColor(result.message)}`);
|
|
731
731
|
if (result.fix) {
|
|
732
|
-
console.log(
|
|
732
|
+
console.log(ansis__default.dim(` \u{1F4A1} Fix: ${result.fix}`));
|
|
733
733
|
}
|
|
734
734
|
if (result.status === "error")
|
|
735
735
|
hasErrors = true;
|
|
@@ -737,13 +737,13 @@ async function doctor(options = {}) {
|
|
|
737
737
|
hasWarnings = true;
|
|
738
738
|
}
|
|
739
739
|
console.log("");
|
|
740
|
-
console.log(
|
|
740
|
+
console.log(ansis__default.dim("\u2500".repeat(50)));
|
|
741
741
|
if (hasErrors) {
|
|
742
|
-
console.log(
|
|
742
|
+
console.log(ansis__default.red("\u274C Issues found - please follow the suggestions above"));
|
|
743
743
|
} else if (hasWarnings) {
|
|
744
|
-
console.log(
|
|
744
|
+
console.log(ansis__default.yellow("\u26A0\uFE0F Configuration is functional, but some features may be limited"));
|
|
745
745
|
} else {
|
|
746
|
-
console.log(
|
|
746
|
+
console.log(ansis__default.green("\u2705 All checks passed - CCJK is properly configured!"));
|
|
747
747
|
}
|
|
748
748
|
console.log("");
|
|
749
749
|
if (!options.checkProviders) {
|
|
@@ -755,13 +755,13 @@ async function doctor(options = {}) {
|
|
|
755
755
|
});
|
|
756
756
|
if (checkProvidersNow) {
|
|
757
757
|
console.log("");
|
|
758
|
-
console.log(
|
|
758
|
+
console.log(ansis__default.dim(isZh ? "\u6B63\u5728\u68C0\u67E5\u4F9B\u5E94\u5546..." : "Checking providers..."));
|
|
759
759
|
const providerResult = await checkProviders(options.codeType);
|
|
760
|
-
const statusIcon = providerResult.status === "ok" ?
|
|
761
|
-
const statusColor = providerResult.status === "ok" ?
|
|
762
|
-
console.log(`${statusIcon} ${
|
|
760
|
+
const statusIcon = providerResult.status === "ok" ? ansis__default.green("\u2705") : providerResult.status === "warning" ? ansis__default.yellow("\u26A0\uFE0F") : ansis__default.red("\u274C");
|
|
761
|
+
const statusColor = providerResult.status === "ok" ? ansis__default.green : providerResult.status === "warning" ? ansis__default.yellow : ansis__default.red;
|
|
762
|
+
console.log(`${statusIcon} ${ansis__default.bold(providerResult.name)}: ${statusColor(providerResult.message)}`);
|
|
763
763
|
if (providerResult.fix) {
|
|
764
|
-
console.log(
|
|
764
|
+
console.log(ansis__default.dim(` \u{1F4A1} Fix: ${providerResult.fix}`));
|
|
765
765
|
}
|
|
766
766
|
console.log("");
|
|
767
767
|
}
|