zcf 1.0.0 → 1.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/dist/cli.mjs +2 -2
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +1 -1
- package/dist/shared/{zcf.DMG6psxU.mjs → zcf.C2Q2uOcq.mjs} +21 -2
- package/package.json +20 -18
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import cac from 'cac';
|
|
3
|
-
import { i as init } from './shared/zcf.
|
|
3
|
+
import { i as init } from './shared/zcf.C2Q2uOcq.mjs';
|
|
4
4
|
import '@posva/prompts';
|
|
5
5
|
import 'ansis';
|
|
6
6
|
import 'node:fs';
|
|
@@ -9,7 +9,7 @@ import 'pathe';
|
|
|
9
9
|
import 'dayjs';
|
|
10
10
|
import 'tinyexec';
|
|
11
11
|
|
|
12
|
-
const version = "1.0.
|
|
12
|
+
const version = "1.0.2";
|
|
13
13
|
|
|
14
14
|
const cli = cac("zcf");
|
|
15
15
|
cli.command("[lang]", "Initialize Claude Code configuration").option("--config-lang <lang>", "Configuration language (zh-CN, en)").option("--force", "Force overwrite existing configuration").option("--skip-install", "Skip Claude Code installation check").action(async (lang, options) => {
|
package/dist/index.d.mts
CHANGED
|
@@ -50,6 +50,7 @@ declare const I18N: {
|
|
|
50
50
|
installSuccess: string;
|
|
51
51
|
installFailed: string;
|
|
52
52
|
npmNotFound: string;
|
|
53
|
+
windowsRestartHint: string;
|
|
53
54
|
configureApi: string;
|
|
54
55
|
customApi: string;
|
|
55
56
|
skipApi: string;
|
|
@@ -89,6 +90,7 @@ declare const I18N: {
|
|
|
89
90
|
installSuccess: string;
|
|
90
91
|
installFailed: string;
|
|
91
92
|
npmNotFound: string;
|
|
93
|
+
windowsRestartHint: string;
|
|
92
94
|
configureApi: string;
|
|
93
95
|
customApi: string;
|
|
94
96
|
skipApi: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ declare const I18N: {
|
|
|
50
50
|
installSuccess: string;
|
|
51
51
|
installFailed: string;
|
|
52
52
|
npmNotFound: string;
|
|
53
|
+
windowsRestartHint: string;
|
|
53
54
|
configureApi: string;
|
|
54
55
|
customApi: string;
|
|
55
56
|
skipApi: string;
|
|
@@ -89,6 +90,7 @@ declare const I18N: {
|
|
|
89
90
|
installSuccess: string;
|
|
90
91
|
installFailed: string;
|
|
91
92
|
npmNotFound: string;
|
|
93
|
+
windowsRestartHint: string;
|
|
92
94
|
configureApi: string;
|
|
93
95
|
customApi: string;
|
|
94
96
|
skipApi: string;
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as CLAUDE_DIR, a as CLAUDE_MD_FILE, I as I18N, L as LANG_LABELS, M as MCP_CONFIG_FILE, d as MCP_SERVICES, S as SETTINGS_FILE, b as SUPPORTED_LANGS, j as backupExistingConfig, o as backupMcpConfig, q as buildMcpServerConfig, c as commandExists, l as configureApi, k as copyConfigFiles, h as ensureClaudeDir, n as getMcpConfigPath, g as getPlatform, i as init, f as installClaudeCode, e as isClaudeCodeInstalled, m as mergeConfigs, p as mergeMcpServers, r as readMcpConfig, w as writeMcpConfig } from './shared/zcf.
|
|
1
|
+
export { C as CLAUDE_DIR, a as CLAUDE_MD_FILE, I as I18N, L as LANG_LABELS, M as MCP_CONFIG_FILE, d as MCP_SERVICES, S as SETTINGS_FILE, b as SUPPORTED_LANGS, j as backupExistingConfig, o as backupMcpConfig, q as buildMcpServerConfig, c as commandExists, l as configureApi, k as copyConfigFiles, h as ensureClaudeDir, n as getMcpConfigPath, g as getPlatform, i as init, f as installClaudeCode, e as isClaudeCodeInstalled, m as mergeConfigs, p as mergeMcpServers, r as readMcpConfig, w as writeMcpConfig } from './shared/zcf.C2Q2uOcq.mjs';
|
|
2
2
|
import '@posva/prompts';
|
|
3
3
|
import 'ansis';
|
|
4
4
|
import 'node:fs';
|
|
@@ -28,6 +28,7 @@ const I18N = {
|
|
|
28
28
|
installSuccess: "Claude Code \u5B89\u88C5\u6210\u529F",
|
|
29
29
|
installFailed: "Claude Code \u5B89\u88C5\u5931\u8D25",
|
|
30
30
|
npmNotFound: "npm \u672A\u5B89\u88C5\u3002\u8BF7\u5148\u5B89\u88C5 Node.js \u548C npm\u3002",
|
|
31
|
+
windowsRestartHint: "\u26A0 Windows \u7CFB\u7EDF\u8BF7\u91CD\u65B0\u6253\u5F00\u4E00\u4E2A\u65B0\u7684\u7EC8\u7AEF\u7A97\u53E3\uFF08cmd/PowerShell\uFF09\uFF0C\u7136\u540E\u8FD0\u884C claude \u547D\u4EE4",
|
|
31
32
|
configureApi: "\u662F\u5426\u914D\u7F6E API\uFF1F",
|
|
32
33
|
customApi: "\u914D\u7F6E API",
|
|
33
34
|
skipApi: "\u8DF3\u8FC7\uFF08\u7A0D\u540E\u5728 claude \u547D\u4EE4\u4E2D\u81EA\u884C\u914D\u7F6E\uFF0C\u5982 OAuth\uFF09",
|
|
@@ -67,6 +68,7 @@ const I18N = {
|
|
|
67
68
|
installSuccess: "Claude Code installed successfully",
|
|
68
69
|
installFailed: "Failed to install Claude Code",
|
|
69
70
|
npmNotFound: "npm is not installed. Please install Node.js and npm first.",
|
|
71
|
+
windowsRestartHint: "\u26A0 On Windows, please open a new terminal window (cmd/PowerShell) and run the claude command",
|
|
70
72
|
configureApi: "Configure API?",
|
|
71
73
|
customApi: "Configure API",
|
|
72
74
|
skipApi: "Skip (configure later in claude command, e.g., OAuth)",
|
|
@@ -334,7 +336,18 @@ async function installClaudeCode(lang) {
|
|
|
334
336
|
throw new Error(i18n.npmNotFound);
|
|
335
337
|
}
|
|
336
338
|
await exec("npm", ["install", "-g", "@anthropic-ai/claude-code"]);
|
|
337
|
-
|
|
339
|
+
await new Promise((resolve) => setTimeout(resolve, 2e3));
|
|
340
|
+
if (await isClaudeCodeInstalled()) {
|
|
341
|
+
console.log(`\u2714 ${i18n.installSuccess}`);
|
|
342
|
+
} else {
|
|
343
|
+
if (getPlatform() === "windows") {
|
|
344
|
+
console.log(`\u2714 ${i18n.installSuccess}`);
|
|
345
|
+
console.log(`
|
|
346
|
+
\u26A0 ${i18n.windowsRestartHint}`);
|
|
347
|
+
} else {
|
|
348
|
+
console.log(`\u2714 ${i18n.installSuccess}`);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
338
351
|
} catch (error) {
|
|
339
352
|
console.error(`\u2716 ${i18n.installFailed}`);
|
|
340
353
|
throw error;
|
|
@@ -437,8 +450,10 @@ async function init(options = {}) {
|
|
|
437
450
|
});
|
|
438
451
|
configLang = response.lang;
|
|
439
452
|
}
|
|
453
|
+
let wasAlreadyInstalled = true;
|
|
440
454
|
if (!options.skipInstall) {
|
|
441
455
|
const installed = await isClaudeCodeInstalled();
|
|
456
|
+
wasAlreadyInstalled = installed;
|
|
442
457
|
if (!installed) {
|
|
443
458
|
const response = await prompts({
|
|
444
459
|
type: "confirm",
|
|
@@ -452,7 +467,7 @@ async function init(options = {}) {
|
|
|
452
467
|
console.log(ansis.yellow(i18n.skip));
|
|
453
468
|
}
|
|
454
469
|
} else {
|
|
455
|
-
console.log(ansis.green(`\u2714
|
|
470
|
+
console.log(ansis.green(`\u2714 ${i18n.installSuccess}`));
|
|
456
471
|
}
|
|
457
472
|
}
|
|
458
473
|
ensureClaudeDir();
|
|
@@ -613,6 +628,10 @@ async function init(options = {}) {
|
|
|
613
628
|
}
|
|
614
629
|
console.log(ansis.green(`\u2714 ${i18n.configSuccess} ${CLAUDE_DIR}`));
|
|
615
630
|
console.log("\n" + ansis.cyan(i18n.complete));
|
|
631
|
+
if (getPlatform() === "windows" && !wasAlreadyInstalled) {
|
|
632
|
+
console.log(ansis.yellow(`
|
|
633
|
+
${i18n.windowsRestartHint}`));
|
|
634
|
+
}
|
|
616
635
|
} catch (error) {
|
|
617
636
|
console.error(ansis.red(`${I18N[options.lang || "en"].error}:`), error);
|
|
618
637
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zcf",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
5
|
-
"packageManager": "pnpm@9.0.0",
|
|
4
|
+
"version": "1.0.2",
|
|
6
5
|
"description": "Zero-Config Claude-Code Flow - One-click configuration tool for Claude Code",
|
|
7
6
|
"license": "MIT",
|
|
8
|
-
"homepage": "https://github.com/UfoMiao/
|
|
7
|
+
"homepage": "https://github.com/UfoMiao/zcf#readme",
|
|
9
8
|
"repository": {
|
|
10
9
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/UfoMiao/
|
|
10
|
+
"url": "git+https://github.com/UfoMiao/zcf.git"
|
|
12
11
|
},
|
|
13
12
|
"main": "dist/index.mjs",
|
|
14
13
|
"module": "dist/index.mjs",
|
|
@@ -21,27 +20,21 @@
|
|
|
21
20
|
"bin",
|
|
22
21
|
"templates"
|
|
23
22
|
],
|
|
24
|
-
"scripts": {
|
|
25
|
-
"dev": "tsx ./src/cli.ts",
|
|
26
|
-
"build": "unbuild",
|
|
27
|
-
"typecheck": "tsc",
|
|
28
|
-
"prepublishOnly": "npm run build",
|
|
29
|
-
"test": "npm run build && node bin/zcf.mjs"
|
|
30
|
-
},
|
|
31
23
|
"dependencies": {
|
|
32
24
|
"@posva/prompts": "^2.4.4",
|
|
33
|
-
"ansis": "^3.
|
|
25
|
+
"ansis": "^3.17.0",
|
|
34
26
|
"cac": "^6.7.14",
|
|
35
27
|
"dayjs": "^1.11.13",
|
|
36
28
|
"find-up-simple": "^1.0.1",
|
|
37
|
-
"pathe": "^2.0.
|
|
29
|
+
"pathe": "^2.0.3",
|
|
38
30
|
"tinyexec": "^1.0.1"
|
|
39
31
|
},
|
|
40
32
|
"devDependencies": {
|
|
41
|
-
"@
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
33
|
+
"@changesets/cli": "^2.29.5",
|
|
34
|
+
"@types/node": "^22.17.0",
|
|
35
|
+
"tsx": "^4.20.3",
|
|
36
|
+
"typescript": "^5.9.2",
|
|
37
|
+
"unbuild": "^3.6.0"
|
|
45
38
|
},
|
|
46
39
|
"keywords": [
|
|
47
40
|
"claude",
|
|
@@ -55,5 +48,14 @@
|
|
|
55
48
|
"ai",
|
|
56
49
|
"automation",
|
|
57
50
|
"mcp"
|
|
58
|
-
]
|
|
51
|
+
],
|
|
52
|
+
"scripts": {
|
|
53
|
+
"dev": "tsx ./src/cli.ts",
|
|
54
|
+
"build": "unbuild",
|
|
55
|
+
"typecheck": "tsc",
|
|
56
|
+
"test": "npm run build && node bin/zcf.mjs",
|
|
57
|
+
"changeset": "changeset",
|
|
58
|
+
"version": "changeset version",
|
|
59
|
+
"release": "pnpm build && changeset publish"
|
|
60
|
+
}
|
|
59
61
|
}
|