zcf 1.1.0 → 1.1.1
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/LICENSE +21 -0
- package/README.md +19 -8
- package/dist/cli.mjs +15 -15
- package/dist/index.mjs +1 -1
- package/dist/shared/{zcf.S0xKCxNQ.mjs → zcf.CUoxYhz9.mjs} +3 -3
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 UfoMiao
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -6,17 +6,28 @@
|
|
|
6
6
|
|
|
7
7
|
## 🚀 快速开始
|
|
8
8
|
|
|
9
|
+
### 根据你的情况选择:
|
|
10
|
+
|
|
11
|
+
#### 🆕 首次使用 Claude Code
|
|
12
|
+
```bash
|
|
13
|
+
npx zcf # 完整初始化:安装 Claude Code + 配置 API + 设置 MCP 服务
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
#### 🔄 已有 Claude Code 环境
|
|
9
17
|
```bash
|
|
10
|
-
npx zcf
|
|
11
|
-
npx zcf u # 更新 Prompt 文档并备份旧配置(update 缩写)
|
|
18
|
+
npx zcf u # 仅导入工作流:快速添加 AI 工作流和命令系统
|
|
12
19
|
```
|
|
13
20
|
|
|
14
|
-
|
|
21
|
+
> **提示**:`zcf u` 是 `zcf update` 的缩写,专为已配置用户设计,只更新工作流相关文件,保留你的 API 和 MCP 配置。
|
|
22
|
+
|
|
23
|
+
### 初始化流程
|
|
24
|
+
|
|
25
|
+
完整初始化(`npx zcf`)会自动:
|
|
15
26
|
|
|
16
|
-
- 检测并安装 Claude Code
|
|
17
|
-
- 配置 API 密钥
|
|
18
|
-
- 选择并配置 MCP 服务
|
|
19
|
-
- 设置所有必要的配置文件
|
|
27
|
+
- ✅ 检测并安装 Claude Code
|
|
28
|
+
- ✅ 配置 API 密钥
|
|
29
|
+
- ✅ 选择并配置 MCP 服务
|
|
30
|
+
- ✅ 设置所有必要的配置文件
|
|
20
31
|
|
|
21
32
|
### 使用方式
|
|
22
33
|
|
|
@@ -94,7 +105,7 @@ $ npx zcf
|
|
|
94
105
|
|
|
95
106
|
? 检测到已有配置文件,如何处理?
|
|
96
107
|
❯ 备份并覆盖全部
|
|
97
|
-
|
|
108
|
+
仅更新工作流相关md并备份旧配置
|
|
98
109
|
合并配置
|
|
99
110
|
跳过
|
|
100
111
|
|
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 { s as displayBanner, t as readZcfConfig, b as SUPPORTED_LANGS, L as LANG_LABELS, u as updateZcfConfig, v as version, I as I18N, S as SETTINGS_FILE, x as updatePromptOnly, i as init } from './shared/zcf.
|
|
4
|
+
import { s as displayBanner, t as readZcfConfig, b as SUPPORTED_LANGS, L as LANG_LABELS, u as updateZcfConfig, v as version, I as I18N, S as SETTINGS_FILE, x as updatePromptOnly, i as init } from './shared/zcf.CUoxYhz9.mjs';
|
|
5
5
|
import prompts from '@posva/prompts';
|
|
6
6
|
import { existsSync } from 'node:fs';
|
|
7
7
|
import 'node:os';
|
|
@@ -95,34 +95,34 @@ cli.help((sections) => {
|
|
|
95
95
|
body: ansis.cyan.bold(`ZCF - Zero-Config Claude-Code Flow v${version}`)
|
|
96
96
|
});
|
|
97
97
|
sections.push({
|
|
98
|
-
title: ansis.yellow("Commands:"),
|
|
98
|
+
title: ansis.yellow("Commands / \u547D\u4EE4:"),
|
|
99
99
|
body: [
|
|
100
|
-
` ${ansis.cyan("zcf")} Initialize configuration (default)`,
|
|
101
|
-
` ${ansis.cyan("zcf update")} | ${ansis.cyan("u")} Update
|
|
100
|
+
` ${ansis.cyan("zcf")} Initialize configuration (default) / \u521D\u59CB\u5316\u914D\u7F6E\uFF08\u9ED8\u8BA4\uFF09`,
|
|
101
|
+
` ${ansis.cyan("zcf update")} | ${ansis.cyan("u")} Update workflow-related md files / \u4EC5\u66F4\u65B0\u5DE5\u4F5C\u6D41\u76F8\u5173md`,
|
|
102
102
|
"",
|
|
103
|
-
ansis.gray(" Shortcut:"),
|
|
104
|
-
` ${ansis.cyan("zcf u")} Quick update`
|
|
103
|
+
ansis.gray(" Shortcut / \u5FEB\u6377\u65B9\u5F0F:"),
|
|
104
|
+
` ${ansis.cyan("zcf u")} Quick update / \u5FEB\u901F\u66F4\u65B0`
|
|
105
105
|
].join("\n")
|
|
106
106
|
});
|
|
107
107
|
sections.push({
|
|
108
|
-
title: ansis.yellow("Options:"),
|
|
108
|
+
title: ansis.yellow("Options / \u9009\u9879:"),
|
|
109
109
|
body: [
|
|
110
|
-
` ${ansis.green("--config-lang, -c")} <lang> Configuration language (zh-CN, en)`,
|
|
111
|
-
` ${ansis.green("--force, -f")}
|
|
112
|
-
` ${ansis.green("--help, -h")}
|
|
113
|
-
` ${ansis.green("--version, -v")}
|
|
110
|
+
` ${ansis.green("--config-lang, -c")} <lang> Configuration language / \u914D\u7F6E\u8BED\u8A00 (zh-CN, en)`,
|
|
111
|
+
` ${ansis.green("--force, -f")} Force overwrite / \u5F3A\u5236\u8986\u76D6\u73B0\u6709\u914D\u7F6E`,
|
|
112
|
+
` ${ansis.green("--help, -h")} Display help / \u663E\u793A\u5E2E\u52A9`,
|
|
113
|
+
` ${ansis.green("--version, -v")} Display version / \u663E\u793A\u7248\u672C`
|
|
114
114
|
].join("\n")
|
|
115
115
|
});
|
|
116
116
|
sections.push({
|
|
117
|
-
title: ansis.yellow("Examples:"),
|
|
117
|
+
title: ansis.yellow("Examples / \u793A\u4F8B:"),
|
|
118
118
|
body: [
|
|
119
|
-
ansis.gray(" # Initialize with interactive prompts"),
|
|
119
|
+
ansis.gray(" # Initialize with interactive prompts / \u4EA4\u4E92\u5F0F\u521D\u59CB\u5316"),
|
|
120
120
|
` ${ansis.cyan("npx zcf")}`,
|
|
121
121
|
"",
|
|
122
|
-
ansis.gray(" # Update
|
|
122
|
+
ansis.gray(" # Update workflow-related md files only / \u4EC5\u66F4\u65B0\u5DE5\u4F5C\u6D41\u76F8\u5173md\u6587\u4EF6"),
|
|
123
123
|
` ${ansis.cyan("npx zcf u")}`,
|
|
124
124
|
"",
|
|
125
|
-
ansis.gray(" # Force overwrite with Chinese config"),
|
|
125
|
+
ansis.gray(" # Force overwrite with Chinese config / \u5F3A\u5236\u4F7F\u7528\u4E2D\u6587\u914D\u7F6E\u8986\u76D6"),
|
|
126
126
|
` ${ansis.cyan("npx zcf -c zh-CN -f")}`,
|
|
127
127
|
` ${ansis.cyan("npx zcf --config-lang zh-CN --force")}`
|
|
128
128
|
].join("\n")
|
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, Z as ZCF_CONFIG_FILE, 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, Z as ZCF_CONFIG_FILE, 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.CUoxYhz9.mjs';
|
|
2
2
|
import '@posva/prompts';
|
|
3
3
|
import 'ansis';
|
|
4
4
|
import 'node:fs';
|
|
@@ -6,7 +6,7 @@ import { join, dirname } from 'pathe';
|
|
|
6
6
|
import dayjs from 'dayjs';
|
|
7
7
|
import { exec } from 'tinyexec';
|
|
8
8
|
|
|
9
|
-
const version = "1.1.
|
|
9
|
+
const version = "1.1.1";
|
|
10
10
|
|
|
11
11
|
const CLAUDE_DIR = join(homedir(), ".claude");
|
|
12
12
|
const SETTINGS_FILE = join(CLAUDE_DIR, "settings.json");
|
|
@@ -38,7 +38,7 @@ const I18N = {
|
|
|
38
38
|
enterApiKey: "\u8BF7\u8F93\u5165 API Key",
|
|
39
39
|
existingConfig: "\u68C0\u6D4B\u5230\u5DF2\u6709\u914D\u7F6E\u6587\u4EF6\uFF0C\u5982\u4F55\u5904\u7406\uFF1F",
|
|
40
40
|
backupAndOverwrite: "\u5907\u4EFD\u5E76\u8986\u76D6\u5168\u90E8",
|
|
41
|
-
updateDocsOnly: "\u4EC5\u66F4\u65B0
|
|
41
|
+
updateDocsOnly: "\u4EC5\u66F4\u65B0\u5DE5\u4F5C\u6D41\u76F8\u5173md\u5E76\u5907\u4EFD\u65E7\u914D\u7F6E",
|
|
42
42
|
mergeConfig: "\u5408\u5E76\u914D\u7F6E",
|
|
43
43
|
skip: "\u8DF3\u8FC7",
|
|
44
44
|
backupSuccess: "\u5DF2\u5907\u4EFD\u6240\u6709\u914D\u7F6E\u6587\u4EF6\u5230",
|
|
@@ -85,7 +85,7 @@ const I18N = {
|
|
|
85
85
|
enterApiKey: "Enter API Key",
|
|
86
86
|
existingConfig: "Existing config detected. How to proceed?",
|
|
87
87
|
backupAndOverwrite: "Backup and overwrite all",
|
|
88
|
-
updateDocsOnly: "Update
|
|
88
|
+
updateDocsOnly: "Update workflow-related md files only with backup",
|
|
89
89
|
mergeConfig: "Merge config",
|
|
90
90
|
skip: "Skip",
|
|
91
91
|
backupSuccess: "All config files backed up to",
|
package/package.json
CHANGED