ccjk 2.0.0 → 2.0.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/README.md +183 -181
- package/README.zh-CN.md +335 -0
- package/dist/chunks/claude-code-config-manager.mjs +7 -7
- package/dist/chunks/claude-code-incremental-manager.mjs +1 -1
- package/dist/chunks/codex-config-switch.mjs +3 -3
- package/dist/chunks/codex-provider-manager.mjs +1 -1
- package/dist/chunks/codex-uninstaller.mjs +2 -2
- package/dist/chunks/commands.mjs +1 -1
- package/dist/chunks/features.mjs +10 -10
- package/dist/chunks/simple-config.mjs +21 -364
- package/dist/cli.mjs +361 -7
- package/dist/i18n/locales/en/configuration.json +12 -1
- package/dist/i18n/locales/zh-CN/configuration.json +12 -1
- package/dist/index.mjs +366 -7
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import cac from 'cac';
|
|
3
3
|
import ansis from 'ansis';
|
|
4
|
-
import { S as STATUS,
|
|
5
|
-
import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'node:fs';
|
|
4
|
+
import { S as STATUS, ch as i18n, n as runConfigWizard, ci as testApiConnection, m as displayCurrentStatus, cj as quickSetup, ck as format, k as COLORS, cl as getAllPresets, cm as ensureI18nInitialized, cn as readCcrConfig, co as isCcrInstalled, cp as installCcr, cq as configureCcrFeature, cr as promptBoolean, cs as handleExitPromptError, ct as handleGeneralError, cu as COMETIX_COMMAND_NAME, cv as COMETIX_COMMANDS, cw as installCometixLine, cx as addNumbersToChoices, cy as checkAndUpdateTools, aW as runCodexUpdate, cz as resolveCodeType$1, a2 as resolveCodeToolType$1, cA as readZcfConfig, $ as isCodeToolType, W as DEFAULT_CODE_TOOL_TYPE, a_ as switchCodexProvider, aM as listCodexProviders, aR as readCodexConfig, aD as switchToOfficialLogin, a$ as switchToProvider, cB as readJsonConfig, cC as writeJsonConfig, cD as moveToTrash, U as ZCF_CONFIG_FILE, ah as displayBanner, cE as updateZcfConfig, v as version, cF as resolveAiOutputLanguage, cG as updatePromptOnly, cH as selectAndInstallWorkflows, cI as checkClaudeCodeVersionAndPrompt, l as init, ai as displayBannerWithInfo, X as CODE_TOOL_BANNERS, y as CLAUDE_DIR, aV as runCodexUninstall, b5 as configureCodexMcp, aE as configureCodexApi, aY as runCodexWorkflowImportWithLanguageSelection, aT as runCodexFullInit, cJ as checkSuperpowersInstalled, cK as getSuperpowersSkills, cL as updateSuperpowers, cM as uninstallSuperpowers, cN as installSuperpowers, cO as installSuperpowersViaGit, q as commandExists, z as SETTINGS_FILE, _ as CODE_TOOL_INFO, bb as getToolStatus, bc as getAllToolsStatus, V as CODE_TOOL_TYPES, aj as boxify, be as installTool, cP as readZcfConfigAsync, cQ as initI18n, bV as quickSync, cf as checkAllVersions, cg as upgradeAll, i as detectAllConfigs, bB as displayConfigScan, c9 as displayPermissions, cR as selectScriptLanguage, cS as changeLanguage, bU as runOnboarding } from './chunks/simple-config.mjs';
|
|
5
|
+
import { existsSync, readdirSync, mkdirSync, writeFileSync, readFileSync } from 'node:fs';
|
|
6
6
|
import { homedir } from 'node:os';
|
|
7
7
|
import inquirer from 'inquirer';
|
|
8
8
|
import { join, resolve as resolve$1 } from 'pathe';
|
|
@@ -1393,7 +1393,7 @@ class ZcfUninstaller {
|
|
|
1393
1393
|
result.removed.push(".claude.json (includes MCP configuration)");
|
|
1394
1394
|
}
|
|
1395
1395
|
try {
|
|
1396
|
-
const { uninstallCodeTool } = await import('./chunks/simple-config.mjs').then(function (n) { return n.
|
|
1396
|
+
const { uninstallCodeTool } = await import('./chunks/simple-config.mjs').then(function (n) { return n.de; });
|
|
1397
1397
|
const success = await uninstallCodeTool("claude-code");
|
|
1398
1398
|
if (success) {
|
|
1399
1399
|
result.removed.push("@anthropic-ai/claude-code");
|
|
@@ -1629,7 +1629,7 @@ async function uninstall(options = {}) {
|
|
|
1629
1629
|
}
|
|
1630
1630
|
const uninstaller = new ZcfUninstaller(options.lang || "en");
|
|
1631
1631
|
if (codeType === "codex") {
|
|
1632
|
-
const { runCodexUninstall } = await import('./chunks/simple-config.mjs').then(function (n) { return n.
|
|
1632
|
+
const { runCodexUninstall } = await import('./chunks/simple-config.mjs').then(function (n) { return n.dd; });
|
|
1633
1633
|
await runCodexUninstall();
|
|
1634
1634
|
return;
|
|
1635
1635
|
}
|
|
@@ -1899,7 +1899,7 @@ async function update(options = {}) {
|
|
|
1899
1899
|
}
|
|
1900
1900
|
return;
|
|
1901
1901
|
}
|
|
1902
|
-
const { resolveTemplateLanguage } = await import('./chunks/simple-config.mjs').then(function (n) { return n.
|
|
1902
|
+
const { resolveTemplateLanguage } = await import('./chunks/simple-config.mjs').then(function (n) { return n.dc; });
|
|
1903
1903
|
const configLang = await resolveTemplateLanguage(
|
|
1904
1904
|
options.configLang,
|
|
1905
1905
|
// Command line option
|
|
@@ -2674,8 +2674,77 @@ async function showCodexMenu() {
|
|
|
2674
2674
|
}
|
|
2675
2675
|
return void 0;
|
|
2676
2676
|
}
|
|
2677
|
+
async function isFirstTimeUser() {
|
|
2678
|
+
const config = readZcfConfig();
|
|
2679
|
+
if (!config || !config.version) {
|
|
2680
|
+
return true;
|
|
2681
|
+
}
|
|
2682
|
+
if (!existsSync(join(CLAUDE_DIR, "commands"))) {
|
|
2683
|
+
return true;
|
|
2684
|
+
}
|
|
2685
|
+
return false;
|
|
2686
|
+
}
|
|
2687
|
+
async function showNewUserWelcome() {
|
|
2688
|
+
console.log("");
|
|
2689
|
+
console.log(ansis.bold.cyan("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"));
|
|
2690
|
+
console.log(ansis.bold.cyan("\u2551") + ansis.bold.white(" \u{1F44B} \u6B22\u8FCE\u4F7F\u7528 CCJK\uFF01 ") + ansis.bold.cyan("\u2551"));
|
|
2691
|
+
console.log(`${ansis.bold.cyan("\u2551")} ${ansis.bold.cyan("\u2551")}`);
|
|
2692
|
+
console.log(`${ansis.bold.cyan("\u2551")} CCJK \u5E2E\u52A9\u60A8\u5FEB\u901F\u914D\u7F6E Claude Code \u5F00\u53D1\u73AF\u5883 ${ansis.bold.cyan("\u2551")}`);
|
|
2693
|
+
console.log(`${ansis.bold.cyan("\u2551")} \u5305\u62EC API \u8BBE\u7F6E\u3001\u5DE5\u4F5C\u6D41\u6A21\u677F\u3001MCP \u670D\u52A1\u7B49 ${ansis.bold.cyan("\u2551")}`);
|
|
2694
|
+
console.log(ansis.bold.cyan("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"));
|
|
2695
|
+
console.log("");
|
|
2696
|
+
const { mode } = await inquirer.prompt({
|
|
2697
|
+
type: "list",
|
|
2698
|
+
name: "mode",
|
|
2699
|
+
message: "\u8BF7\u9009\u62E9\uFF1A",
|
|
2700
|
+
choices: [
|
|
2701
|
+
{
|
|
2702
|
+
name: ansis.green("\u{1F680} \u5FEB\u901F\u5F00\u59CB") + ansis.dim(" - \u63A8\u8350\u65B0\u624B\uFF0C3\u5206\u949F\u5B8C\u6210\u914D\u7F6E"),
|
|
2703
|
+
value: "quick"
|
|
2704
|
+
},
|
|
2705
|
+
{
|
|
2706
|
+
name: ansis.cyan("\u2699\uFE0F \u5B8C\u6574\u914D\u7F6E") + ansis.dim(" - \u81EA\u5B9A\u4E49\u6240\u6709\u9009\u9879"),
|
|
2707
|
+
value: "full"
|
|
2708
|
+
},
|
|
2709
|
+
{
|
|
2710
|
+
name: ansis.yellow("\u{1F4D6} \u67E5\u770B\u5E2E\u52A9") + ansis.dim(" - \u4E86\u89E3 CCJK \u529F\u80FD"),
|
|
2711
|
+
value: "help"
|
|
2712
|
+
}
|
|
2713
|
+
]
|
|
2714
|
+
});
|
|
2715
|
+
return mode;
|
|
2716
|
+
}
|
|
2717
|
+
async function showFeaturesOverview() {
|
|
2718
|
+
console.log("");
|
|
2719
|
+
console.log(ansis.bold.cyan("\u{1F4D6} CCJK \u529F\u80FD\u4ECB\u7ECD"));
|
|
2720
|
+
console.log("");
|
|
2721
|
+
console.log(ansis.cyan("\u6838\u5FC3\u529F\u80FD\uFF1A"));
|
|
2722
|
+
console.log(` ${ansis.green("\u2022")} API \u914D\u7F6E - \u652F\u6301 Auth Token\u3001API Key\u3001CCR \u4EE3\u7406`);
|
|
2723
|
+
console.log(` ${ansis.green("\u2022")} \u5DE5\u4F5C\u6D41\u6A21\u677F - Git\u3001SixStep\u3001Common Tools \u7B49\u9884\u8BBE\u5DE5\u4F5C\u6D41`);
|
|
2724
|
+
console.log(` ${ansis.green("\u2022")} MCP \u670D\u52A1 - \u4EE3\u7801\u5E93\u641C\u7D22\u3001\u6587\u4EF6\u7CFB\u7EDF\u3001\u7F51\u7EDC\u641C\u7D22\u7B49`);
|
|
2725
|
+
console.log(` ${ansis.green("\u2022")} \u8F93\u51FA\u98CE\u683C - \u591A\u79CD AI \u8F93\u51FA\u98CE\u683C\uFF08\u901F\u5EA6\u4F18\u5148\u3001\u67B6\u6784\u5E08\u3001\u7ED3\u5BF9\u7F16\u7A0B\u7B49\uFF09`);
|
|
2726
|
+
console.log("");
|
|
2727
|
+
console.log(ansis.cyan("\u63A8\u8350\u63D2\u4EF6\uFF1A"));
|
|
2728
|
+
console.log(` ${ansis.green("\u2022")} CCR - Claude Code Router \u4EE3\u7406\u5DE5\u5177`);
|
|
2729
|
+
console.log(` ${ansis.green("\u2022")} CCusage - API \u4F7F\u7528\u91CF\u7EDF\u8BA1\u5DE5\u5177`);
|
|
2730
|
+
console.log(` ${ansis.green("\u2022")} Cometix - \u72B6\u6001\u680F\u589E\u5F3A\u5DE5\u5177`);
|
|
2731
|
+
console.log(` ${ansis.green("\u2022")} Superpowers - \u6280\u80FD\u6269\u5C55\u7CFB\u7EDF`);
|
|
2732
|
+
console.log("");
|
|
2733
|
+
console.log(ansis.dim("\u6309 Enter \u7EE7\u7EED..."));
|
|
2734
|
+
await inquirer.prompt([{ type: "input", name: "continue", message: "" }]);
|
|
2735
|
+
}
|
|
2677
2736
|
async function showMainMenu(options = {}) {
|
|
2678
2737
|
try {
|
|
2738
|
+
if (await isFirstTimeUser()) {
|
|
2739
|
+
const mode = await showNewUserWelcome();
|
|
2740
|
+
if (mode === "quick") {
|
|
2741
|
+
await init({ skipPrompt: false });
|
|
2742
|
+
return;
|
|
2743
|
+
} else if (mode === "help") {
|
|
2744
|
+
await showFeaturesOverview();
|
|
2745
|
+
return showMainMenu(options);
|
|
2746
|
+
}
|
|
2747
|
+
}
|
|
2679
2748
|
if (options.codeType) {
|
|
2680
2749
|
try {
|
|
2681
2750
|
const resolvedType = await resolveCodeType$1(options.codeType);
|
|
@@ -2837,6 +2906,196 @@ async function commit(options = {}) {
|
|
|
2837
2906
|
}
|
|
2838
2907
|
}
|
|
2839
2908
|
|
|
2909
|
+
async function checkClaudeCode() {
|
|
2910
|
+
const hasCommand = await commandExists("claude");
|
|
2911
|
+
if (hasCommand) {
|
|
2912
|
+
return { name: "Claude Code", status: "ok", message: "Installed" };
|
|
2913
|
+
}
|
|
2914
|
+
return {
|
|
2915
|
+
name: "Claude Code",
|
|
2916
|
+
status: "error",
|
|
2917
|
+
message: "Not installed",
|
|
2918
|
+
fix: "Run: npm install -g @anthropic-ai/claude-code"
|
|
2919
|
+
};
|
|
2920
|
+
}
|
|
2921
|
+
async function checkClaudeDir() {
|
|
2922
|
+
if (existsSync(CLAUDE_DIR)) {
|
|
2923
|
+
return { name: "Config Directory", status: "ok", message: CLAUDE_DIR };
|
|
2924
|
+
}
|
|
2925
|
+
return {
|
|
2926
|
+
name: "Config Directory",
|
|
2927
|
+
status: "error",
|
|
2928
|
+
message: "Does not exist",
|
|
2929
|
+
fix: "Run: npx ccjk init"
|
|
2930
|
+
};
|
|
2931
|
+
}
|
|
2932
|
+
async function checkSettings() {
|
|
2933
|
+
if (existsSync(SETTINGS_FILE)) {
|
|
2934
|
+
return { name: "settings.json", status: "ok", message: "Configured" };
|
|
2935
|
+
}
|
|
2936
|
+
return {
|
|
2937
|
+
name: "settings.json",
|
|
2938
|
+
status: "warning",
|
|
2939
|
+
message: "Not found",
|
|
2940
|
+
fix: "Run: npx ccjk init"
|
|
2941
|
+
};
|
|
2942
|
+
}
|
|
2943
|
+
async function checkWorkflows() {
|
|
2944
|
+
const commandsDir = join(CLAUDE_DIR, "commands");
|
|
2945
|
+
if (existsSync(commandsDir)) {
|
|
2946
|
+
try {
|
|
2947
|
+
const files = readdirSync(commandsDir, { recursive: true });
|
|
2948
|
+
const mdFiles = files.filter((f) => String(f).endsWith(".md"));
|
|
2949
|
+
return {
|
|
2950
|
+
name: "Workflows",
|
|
2951
|
+
status: "ok",
|
|
2952
|
+
message: `${mdFiles.length} commands installed`
|
|
2953
|
+
};
|
|
2954
|
+
} catch {
|
|
2955
|
+
return { name: "Workflows", status: "warning", message: "Cannot read directory" };
|
|
2956
|
+
}
|
|
2957
|
+
}
|
|
2958
|
+
return {
|
|
2959
|
+
name: "Workflows",
|
|
2960
|
+
status: "warning",
|
|
2961
|
+
message: "Not installed",
|
|
2962
|
+
fix: "Run: npx ccjk update"
|
|
2963
|
+
};
|
|
2964
|
+
}
|
|
2965
|
+
async function checkMcp() {
|
|
2966
|
+
const mcpConfigPath = join(CLAUDE_DIR, "mcp.json");
|
|
2967
|
+
const settingsPath = SETTINGS_FILE;
|
|
2968
|
+
if (existsSync(settingsPath)) {
|
|
2969
|
+
try {
|
|
2970
|
+
const { readFileSync } = await import('node:fs');
|
|
2971
|
+
const settings = JSON.parse(readFileSync(settingsPath, "utf-8"));
|
|
2972
|
+
if (settings.mcpServers && Object.keys(settings.mcpServers).length > 0) {
|
|
2973
|
+
const count = Object.keys(settings.mcpServers).length;
|
|
2974
|
+
return { name: "MCP Services", status: "ok", message: `${count} services configured` };
|
|
2975
|
+
}
|
|
2976
|
+
} catch {
|
|
2977
|
+
}
|
|
2978
|
+
}
|
|
2979
|
+
if (existsSync(mcpConfigPath)) {
|
|
2980
|
+
return { name: "MCP Services", status: "ok", message: "Configured" };
|
|
2981
|
+
}
|
|
2982
|
+
return {
|
|
2983
|
+
name: "MCP Services",
|
|
2984
|
+
status: "warning",
|
|
2985
|
+
message: "Not configured",
|
|
2986
|
+
fix: "Run: npx ccjk init and select MCP services"
|
|
2987
|
+
};
|
|
2988
|
+
}
|
|
2989
|
+
async function checkCcr() {
|
|
2990
|
+
const hasCcr = await commandExists("ccr");
|
|
2991
|
+
if (hasCcr) {
|
|
2992
|
+
return { name: "CCR Proxy", status: "ok", message: "Installed" };
|
|
2993
|
+
}
|
|
2994
|
+
return {
|
|
2995
|
+
name: "CCR Proxy",
|
|
2996
|
+
status: "warning",
|
|
2997
|
+
message: "Not installed (optional)",
|
|
2998
|
+
fix: "Run: npx ccjk ccr to install"
|
|
2999
|
+
};
|
|
3000
|
+
}
|
|
3001
|
+
async function checkOutputStyles() {
|
|
3002
|
+
const stylesDir = join(CLAUDE_DIR, "output-styles");
|
|
3003
|
+
if (existsSync(stylesDir)) {
|
|
3004
|
+
try {
|
|
3005
|
+
const files = readdirSync(stylesDir).filter((f) => f.endsWith(".md"));
|
|
3006
|
+
return {
|
|
3007
|
+
name: "Output Styles",
|
|
3008
|
+
status: "ok",
|
|
3009
|
+
message: `${files.length} styles available`
|
|
3010
|
+
};
|
|
3011
|
+
} catch {
|
|
3012
|
+
return { name: "Output Styles", status: "warning", message: "Cannot read directory" };
|
|
3013
|
+
}
|
|
3014
|
+
}
|
|
3015
|
+
return {
|
|
3016
|
+
name: "Output Styles",
|
|
3017
|
+
status: "warning",
|
|
3018
|
+
message: "Not installed",
|
|
3019
|
+
fix: "Run: npx ccjk init"
|
|
3020
|
+
};
|
|
3021
|
+
}
|
|
3022
|
+
async function doctor() {
|
|
3023
|
+
console.log("");
|
|
3024
|
+
console.log(ansis.bold.cyan("\u{1F50D} CCJK Health Check"));
|
|
3025
|
+
console.log(ansis.dim("\u2500".repeat(50)));
|
|
3026
|
+
console.log("");
|
|
3027
|
+
const checks = [
|
|
3028
|
+
checkClaudeCode,
|
|
3029
|
+
checkClaudeDir,
|
|
3030
|
+
checkSettings,
|
|
3031
|
+
checkWorkflows,
|
|
3032
|
+
checkMcp,
|
|
3033
|
+
checkCcr,
|
|
3034
|
+
checkOutputStyles
|
|
3035
|
+
];
|
|
3036
|
+
let hasErrors = false;
|
|
3037
|
+
let hasWarnings = false;
|
|
3038
|
+
for (const check of checks) {
|
|
3039
|
+
const result = await check();
|
|
3040
|
+
const statusIcon = result.status === "ok" ? ansis.green("\u2705") : result.status === "warning" ? ansis.yellow("\u26A0\uFE0F") : ansis.red("\u274C");
|
|
3041
|
+
const statusColor = result.status === "ok" ? ansis.green : result.status === "warning" ? ansis.yellow : ansis.red;
|
|
3042
|
+
console.log(`${statusIcon} ${ansis.bold(result.name)}: ${statusColor(result.message)}`);
|
|
3043
|
+
if (result.fix) {
|
|
3044
|
+
console.log(ansis.dim(` \u{1F4A1} Fix: ${result.fix}`));
|
|
3045
|
+
}
|
|
3046
|
+
if (result.status === "error")
|
|
3047
|
+
hasErrors = true;
|
|
3048
|
+
if (result.status === "warning")
|
|
3049
|
+
hasWarnings = true;
|
|
3050
|
+
}
|
|
3051
|
+
console.log("");
|
|
3052
|
+
console.log(ansis.dim("\u2500".repeat(50)));
|
|
3053
|
+
if (hasErrors) {
|
|
3054
|
+
console.log(ansis.red("\u274C Issues found - please follow the suggestions above"));
|
|
3055
|
+
} else if (hasWarnings) {
|
|
3056
|
+
console.log(ansis.yellow("\u26A0\uFE0F Configuration is functional, but some features may be limited"));
|
|
3057
|
+
} else {
|
|
3058
|
+
console.log(ansis.green("\u2705 All checks passed - CCJK is properly configured!"));
|
|
3059
|
+
}
|
|
3060
|
+
console.log("");
|
|
3061
|
+
}
|
|
3062
|
+
|
|
3063
|
+
async function showFeatures() {
|
|
3064
|
+
console.log("");
|
|
3065
|
+
console.log(ansis.bold.cyan("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557"));
|
|
3066
|
+
console.log(ansis.bold.cyan("\u2551") + ansis.bold.white(" \u{1F4E6} CCJK \u529F\u80FD\u4E00\u89C8 ") + ansis.bold.cyan("\u2551"));
|
|
3067
|
+
console.log(ansis.bold.cyan("\u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563"));
|
|
3068
|
+
console.log(`${ansis.bold.cyan("\u2551")} ${ansis.bold.cyan("\u2551")}`);
|
|
3069
|
+
console.log(ansis.bold.cyan("\u2551") + ansis.bold.yellow(" \u{1F527} CLI \u547D\u4EE4 ") + ansis.bold.cyan("\u2551"));
|
|
3070
|
+
console.log(`${ansis.bold.cyan("\u2551")} \u251C\u2500 ${ansis.cyan("ccjk init")} \u521D\u59CB\u5316\u73AF\u5883\u914D\u7F6E ${ansis.bold.cyan("\u2551")}`);
|
|
3071
|
+
console.log(`${ansis.bold.cyan("\u2551")} \u251C\u2500 ${ansis.cyan("ccjk update")} \u66F4\u65B0\u5DE5\u4F5C\u6D41\u548C\u6A21\u677F ${ansis.bold.cyan("\u2551")}`);
|
|
3072
|
+
console.log(`${ansis.bold.cyan("\u2551")} \u251C\u2500 ${ansis.cyan("ccjk cs")} \u5207\u6362 API \u914D\u7F6E ${ansis.bold.cyan("\u2551")}`);
|
|
3073
|
+
console.log(`${ansis.bold.cyan("\u2551")} \u251C\u2500 ${ansis.cyan("ccjk doctor")} \u8BCA\u65AD\u914D\u7F6E\u95EE\u9898 ${ansis.bold.cyan("\u2551")}`);
|
|
3074
|
+
console.log(`${ansis.bold.cyan("\u2551")} \u251C\u2500 ${ansis.cyan("ccjk ccr")} CCR \u4EE3\u7406\u7BA1\u7406 ${ansis.bold.cyan("\u2551")}`);
|
|
3075
|
+
console.log(`${ansis.bold.cyan("\u2551")} \u2514\u2500 ${ansis.cyan("ccjk ccu")} \u4F7F\u7528\u91CF\u7EDF\u8BA1 ${ansis.bold.cyan("\u2551")}`);
|
|
3076
|
+
console.log(`${ansis.bold.cyan("\u2551")} ${ansis.bold.cyan("\u2551")}`);
|
|
3077
|
+
console.log(ansis.bold.cyan("\u2551") + ansis.bold.yellow(" \u{1F4CB} \u5DE5\u4F5C\u6D41\uFF08\u5728 Claude Code \u4E2D\u4F7F\u7528\uFF09 ") + ansis.bold.cyan("\u2551"));
|
|
3078
|
+
console.log(`${ansis.bold.cyan("\u2551")} \u251C\u2500 ${ansis.green("/ccjk:workflow")} \u516D\u9636\u6BB5\u5F00\u53D1\u6D41\u7A0B ${ansis.bgGreen.black(" \u63A8\u8350 ")} ${ansis.bold.cyan("\u2551")}`);
|
|
3079
|
+
console.log(`${ansis.bold.cyan("\u2551")} \u251C\u2500 ${ansis.green("/ccjk:feat")} \u529F\u80FD\u89C4\u5212\u6D41\u7A0B ${ansis.bold.cyan("\u2551")}`);
|
|
3080
|
+
console.log(`${ansis.bold.cyan("\u2551")} \u251C\u2500 ${ansis.green("/git-commit")} \u667A\u80FD\u63D0\u4EA4 ${ansis.bgYellow.black(" \u70ED\u95E8 ")} ${ansis.bold.cyan("\u2551")}`);
|
|
3081
|
+
console.log(`${ansis.bold.cyan("\u2551")} \u251C\u2500 ${ansis.green("/git-rollback")} \u56DE\u6EDA\u66F4\u6539 ${ansis.bold.cyan("\u2551")}`);
|
|
3082
|
+
console.log(`${ansis.bold.cyan("\u2551")} \u2514\u2500 ${ansis.green("/git-cleanup")} \u6E05\u7406\u5206\u652F ${ansis.bold.cyan("\u2551")}`);
|
|
3083
|
+
console.log(`${ansis.bold.cyan("\u2551")} ${ansis.bold.cyan("\u2551")}`);
|
|
3084
|
+
console.log(ansis.bold.cyan("\u2551") + ansis.bold.yellow(" \u{1F3A8} \u8F93\u51FA\u98CE\u683C ") + ansis.bold.cyan("\u2551"));
|
|
3085
|
+
console.log(`${ansis.bold.cyan("\u2551")} \u251C\u2500 ${ansis.magenta("senior-architect")} \u8D44\u6DF1\u67B6\u6784\u5E08\u98CE\u683C ${ansis.bold.cyan("\u2551")}`);
|
|
3086
|
+
console.log(`${ansis.bold.cyan("\u2551")} \u251C\u2500 ${ansis.magenta("pair-programmer")} \u7ED3\u5BF9\u7F16\u7A0B\u98CE\u683C ${ansis.bold.cyan("\u2551")}`);
|
|
3087
|
+
console.log(`${ansis.bold.cyan("\u2551")} \u2514\u2500 ${ansis.magenta("speed-coder")} \u5FEB\u901F\u7F16\u7801\u98CE\u683C ${ansis.bold.cyan("\u2551")}`);
|
|
3088
|
+
console.log(`${ansis.bold.cyan("\u2551")} ${ansis.bold.cyan("\u2551")}`);
|
|
3089
|
+
console.log(ansis.bold.cyan("\u2551") + ansis.bold.yellow(" \u26A1 \u5FEB\u6377\u64CD\u4F5C\uFF08\u5728 Claude Code \u4E2D\u8F93\u5165\u6570\u5B57\uFF09 ") + ansis.bold.cyan("\u2551"));
|
|
3090
|
+
console.log(`${ansis.bold.cyan("\u2551")} ${ansis.dim("1=\u667A\u80FD\u63D0\u4EA4 2=\u4EE3\u7801\u5BA1\u67E5 3=\u7F16\u5199\u6D4B\u8BD5 4=\u89C4\u5212\u529F\u80FD")} ${ansis.bold.cyan("\u2551")}`);
|
|
3091
|
+
console.log(`${ansis.bold.cyan("\u2551")} ${ansis.dim("5=\u8C03\u8BD5\u95EE\u9898 6=\u5934\u8111\u98CE\u66B4 7=\u9A8C\u8BC1\u4EE3\u7801 8=\u5199\u6587\u6863")} ${ansis.bold.cyan("\u2551")}`);
|
|
3092
|
+
console.log(`${ansis.bold.cyan("\u2551")} ${ansis.bold.cyan("\u2551")}`);
|
|
3093
|
+
console.log(ansis.bold.cyan("\u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563"));
|
|
3094
|
+
console.log(ansis.bold.cyan("\u2551") + ansis.dim(" \u{1F4A1} \u63D0\u793A\uFF1A\u8F93\u5165 ccjk <\u547D\u4EE4> --help \u67E5\u770B\u8BE6\u7EC6\u7528\u6CD5 ") + ansis.bold.cyan("\u2551"));
|
|
3095
|
+
console.log(ansis.bold.cyan("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D"));
|
|
3096
|
+
console.log("");
|
|
3097
|
+
}
|
|
3098
|
+
|
|
2840
3099
|
const projectFoundationQuestions = [
|
|
2841
3100
|
{
|
|
2842
3101
|
id: "app-purpose",
|
|
@@ -6702,6 +6961,93 @@ async function toolsCommand(action = "list", target, options = {}) {
|
|
|
6702
6961
|
}
|
|
6703
6962
|
}
|
|
6704
6963
|
|
|
6964
|
+
const WORKFLOW_METADATA = {
|
|
6965
|
+
"workflow": { description: "\u516D\u9636\u6BB5\u5F00\u53D1\u6D41\u7A0B", tags: ["\u63A8\u8350", "\u6838\u5FC3"] },
|
|
6966
|
+
"feat": { description: "\u529F\u80FD\u89C4\u5212\u6D41\u7A0B", tags: ["\u63A8\u8350"] },
|
|
6967
|
+
"git-commit": { description: "\u667A\u80FD Git \u63D0\u4EA4", tags: ["\u70ED\u95E8", "Git"] },
|
|
6968
|
+
"git-rollback": { description: "\u56DE\u6EDA\u66F4\u6539", tags: ["Git"] },
|
|
6969
|
+
"git-cleanup": { description: "\u6E05\u7406\u5206\u652F", tags: ["Git"] },
|
|
6970
|
+
"git-worktree": { description: "\u5DE5\u4F5C\u6811\u7BA1\u7406", tags: ["Git"] },
|
|
6971
|
+
"bmad": { description: "BMad \u654F\u6377\u6D41\u7A0B", tags: ["\u654F\u6377"] },
|
|
6972
|
+
"spec": { description: "\u89C4\u683C\u9A71\u52A8\u5F00\u53D1", tags: ["\u89C4\u5212"] }
|
|
6973
|
+
};
|
|
6974
|
+
function getInstalledWorkflows() {
|
|
6975
|
+
const commandsDir = join(CLAUDE_DIR, "commands");
|
|
6976
|
+
const workflows = [];
|
|
6977
|
+
if (!existsSync(commandsDir)) {
|
|
6978
|
+
return workflows;
|
|
6979
|
+
}
|
|
6980
|
+
function scanDir(dir, prefix = "") {
|
|
6981
|
+
try {
|
|
6982
|
+
const items = readdirSync(dir, { withFileTypes: true });
|
|
6983
|
+
for (const item of items) {
|
|
6984
|
+
if (item.isDirectory()) {
|
|
6985
|
+
scanDir(join(dir, item.name), `${prefix}${item.name}/`);
|
|
6986
|
+
} else if (item.name.endsWith(".md")) {
|
|
6987
|
+
const name = item.name.replace(".md", "");
|
|
6988
|
+
const fullName = prefix ? `${prefix.replace(/\/$/, "")}:${name}` : name;
|
|
6989
|
+
const meta = WORKFLOW_METADATA[name] || {};
|
|
6990
|
+
workflows.push({
|
|
6991
|
+
name: `/${fullName}`,
|
|
6992
|
+
path: join(dir, item.name),
|
|
6993
|
+
description: meta.description,
|
|
6994
|
+
installed: true,
|
|
6995
|
+
tags: meta.tags
|
|
6996
|
+
});
|
|
6997
|
+
}
|
|
6998
|
+
}
|
|
6999
|
+
} catch {
|
|
7000
|
+
}
|
|
7001
|
+
}
|
|
7002
|
+
scanDir(commandsDir);
|
|
7003
|
+
return workflows;
|
|
7004
|
+
}
|
|
7005
|
+
function formatTags(tags) {
|
|
7006
|
+
if (!tags || tags.length === 0)
|
|
7007
|
+
return "";
|
|
7008
|
+
return tags.map((tag) => {
|
|
7009
|
+
switch (tag) {
|
|
7010
|
+
case "\u63A8\u8350":
|
|
7011
|
+
return ansis.bgGreen.black(` ${tag} `);
|
|
7012
|
+
case "\u70ED\u95E8":
|
|
7013
|
+
return ansis.bgYellow.black(` ${tag} `);
|
|
7014
|
+
case "\u6838\u5FC3":
|
|
7015
|
+
return ansis.bgBlue.white(` ${tag} `);
|
|
7016
|
+
case "Git":
|
|
7017
|
+
return ansis.bgMagenta.white(` ${tag} `);
|
|
7018
|
+
default:
|
|
7019
|
+
return ansis.bgGray.white(` ${tag} `);
|
|
7020
|
+
}
|
|
7021
|
+
}).join(" ");
|
|
7022
|
+
}
|
|
7023
|
+
async function showWorkflows() {
|
|
7024
|
+
console.log("");
|
|
7025
|
+
console.log(ansis.bold.cyan("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"));
|
|
7026
|
+
console.log(ansis.bold.cyan("\u2502") + ansis.bold.white(" \u{1F4CB} CCJK \u5DE5\u4F5C\u6D41\u7BA1\u7406 ") + ansis.bold.cyan("\u2502"));
|
|
7027
|
+
console.log(ansis.bold.cyan("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"));
|
|
7028
|
+
const workflows = getInstalledWorkflows();
|
|
7029
|
+
if (workflows.length === 0) {
|
|
7030
|
+
console.log(ansis.bold.cyan("\u2502") + ansis.yellow(" \u26A0\uFE0F \u672A\u5B89\u88C5\u4EFB\u4F55\u5DE5\u4F5C\u6D41 ") + ansis.bold.cyan("\u2502"));
|
|
7031
|
+
console.log(ansis.bold.cyan("\u2502") + ansis.dim(" \u8FD0\u884C npx ccjk init \u6216 npx ccjk update \u5B89\u88C5\u5DE5\u4F5C\u6D41 ") + ansis.bold.cyan("\u2502"));
|
|
7032
|
+
} else {
|
|
7033
|
+
console.log(ansis.bold.cyan("\u2502") + ansis.bold.green(` \u2705 \u5DF2\u5B89\u88C5\u5DE5\u4F5C\u6D41 (${workflows.length})`) + " ".repeat(42 - String(workflows.length).length) + ansis.bold.cyan("\u2502"));
|
|
7034
|
+
console.log(`${ansis.bold.cyan("\u2502")} ${ansis.bold.cyan("\u2502")}`);
|
|
7035
|
+
for (const wf of workflows) {
|
|
7036
|
+
const tags = formatTags(wf.tags);
|
|
7037
|
+
const desc = wf.description || "";
|
|
7038
|
+
const nameCol = ansis.green(wf.name.padEnd(20));
|
|
7039
|
+
const descCol = ansis.dim(desc.padEnd(25));
|
|
7040
|
+
console.log(ansis.bold.cyan("\u2502") + ` ${nameCol} ${descCol} ${tags}`.padEnd(60) + ansis.bold.cyan("\u2502"));
|
|
7041
|
+
}
|
|
7042
|
+
}
|
|
7043
|
+
console.log(`${ansis.bold.cyan("\u2502")} ${ansis.bold.cyan("\u2502")}`);
|
|
7044
|
+
console.log(ansis.bold.cyan("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"));
|
|
7045
|
+
console.log(ansis.bold.cyan("\u2502") + ansis.dim(" \u{1F4A1} \u5728 Claude Code \u4E2D\u8F93\u5165\u5DE5\u4F5C\u6D41\u540D\u79F0\u5373\u53EF\u4F7F\u7528 ") + ansis.bold.cyan("\u2502"));
|
|
7046
|
+
console.log(ansis.bold.cyan("\u2502") + ansis.dim(" \u4F8B\u5982: /ccjk:workflow \u5B9E\u73B0\u7528\u6237\u767B\u5F55\u529F\u80FD ") + ansis.bold.cyan("\u2502"));
|
|
7047
|
+
console.log(ansis.bold.cyan("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"));
|
|
7048
|
+
console.log("");
|
|
7049
|
+
}
|
|
7050
|
+
|
|
6705
7051
|
async function resolveAndSwitchLanguage(lang, options, skipPrompt = false) {
|
|
6706
7052
|
const ccjkConfig = await readZcfConfigAsync();
|
|
6707
7053
|
const targetLang = options?.allLang || lang || options?.lang || ccjkConfig?.preferredLang || (skipPrompt ? "en" : await selectScriptLanguage());
|
|
@@ -6749,6 +7095,8 @@ function customizeHelp(sections) {
|
|
|
6749
7095
|
` ${ansis.cyan("ccjk quick")} Express interview (~10 questions)`,
|
|
6750
7096
|
` ${ansis.cyan("ccjk deep")} Deep dive interview (~40+ questions)`,
|
|
6751
7097
|
` ${ansis.cyan("ccjk mcp")} <action> MCP Server marketplace (search, trending, install)`,
|
|
7098
|
+
` ${ansis.cyan("ccjk workflows")} | ${ansis.cyan("wf")} Manage installed workflows`,
|
|
7099
|
+
` ${ansis.cyan("ccjk doctor")} Health check and diagnostics`,
|
|
6752
7100
|
` ${ansis.cyan("ccjk uninstall")} ${i18n.t("cli:help.commandDescriptions.uninstallConfigurations")}`,
|
|
6753
7101
|
` ${ansis.cyan("ccjk check-updates")} ${i18n.t("cli:help.commandDescriptions.checkUpdateVersions")}`,
|
|
6754
7102
|
"",
|
|
@@ -6883,8 +7231,8 @@ async function setupCommands(cli) {
|
|
|
6883
7231
|
cli.command("sync", "Quick sync - update knowledge base from current project").action(async () => {
|
|
6884
7232
|
await quickSync();
|
|
6885
7233
|
});
|
|
6886
|
-
cli.command("doctor", "Run environment health check").
|
|
6887
|
-
await
|
|
7234
|
+
cli.command("doctor", "Run environment health check").action(async () => {
|
|
7235
|
+
await doctor();
|
|
6888
7236
|
});
|
|
6889
7237
|
cli.command("versions", "Check Claude Code, CCJK, and plugin versions").alias("ver").action(async () => {
|
|
6890
7238
|
await checkAllVersions();
|
|
@@ -6966,6 +7314,12 @@ async function setupCommands(cli) {
|
|
|
6966
7314
|
console.error(`Unknown action: ${action}. Use: save, list, restore, or export`);
|
|
6967
7315
|
}
|
|
6968
7316
|
});
|
|
7317
|
+
cli.command("features", "Show all available features").action(async () => {
|
|
7318
|
+
await showFeatures();
|
|
7319
|
+
});
|
|
7320
|
+
cli.command("workflows", "Manage installed workflows").alias("wf").option("--lang, -l <lang>", "Display language (zh-CN, en)").action(await withLanguageResolution(async () => {
|
|
7321
|
+
await showWorkflows();
|
|
7322
|
+
}));
|
|
6969
7323
|
cli.help((sections) => customizeHelp(sections));
|
|
6970
7324
|
cli.version(version);
|
|
6971
7325
|
}
|
|
@@ -71,5 +71,16 @@
|
|
|
71
71
|
"codexModelOptions.gpt5": "GPT-5 - General powerful model, suitable for complex tasks",
|
|
72
72
|
"codexModelOptions.gpt5Codex": "GPT-5-Codex - Code-optimized model, recommended for programming tasks",
|
|
73
73
|
"codexModelOptions.custom": "Custom - Specify custom model names",
|
|
74
|
-
"windowsMcpConfigFixed": "Windows MCP configuration fixed"
|
|
74
|
+
"windowsMcpConfigFixed": "Windows MCP configuration fixed",
|
|
75
|
+
"setupCompleteTitle": "✅ CCJK Configuration Complete!",
|
|
76
|
+
"nextSteps": "🎯 Next Steps:",
|
|
77
|
+
"guidanceStep1": "1. Open Claude Code and use number shortcuts:",
|
|
78
|
+
"guidanceStep1Detail": "1 = Smart Commit 2 = Code Review 3 = Write Tests",
|
|
79
|
+
"guidanceStep1Detail2": "4 = Plan Feature 5 = Debug Issue 6 = Brainstorm",
|
|
80
|
+
"guidanceStep2": "2. Or use workflow commands:",
|
|
81
|
+
"guidanceStep2Example": "/ccjk:workflow implement user login feature",
|
|
82
|
+
"guidanceStep3": "3. View all features:",
|
|
83
|
+
"guidanceStep3Command": "npx ccjk features",
|
|
84
|
+
"guidanceStep4": "4. Having issues? Run:",
|
|
85
|
+
"guidanceStep4Command": "npx ccjk doctor"
|
|
75
86
|
}
|
|
@@ -71,5 +71,16 @@
|
|
|
71
71
|
"codexModelOptions.gpt5": "GPT-5 - 通用强力模型,适合复杂任务",
|
|
72
72
|
"codexModelOptions.gpt5Codex": "GPT-5-Codex - 专为代码优化的模型,推荐用于编程任务",
|
|
73
73
|
"codexModelOptions.custom": "自定义 - 指定自定义模型名称",
|
|
74
|
-
"windowsMcpConfigFixed": "Windows MCP 配置已修复"
|
|
74
|
+
"windowsMcpConfigFixed": "Windows MCP 配置已修复",
|
|
75
|
+
"setupCompleteTitle": "✅ CCJK 配置完成!",
|
|
76
|
+
"nextSteps": "🎯 下一步:",
|
|
77
|
+
"guidanceStep1": "1. 打开 Claude Code,输入数字快速操作:",
|
|
78
|
+
"guidanceStep1Detail": "1 = 智能提交 2 = 代码审查 3 = 编写测试",
|
|
79
|
+
"guidanceStep1Detail2": "4 = 规划功能 5 = 调试问题 6 = 头脑风暴",
|
|
80
|
+
"guidanceStep2": "2. 或使用工作流命令:",
|
|
81
|
+
"guidanceStep2Example": "/ccjk:workflow 实现用户登录功能",
|
|
82
|
+
"guidanceStep3": "3. 查看所有功能:",
|
|
83
|
+
"guidanceStep3Command": "npx ccjk features",
|
|
84
|
+
"guidanceStep4": "4. 遇到问题?运行:",
|
|
85
|
+
"guidanceStep4Command": "npx ccjk doctor"
|
|
75
86
|
}
|