zcf 2.4.1 → 2.5.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/README.md CHANGED
@@ -3,124 +3,126 @@
3
3
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
4
  [![Claude Code](https://img.shields.io/badge/Claude-Code-blue)](https://claude.ai/code)
5
5
  [![Version](https://img.shields.io/npm/v/zcf)](https://www.npmjs.com/package/zcf)
6
+ [![codecov](https://codecov.io/gh/UfoMiao/zcf/graph/badge.svg?token=HZI6K4Y7D7)](https://codecov.io/gh/UfoMiao/zcf)
7
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/UfoMiao/zcf)
6
8
 
7
- **中文** | [English](README_EN.md)
9
+ [中文](README_zh.md) | **English**
8
10
 
9
- > 零配置,一键搞定 Claude Code 环境设置 - 支持中英文双语配置、智能代理系统和个性化 AI 助手
11
+ > Zero-config, one-click setup for Claude Code with bilingual support, intelligent agent system and personalized AI assistant
10
12
 
11
- ![效果图](./src/assets/screenshot.webp)
13
+ ![Rendering](./src/assets/screenshot-en.webp)
12
14
 
13
- ## 🚀 快速开始
15
+ ## 🚀 Quick Start
14
16
 
15
- ### 🎯 推荐:使用交互式菜单(v2.0 新增)
17
+ ### 🎯 Recommended: Use Interactive Menu (v2.0 New)
16
18
 
17
19
  ```bash
18
- npx zcf # 打开交互式菜单,根据你的需求选择操作
20
+ npx zcf # Open interactive menu and choose operations based on your needs
19
21
  ```
20
22
 
21
- 菜单选项包括:
23
+ Menu options include:
22
24
 
23
- - `1` 完整初始化(等同于 `zcf i`)
24
- - `2` 导入工作流(等同于 `zcf u`)
25
- - `3-6` 配置管理(APIMCP、模型、AI 个性等)
26
- - 更多功能选项...
25
+ - `1` Full initialization (equivalent to `zcf i`)
26
+ - `2` Import workflows (equivalent to `zcf u`)
27
+ - `3-6` Configuration management (API, MCP, Model, AI personality, etc.)
28
+ - More features...
27
29
 
28
- ### 或者,直接使用命令:
30
+ ### Or, use direct commands:
29
31
 
30
- #### 🆕 首次使用 Claude Code
32
+ #### 🆕 First time using Claude Code
31
33
 
32
34
  ```bash
33
- npx zcf i # 直接执行完整初始化:安装 Claude Code + 导入工作流 + 配置 API + 设置 MCP 服务
34
- #
35
- npx zcf → 选择 1 # 通过菜单执行完整初始化
35
+ npx zcf i # Execute full initialization directly: Install Claude Code + Import workflows + Configure API + Set up MCP services
36
+ # or
37
+ npx zcf → select 1 # Execute full initialization via menu
36
38
  ```
37
39
 
38
- #### 🔄 已有 Claude Code 环境
40
+ #### 🔄 Already have Claude Code installed
39
41
 
40
42
  ```bash
41
- npx zcf u # 仅更新工作流:快速添加 AI 工作流和命令系统
42
- #
43
- npx zcf → 选择 2 # 通过菜单执行工作流更新
43
+ npx zcf u # Update workflows only: Quick add AI workflows and command system
44
+ # or
45
+ npx zcf → select 2 # Execute workflow update via menu
44
46
  ```
45
47
 
46
- > **提示**:
48
+ > **Note**:
47
49
  >
48
- > - v2.0 起,`zcf` 默认打开交互式菜单,提供可视化操作界面
49
- > - 你可以通过菜单选择操作,也可以直接使用命令快捷执行
50
- > - `zcf i` = 完整初始化,`zcf u` = 仅更新工作流
50
+ > - Since v2.0, `zcf` opens the interactive menu by default, providing a visual operation interface
51
+ > - You can choose operations through the menu or use commands directly for quick execution
52
+ > - `zcf i` = full initialization, `zcf u` = update workflows only
51
53
 
52
- ### 初始化流程
54
+ ### Setup Process
53
55
 
54
- 完整初始化(`npx zcf`)会自动:
56
+ Full initialization (`npx zcf`) will automatically:
55
57
 
56
- - ✅ 检测并安装 Claude Code
57
- - ✅ 选择 AI 输出语言(新增)
58
- - ✅ 配置 API 密钥
59
- - ✅ 选择并配置 MCP 服务
60
- - ✅ 设置所有必要的配置文件
58
+ - ✅ Detect and install Claude Code
59
+ - ✅ Select AI output language (new feature)
60
+ - ✅ Configure API keys
61
+ - ✅ Select and configure MCP services
62
+ - ✅ Set up all necessary configuration files
61
63
 
62
- ### 使用方式
64
+ ### Usage
63
65
 
64
- 配置完成后:
66
+ After configuration:
65
67
 
66
- - **项目第一次使用强烈建议先运行 `/init` 进行初始化,生成 CLAUDE.md 便于 AI 理解项目架构**
67
- - `<任务描述>` - 不使用任何工作流直接执行,会遵循 SOLIDKISSDRY YAGNI 原则,适合修复 Bug 等小任务
68
- - `/feat <任务描述>` - 开始新功能开发,分为 plan ui 两个阶段
69
- - `/workflow <任务描述>` - 执行完整开发工作流,不是自动化,开始会给出多套方案,每一步会询问用户意见,可随时修改方案,掌控力 MAX
68
+ - **For first-time project use, strongly recommend running `/init` to generate CLAUDE.md for better AI understanding of project architecture**
69
+ - `<task description>` - Execute directly without workflow, following SOLID, KISS, DRY, and YAGNI principles, suitable for small tasks like bug fixes
70
+ - `/feat <task description>` - Start new feature development, divided into plan and UI phases
71
+ - `/workflow <task description>` - Execute complete development workflow, not automated, starts with multiple solution options, asks for user feedback at each step, allows plan modifications, maximum control
70
72
 
71
73
  > **PS**:
72
74
  >
73
- > - feat workflow 这两套各有优势,可以都试试比较一下
74
- > - 生成的文档位置默认都是项目根目录下的 `.claude/xxx.md`,可以把 `.claude/` 加入项目的 `.gitignore`
75
+ > - Both feat and workflow have their advantages, try both to compare
76
+ > - Generated documents are located by default at `.claude/xxx.md` in project root, you can add `.claude/` to your project's `.gitignore`
75
77
 
76
- ## ✨ ZCF 工具特性
78
+ ## ✨ ZCF Tool Features
77
79
 
78
- ### 🌏 多语言支持
80
+ ### 🌏 Multi-language Support
79
81
 
80
- - 脚本交互语言:控制安装过程的提示语言
81
- - 配置文件语言:决定安装哪套配置文件(zh-CN/en
82
- - AI 输出语言:选择 AI 回复使用的语言(支持简体中文、English 及自定义语言)
83
- - AI 个性化:支持多种预设人格(专业助手、猫娘助手、友好助手、导师模式)或自定义
82
+ - Script interaction language: Controls installation prompts language
83
+ - Configuration file language: Determines which configuration set to install (zh-CN/en)
84
+ - AI output language: Choose the language for AI responses (supports Chinese, English, and custom languages)
85
+ - AI personality: Support multiple preset personalities (Professional, Catgirl, Friendly, Mentor) or custom
84
86
 
85
- ### 🔧 智能安装
87
+ ### 🔧 Smart Installation
86
88
 
87
- - 自动检测 Claude Code 安装状态
88
- - 使用 npm 进行自动安装(确保兼容性)
89
- - 跨平台支持(Windows/macOS/Linux/Termux
90
- - 自动配置 MCP 服务
91
- - 智能配置合并和部分修改支持(v2.0 新增)
92
- - 增强的命令检测机制(v2.1 新增)
93
- - 危险操作确认机制(v2.3 新增)
89
+ - Auto-detects Claude Code installation status
90
+ - Uses npm for automatic installation (ensures compatibility)
91
+ - Cross-platform support (Windows/macOS/Linux/Termux)
92
+ - Automatic MCP service configuration
93
+ - Smart configuration merging and partial modification support (v2.0 new)
94
+ - Enhanced command detection mechanism (v2.1 new)
95
+ - Dangerous operation confirmation mechanism (v2.3 new)
94
96
 
95
- ### 📦 完整配置
97
+ ### 📦 Complete Configuration
96
98
 
97
- - CLAUDE.md 系统指令
98
- - settings.json 设置文件
99
- - commands 自定义命令
100
- - agents AI 代理配置
99
+ - CLAUDE.md system instructions
100
+ - settings.json configuration file
101
+ - commands custom commands
102
+ - agents AI agent configurations
101
103
 
102
- ### 🔐 API 配置
104
+ ### 🔐 API Configuration
103
105
 
104
- - 支持两种认证方式:
105
- - **Auth Token**:适用于通过 OAuth 或浏览器登录获取的令牌
106
- - **API Key**:适用于从 Anthropic Console 获取的 API 密钥
107
- - 自定义 API URL 支持
108
- - 支持稍后在 claude 命令中配置
109
- - 部分修改功能:仅更新需要的配置项(v2.0 新增)
106
+ - Supports two authentication methods:
107
+ - **Auth Token**: For tokens obtained via OAuth or browser login
108
+ - **API Key**: For API keys from Anthropic Console
109
+ - Custom API URL support
110
+ - Support for manual configuration later
111
+ - Partial modification: Update only needed configuration items (v2.0 new)
110
112
 
111
- ### 💾 配置管理
113
+ ### 💾 Configuration Management
112
114
 
113
- - 智能备份现有配置(所有备份保存在 ~/.claude/backup/)
114
- - 配置合并选项(v2.0 增强:支持深度合并)
115
- - 安全的覆盖机制
116
- - MCP 配置修改前自动备份
117
- - 默认模型配置(v2.0 新增)
118
- - AI 记忆管理(v2.0 新增)
119
- - ZCF 缓存清理(v2.0 新增)
115
+ - Smart backup of existing configurations (all backups saved in ~/.claude/backup/)
116
+ - Configuration merge option (v2.0 enhanced: supports deep merge)
117
+ - Safe overwrite mechanism
118
+ - Automatic backup before MCP configuration changes
119
+ - Default model configuration (v2.0 new)
120
+ - AI memory management (v2.0 new)
121
+ - ZCF cache cleanup (v2.0 new)
120
122
 
121
- ## 📖 使用说明
123
+ ## 📖 Usage Instructions
122
124
 
123
- ### 交互式菜单(v2.0
125
+ ### Interactive Menu (v2.0)
124
126
 
125
127
  ```bash
126
128
  $ npx zcf
@@ -131,283 +133,283 @@ $ npx zcf
131
133
  ❯ 简体中文
132
134
  English
133
135
 
134
- 请选择功能:
136
+ Select function:
135
137
  -------- Claude Code --------
136
- 1. 完整初始化配置 - 安装并配置所有内容
137
- 2. 导入工作流 - 更新 AI 工作流和命令
138
- 3. 配置 API - 管理 API 认证
139
- 4. 配置 MCP 服务 - 管理 MCP 集成
140
- 5. 配置默认模型 - 设置默认 AI 模型
141
- 6. 配置 AI 个性 - 设置 AI 助手人格
142
- 7. 配置 AI 记忆 - 管理 AI 记忆设置
138
+ 1. Full initialization - Install and configure everything
139
+ 2. Import workflows - Update AI workflows and commands
140
+ 3. Configure API - Manage API authentication
141
+ 4. Configure MCP services - Manage MCP integrations
142
+ 5. Configure default model - Set default AI model
143
+ 6. Configure AI personality - Set AI assistant personality
144
+ 7. Configure AI memory - Set up AI memory management
143
145
 
144
146
  ------------ ZCF ------------
145
- 0. 更改语言 - 切换界面语言
146
- -. 清理缓存 - 清理 ZCF 缓存文件
147
- q. 退出
147
+ 0. Change language - Switch interface language
148
+ -. Clear cache - Clear ZCF cache files
149
+ q. Exit
148
150
 
149
- 请输入选择: _
151
+ Enter your choice: _
150
152
  ```
151
153
 
152
- ### 完整初始化流程(选择 1 或使用 `zcf i`)
154
+ ### Full Initialization Flow (Select 1 or use `zcf i`)
153
155
 
154
156
  ```bash
155
- ? 选择 Claude Code 配置语言:
156
- ❯ 简体中文 (zh-CN) - 中文版(便于中文用户自定义)
157
- English (en) - 英文版(推荐,token 消耗更低)
157
+ ? Select Claude Code configuration language:
158
+ ❯ 简体中文 (zh-CN) - Chinese (easier for Chinese users to customize)
159
+ English (en) - English (recommended, lower token consumption)
158
160
 
159
- ? 选择 AI 输出语言:
160
- AI 将使用此语言回复你的问题
161
+ ? Select AI output language:
162
+ AI will respond to you in this language
161
163
  ❯ 简体中文
162
164
  English
163
165
  Custom
164
- (支持日语、法语、德语等多种语言)
166
+ (Supports Japanese, French, German, and more)
165
167
 
166
- ? 选择 AI 个性化设置:
167
- 专业助手(默认)
168
- 猫娘助手
169
- 友好助手
170
- 导师模式
171
- 自定义
168
+ ? Select AI personality:
169
+ Professional Assistant(Default)
170
+ Catgirl Assistant
171
+ Friendly Assistant
172
+ Mentor Mode
173
+ Custom
172
174
 
173
- ? 检测到 Claude Code 未安装,是否自动安装?(Y/n)
175
+ ? Claude Code not found. Install automatically? (Y/n)
174
176
 
175
- ✔ Claude Code 安装成功
177
+ ✔ Claude Code installed successfully
176
178
 
177
- ? 选择 API 认证方式
178
- 使用 Auth Token (OAuth 认证)
179
- 适用于通过 OAuth 或浏览器登录获取的令牌
180
- 使用 API Key (密钥认证)
181
- 适用于从 Anthropic Console 获取的 API 密钥
182
- 跳过(稍后手动配置)
179
+ ? Select API authentication method
180
+ Use Auth Token (OAuth authentication)
181
+ For tokens obtained via OAuth or browser login
182
+ Use API Key (Key authentication)
183
+ For API keys from Anthropic Console
184
+ Skip (configure manually later)
183
185
 
184
- ? 请输入 API URL: https://api.anthropic.com
185
- ? 请输入 Auth Token API Key: xxx
186
+ ? Enter API URL: https://api.anthropic.com
187
+ ? Enter Auth Token or API Key: xxx
186
188
 
187
- ? 检测到已有配置文件,如何处理?
188
- 备份并覆盖全部
189
- 仅更新工作流相关md并备份旧配置
190
- 合并配置
191
- 跳过
189
+ ? Existing config detected. How to proceed?
190
+ Backup and overwrite all
191
+ Update workflow-related md files only with backup
192
+ Merge config
193
+ Skip
192
194
 
193
- 已备份所有配置文件到 ~/.claude/backup/xxx
194
- 配置文件已复制到 ~/.claude
195
- ✔ API 配置完成
195
+ All config files backed up to ~/.claude/backup/xxx
196
+ Config files copied to ~/.claude
197
+ ✔ API configured
196
198
 
197
- ? 是否配置 MCP 服务?(Y/n)
199
+ ? Configure MCP services? (Y/n)
198
200
 
199
- ? 选择要安装的 MCP 服务(空格选择,回车确认)
200
- ❯ ◯ 全部安装
201
- ◯ Context7 文档查询 - 查询最新的库文档和代码示例
202
- ◯ DeepWiki - 查询 GitHub 仓库文档和示例
203
- ◯ Playwright 浏览器控制 - 直接控制浏览器进行自动化操作
204
- ◯ Exa AI 搜索 - 使用 Exa AI 进行网页搜索
201
+ ? Select MCP services to install (space to select, enter to confirm)
202
+ ❯ ◯ Install all
203
+ ◯ Context7 Documentation Query - Query latest library docs and code examples
204
+ ◯ DeepWiki - Query GitHub repository docs and examples
205
+ ◯ Playwright Browser Control - Direct browser automation control
206
+ ◯ Exa AI Search - Web search using Exa AI
205
207
 
206
- ? 请输入 Exa API Key(可从 https://dashboard.exa.ai/api-keys 获取)
208
+ ? Enter Exa API Key (get from https://dashboard.exa.ai/api-keys)
207
209
 
208
- ✔ MCP 服务已配置
210
+ ✔ MCP services configured
209
211
 
210
- 🎉 配置完成!使用 'claude' 命令开始体验。
212
+ 🎉 Setup complete! Use 'claude' command to start.
211
213
  ```
212
214
 
213
- ### 命令行参数
215
+ ### Command Line Options
214
216
 
215
- #### 命令速查表
217
+ #### Commands Quick Reference
216
218
 
217
- | 命令 | 缩写 | 说明 |
218
- | ------------ | ------- | ------------------------------- |
219
- | `zcf` | - | 显示交互式菜单(v2.0 默认命令) |
220
- | `zcf init` | `zcf i` | 初始化 Claude Code 配置 |
221
- | `zcf update` | `zcf u` | 更新 Prompt 文档并备份旧配置 |
219
+ | Command | Alias | Description |
220
+ | ------------ | ------- | -------------------------------------------- |
221
+ | `zcf` | - | Show interactive menu (v2.0 default command) |
222
+ | `zcf init` | `zcf i` | Initialize Claude Code configuration |
223
+ | `zcf update` | `zcf u` | Update workflow-related md files with backup |
222
224
 
223
- #### 常用选项
225
+ #### Common Options
224
226
 
225
227
  ```bash
226
- # 指定配置语言
228
+ # Specify configuration language
227
229
  npx zcf --config-lang zh-CN
228
- npx zcf -c zh-CN # 使用缩写
230
+ npx zcf -c zh-CN # Using short option
229
231
 
230
- # 强制覆盖现有配置
232
+ # Force overwrite existing configuration
231
233
  npx zcf --force
232
- npx zcf -f # 使用缩写
234
+ npx zcf -f # Using short option
233
235
 
234
- # 更新 Prompt 文档并备份旧配置(保留 API MCP 配置)
235
- npx zcf u # 使用 update 命令
236
- npx zcf update # 完整命令
236
+ # Update workflow-related md files with backup (preserve API and MCP configs)
237
+ npx zcf u # Using update command
238
+ npx zcf update # Full command
237
239
 
238
- # 查看帮助信息
240
+ # Show help information
239
241
  npx zcf --help
240
242
  npx zcf -h
241
243
 
242
- # 查看版本
244
+ # Show version
243
245
  npx zcf --version
244
246
  npx zcf -v
245
247
  ```
246
248
 
247
- #### 使用示例
249
+ #### Usage Examples
248
250
 
249
251
  ```bash
250
- # 显示交互式菜单(默认)
252
+ # Show interactive menu (default)
251
253
  npx zcf
252
254
 
253
- # 首次安装,完整初始化
255
+ # First-time installation, complete initialization
254
256
  npx zcf i
255
- npx zcf init # 完整命令
257
+ npx zcf init # Full command
256
258
 
257
- # 更新 Prompt 文档并备份旧配置,保留 API MCP 配置
259
+ # Update workflow-related md files with backup, keep API and MCP configs
258
260
  npx zcf u
259
- npx zcf update # 完整命令
261
+ npx zcf update # Full command
260
262
 
261
- # 强制使用中文配置重新初始化
263
+ # Force reinitialize with Chinese config
262
264
  npx zcf i --config-lang zh-CN --force
263
- npx zcf i -c zh-CN -f # 使用缩写
265
+ npx zcf i -c zh-CN -f # Using short options
264
266
 
265
- # 更新到英文版 Prompt(降低 token 消耗)
267
+ # Update to English prompts (lower token consumption)
266
268
  npx zcf u --config-lang en
267
- npx zcf u -c en # 使用缩写
269
+ npx zcf u -c en # Using short option
268
270
  ```
269
271
 
270
- ## 📁 项目结构
272
+ ## 📁 Project Structure
271
273
 
272
274
  ```
273
- claude-code-config/
274
- ├── README.md # 说明文档
275
- ├── package.json # npm 包配置
275
+ zcf/
276
+ ├── README.md # Documentation
277
+ ├── package.json # npm package configuration
276
278
  ├── bin/
277
- │ └── zcf.mjs # CLI 入口
278
- ├── src/ # 源代码
279
- │ ├── cli.ts # CLI 主逻辑
280
- │ ├── commands/ # 命令实现
281
- │ ├── utils/ # 工具函数
282
- │ └── constants.ts # 常量定义
283
- ├── templates/ # 配置模板
284
- │ ├── CLAUDE.md # 项目级配置(v2.0新增)
285
- │ ├── settings.json # 基础配置(含隐私保护环境变量)
286
- │ ├── en/ # 英文版
287
- │ │ ├── rules.md # 核心原则(原CLAUDE.md
288
- │ │ ├── personality.md # AI个性化(v2.0新增)
289
- │ │ ├── mcp.md # MCP服务说明(v2.0新增)
290
- │ │ ├── agents/ # AI 代理
291
- │ │ └── commands/ # 命令定义
292
- │ └── zh-CN/ # 中文版
293
- │ └── ... (相同结构)
294
- └── dist/ # 构建输出
279
+ │ └── zcf.mjs # CLI entry point
280
+ ├── src/ # Source code
281
+ │ ├── cli.ts # CLI main logic
282
+ │ ├── commands/ # Command implementations
283
+ │ ├── utils/ # Utility functions
284
+ │ └── constants.ts # Constant definitions
285
+ ├── templates/ # Configuration templates
286
+ │ ├── CLAUDE.md # Project level config (v2.0 new)
287
+ │ ├── settings.json # Base configuration (with privacy env vars)
288
+ │ ├── en/ # English version
289
+ │ │ ├── rules.md # Core principles (formerly CLAUDE.md)
290
+ │ │ ├── personality.md # AI personality (v2.0 new)
291
+ │ │ ├── mcp.md # MCP services guide (v2.0 new)
292
+ │ │ ├── agents/ # AI agents
293
+ │ │ └── commands/ # Command definitions
294
+ │ └── zh-CN/ # Chinese version
295
+ │ └── ... (same structure)
296
+ └── dist/ # Build output
295
297
  ```
296
298
 
297
- ## ✨ 核心特性(v2.0 增强)
299
+ ## ✨ Core Features (v2.0 Enhanced)
298
300
 
299
- ### 🤖 专业代理
301
+ ### 🤖 Professional Agents
300
302
 
301
- - **任务规划师**:将复杂任务拆解为可执行步骤
302
- - **UI/UX 设计师**:提供专业界面设计指导
303
- - **AI 个性化**:支持多种预设人格和自定义(v2.0 新增)
303
+ - **Task Planner**: Breaks down complex tasks into executable steps
304
+ - **UI/UX Designer**: Provides professional interface design guidance
305
+ - **AI Personality**: Support multiple preset personalities and custom (v2.0 new)
304
306
 
305
- ### ⚡ 命令系统
307
+ ### ⚡ Command System
306
308
 
307
- - **功能开发** (`/feat`):结构化新功能开发
308
- - **工作流** (`/workflow`):完整的六阶段开发流程
309
+ - **Feature Development** (`/feat`): Structured new feature development
310
+ - **Workflow** (`/workflow`): Complete six-phase development workflow
309
311
 
310
- ### 🔧 智能配置
312
+ ### 🔧 Smart Configuration
311
313
 
312
- - API 密钥管理(支持部分修改)
313
- - 细粒度权限控制
314
- - 多种 Claude 模型支持(可配置默认模型)
315
- - 交互式菜单系统(v2.0 新增)
316
- - AI 记忆管理(v2.0 新增)
314
+ - API key management (supports partial modification)
315
+ - Fine-grained permission control
316
+ - Multiple Claude model support (configurable default model)
317
+ - Interactive menu system (v2.0 new)
318
+ - AI memory management (v2.0 new)
317
319
 
318
- ## 🎯 开发工作流
320
+ ## 🎯 Development Workflow
319
321
 
320
- ### 六阶段工作流
322
+ ### Six-Phase Workflow
321
323
 
322
- 1. [模式:研究] - 理解需求
323
- 2. [模式:构思] - 设计方案
324
- 3. [模式:计划] - 制定详细计划
325
- 4. [模式:执行] - 实施开发
326
- 5. [模式:优化] - 提升质量
327
- 6. [模式:评审] - 最终评估
324
+ 1. [Mode: Research] - Understand requirements
325
+ 2. [Mode: Ideate] - Design solutions
326
+ 3. [Mode: Plan] - Create detailed plan
327
+ 4. [Mode: Execute] - Implement development
328
+ 5. [Mode: Optimize] - Improve quality
329
+ 6. [Mode: Review] - Final assessment
328
330
 
329
- ## 🛠️ 开发
331
+ ## 🛠️ Development
330
332
 
331
333
  ```bash
332
- # 克隆项目
334
+ # Clone the project
333
335
  git clone https://github.com/UfoMiao/zcf.git
334
336
  cd zcf
335
337
 
336
- # 安装依赖(使用 pnpm
338
+ # Install dependencies (using pnpm)
337
339
  pnpm install
338
340
 
339
- # 构建项目
341
+ # Build project
340
342
  pnpm build
341
343
 
342
- # 本地测试
344
+ # Local testing
343
345
  node bin/zcf.mjs
344
346
  ```
345
347
 
346
- ## 💡 最佳实践
348
+ ## 💡 Best Practices
347
349
 
348
- 1. **任务分解**:保持任务独立可测试
349
- 2. **代码质量**:遵循 SOLIDKISSDRY YAGNI 原则
350
- 3. **文档管理**:计划存储在项目根目录的`.claude/plan/` 目录下
350
+ 1. **Task Breakdown**: Keep tasks independent and testable
351
+ 2. **Code Quality**: Follow SOLID, KISS, DRY, and YAGNI principles
352
+ 3. **Documentation Management**: The plan will be stored in the `.claude/plan/` directory at the project root
351
353
 
352
- ## 🔧 故障排除
354
+ ## 🔧 Troubleshooting
353
355
 
354
- 如果遇到问题,可以:
356
+ If you encounter issues:
355
357
 
356
- 1. 重新运行 `npx zcf` 重新配置
357
- 2. 检查 `~/.claude/` 目录下的配置文件
358
- 3. 确保 Claude Code 已正确安装
359
- 4. 如果路径包含空格,ZCF 会自动处理引号包裹
360
- 5. 优先使用 ripgrep (`rg`) 进行文件搜索以获得更好性能
358
+ 1. Re-run `npx zcf` to reconfigure
359
+ 2. Check configuration files in `~/.claude/` directory
360
+ 3. Ensure Claude Code is properly installed
361
+ 4. If paths contain spaces, ZCF will automatically handle quote wrapping
362
+ 5. Use ripgrep (`rg`) preferentially for file searching for better performance
361
363
 
362
- ### 跨平台支持
364
+ ### Cross-Platform Support
363
365
 
364
- #### Windows 平台
366
+ #### Windows Platform
365
367
 
366
- ZCF 已完全支持 Windows 平台:
368
+ ZCF fully supports Windows platform:
367
369
 
368
- - **自动检测**:在 Windows 系统上会自动使用兼容的 `cmd /c npx` 格式
369
- - **配置修复**:现有的错误配置会在更新时自动修复
370
- - **零配置**:Windows 用户无需任何额外操作,与 macOS/Linux 体验一致
370
+ - **Auto-detection**: Automatically uses compatible `cmd /c npx` format on Windows systems
371
+ - **Config repair**: Existing incorrect configurations are automatically fixed during updates
372
+ - **Zero-config**: Windows users don't need any extra steps, same experience as macOS/Linux
371
373
 
372
- 如果在 Windows 上遇到 MCP 连接问题,运行 `npx zcf` 会自动修复配置格式。
374
+ If you encounter MCP connection issues on Windows, running `npx zcf` will automatically fix the configuration format.
373
375
 
374
- #### Termux 支持(v2.1 新增)
376
+ #### Termux Support (v2.1 new)
375
377
 
376
- ZCF 现已支持在 Android Termux 环境中运行:
378
+ ZCF now supports running in Android Termux environment:
377
379
 
378
- - **自动适配**:自动检测 Termux 环境并使用兼容配置
379
- - **增强检测**:智能识别可用命令,确保在受限环境中正常工作
380
- - **完整功能**:在 Termux 中享受与桌面系统相同的完整功能
380
+ - **Auto-adaptation**: Automatically detects Termux environment and uses compatible configuration
381
+ - **Enhanced detection**: Intelligently identifies available commands, ensuring normal operation in restricted environments
382
+ - **Full functionality**: Enjoy the same complete features in Termux as on desktop systems
381
383
 
382
- ### 安全特性(v2.3 新增)
384
+ ### Security Features (v2.3 new)
383
385
 
384
- #### 危险操作确认机制
386
+ #### Dangerous Operation Confirmation Mechanism
385
387
 
386
- 为保护用户数据安全,以下操作需要明确确认:
388
+ To protect user data security, the following operations require explicit confirmation:
387
389
 
388
- - **文件系统**:删除文件/目录、批量修改、移动系统文件
389
- - **代码提交**:`git commit`、`git push`、`git reset --hard`
390
- - **系统配置**:修改环境变量、系统设置、权限变更
391
- - **数据操作**:数据库删除、模式更改、批量更新
392
- - **网络请求**:发送敏感数据、调用生产环境 API
393
- - **包管理**:全局安装/卸载、更新核心依赖
390
+ - **File System**: Delete files/directories, bulk modifications, move system files
391
+ - **Code Commits**: `git commit`, `git push`, `git reset --hard`
392
+ - **System Config**: Modify environment variables, system settings, permissions
393
+ - **Data Operations**: Database deletions, schema changes, bulk updates
394
+ - **Network Requests**: Send sensitive data, call production APIs
395
+ - **Package Management**: Global install/uninstall, update core dependencies
394
396
 
395
- ## 🙏 鸣谢
397
+ ## 🙏 Acknowledgments
396
398
 
397
- 本项目的部分 Prompt 参考了以下优秀作品:
399
+ Some prompts in this project are inspired by the following excellent works:
398
400
 
399
- - [Linux.do - 分享一个让 AI 只生成必要的代码的通用 Prompt,欢迎一起调优~](https://linux.do/t/topic/830802)
400
- - [Linux.do - claude code 降智不怕,使用 agent command 结合将任务做详细的拆分大概可以帮助到你](https://linux.do/t/topic/815230)
401
- - [Linux.do - cursor 快速开发规则](https://linux.do/t/topic/697566)
401
+ - [Linux.do - Share a universal Prompt for AI to generate only necessary code, welcome to optimize together~](https://linux.do/t/topic/830802)
402
+ - [Linux.do - Don't worry about claude code degradation, using agent and command combination to break down tasks in detail may help you](https://linux.do/t/topic/815230)
403
+ - [Linux.do - cursor rapid development rules](https://linux.do/t/topic/697566)
402
404
 
403
- 感谢这些社区贡献者的分享!
405
+ Thanks to these community contributors for sharing!
404
406
 
405
- ## 📄 许可证
407
+ ## 📄 License
406
408
 
407
- MIT 许可证
409
+ MIT License
408
410
 
409
411
  ---
410
412
 
411
- 如果这个项目对你有帮助,请给我一个 ⭐️ Star
413
+ If this project helps you, please give me a ⭐️ Star!
412
414
 
413
- [![Star History Chart](https://api.star-history.com/svg?repos=UfoMiao/claude-code-config&type=Date)](https://star-history.com/#UfoMiao/claude-code-config&Date)
415
+ [![Star History Chart](https://api.star-history.com/svg?repos=UfoMiao/zcf&type=Date)](https://star-history.com/#UfoMiao/zcf&Date)
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import ansis from 'ansis';
3
2
  import cac from 'cac';
4
- import { h as SUPPORTED_LANGS, I as I18N, L as LANG_LABELS, G as updateZcfConfig, Z as ZCF_CONFIG_FILE, o as openSettingsJson, b as importRecommendedPermissions, a as importRecommendedEnv, H as readZcfConfig, J as resolveAiOutputLanguage, v as applyAiLanguageDirective, K as configureAiPersonality, u as updateDefaultModel, N as isWindows, x as readMcpConfig, E as fixWindowsMcpConfig, y as writeMcpConfig, O as selectMcpServices, z as backupMcpConfig, M as MCP_SERVICES, D as buildMcpServerConfig, B as mergeMcpServers, t as getExistingApiConfig, P as formatApiKeyDisplay, Q as modifyApiConfigPartially, R as validateApiKey, q as configureApi, T as displayBanner, U as selectScriptLanguage, S as SETTINGS_FILE, V as updatePromptOnly, W as version, X as handleExitPromptError, Y as handleGeneralError, _ as displayBannerWithInfo, i as init } from './shared/zcf.CYdvtE_u.mjs';
3
+ import ansis from 'ansis';
4
+ import { h as SUPPORTED_LANGS, I as I18N, L as LANG_LABELS, G as updateZcfConfig, Z as ZCF_CONFIG_FILE, o as openSettingsJson, b as importRecommendedPermissions, a as importRecommendedEnv, H as readZcfConfig, J as resolveAiOutputLanguage, v as applyAiLanguageDirective, K as configureAiPersonality, u as updateDefaultModel, N as isWindows, x as readMcpConfig, E as fixWindowsMcpConfig, y as writeMcpConfig, O as selectMcpServices, z as backupMcpConfig, M as MCP_SERVICES, D as buildMcpServerConfig, B as mergeMcpServers, t as getExistingApiConfig, P as formatApiKeyDisplay, Q as modifyApiConfigPartially, R as validateApiKey, q as configureApi, T as displayBanner, U as selectScriptLanguage, S as SETTINGS_FILE, V as updatePromptOnly, W as version, X as handleExitPromptError, Y as handleGeneralError, _ as displayBannerWithInfo, i as init } from './shared/zcf.DnmrEWlk.mjs';
5
5
  import inquirer from 'inquirer';
6
6
  import { existsSync, unlinkSync } from 'node:fs';
7
7
  import 'pathe';
@@ -149,7 +149,7 @@ async function configureMcpFeature(scriptLang) {
149
149
  validate: (value) => !!value || i18n.keyRequired
150
150
  });
151
151
  if (apiKey) {
152
- config = buildMcpServerConfig(service.config, apiKey, service.apiKeyPlaceholder);
152
+ config = buildMcpServerConfig(service.config, apiKey, service.apiKeyPlaceholder, service.apiKeyEnvVar);
153
153
  } else {
154
154
  continue;
155
155
  }
@@ -470,8 +470,20 @@ async function showMainMenu() {
470
470
  }
471
471
  }
472
472
 
473
- const cli = cac("zcf");
474
- cli.command("[lang]", "Show interactive menu (default)").option("--init", "Run full initialization directly").option("--config-lang, -c <lang>", "Configuration language (zh-CN, en)").option("--force, -f", "Force overwrite existing configuration").action(async (lang, options) => {
473
+ function setupCommands(cli) {
474
+ cli.command("[lang]", "Show interactive menu (default)").option("--init", "Run full initialization directly").option("--config-lang, -c <lang>", "Configuration language (zh-CN, en)").option("--force, -f", "Force overwrite existing configuration").action(async (lang, options) => {
475
+ await handleDefaultCommand(lang, options);
476
+ });
477
+ cli.command("init", "Initialize Claude Code configuration").alias("i").option("--lang, -l <lang>", "ZCF display language (zh-CN, en)").option("--config-lang, -c <lang>", "Configuration language (zh-CN, en)").option("--ai-output-lang, -a <lang>", "AI output language").option("--force, -f", "Force overwrite existing configuration").action(async (options) => {
478
+ await handleInitCommand(options);
479
+ });
480
+ cli.command("update", "Update Claude Code prompts only").alias("u").option("--config-lang, -c <lang>", "Configuration language (zh-CN, en)").action(async (options) => {
481
+ await handleUpdateCommand(options);
482
+ });
483
+ cli.help((sections) => customizeHelp(sections));
484
+ cli.version(version);
485
+ }
486
+ async function handleDefaultCommand(lang, options) {
475
487
  if (options.init) {
476
488
  await init({
477
489
  lang: lang || options.lang,
@@ -481,19 +493,19 @@ cli.command("[lang]", "Show interactive menu (default)").option("--init", "Run f
481
493
  } else {
482
494
  await showMainMenu();
483
495
  }
484
- });
485
- cli.command("init", "Initialize Claude Code configuration").alias("i").option("--lang, -l <lang>", "ZCF display language (zh-CN, en)").option("--config-lang, -c <lang>", "Configuration language (zh-CN, en)").option("--ai-output-lang, -a <lang>", "AI output language").option("--force, -f", "Force overwrite existing configuration").action(async (options) => {
496
+ }
497
+ async function handleInitCommand(options) {
486
498
  await init({
487
499
  lang: options.lang,
488
500
  configLang: options.configLang,
489
501
  aiOutputLang: options.aiOutputLang,
490
502
  force: options.force
491
503
  });
492
- });
493
- cli.command("update", "Update Claude Code prompts only").alias("u").option("--config-lang, -c <lang>", "Configuration language (zh-CN, en)").action(async (options) => {
504
+ }
505
+ async function handleUpdateCommand(options) {
494
506
  await update({ configLang: options.configLang });
495
- });
496
- cli.help((sections) => {
507
+ }
508
+ function customizeHelp(sections) {
497
509
  sections.unshift({
498
510
  title: "",
499
511
  body: ansis.cyan.bold(`ZCF - Zero-Config Claude-Code Flow v${version}`)
@@ -542,6 +554,8 @@ cli.help((sections) => {
542
554
  ].join("\n")
543
555
  });
544
556
  return sections;
545
- });
546
- cli.version(version);
557
+ }
558
+
559
+ const cli = cac("zcf");
560
+ setupCommands(cli);
547
561
  cli.parse();
package/dist/index.d.mts CHANGED
@@ -14,6 +14,7 @@ interface McpService {
14
14
  'zh-CN': string;
15
15
  };
16
16
  apiKeyPlaceholder?: string;
17
+ apiKeyEnvVar?: string;
17
18
  config: McpServerConfig;
18
19
  }
19
20
  interface McpServerConfig {
@@ -446,7 +447,7 @@ declare function readMcpConfig(): ClaudeConfiguration | null;
446
447
  declare function writeMcpConfig(config: ClaudeConfiguration): void;
447
448
  declare function backupMcpConfig(): string | null;
448
449
  declare function mergeMcpServers(existing: ClaudeConfiguration | null, newServers: Record<string, McpServerConfig>): ClaudeConfiguration;
449
- declare function buildMcpServerConfig(baseConfig: McpServerConfig, apiKey?: string, placeholder?: string): McpServerConfig;
450
+ declare function buildMcpServerConfig(baseConfig: McpServerConfig, apiKey?: string, placeholder?: string, envVarName?: string): McpServerConfig;
450
451
  declare function fixWindowsMcpConfig(config: ClaudeConfiguration): ClaudeConfiguration;
451
452
  declare function addCompletedOnboarding(): void;
452
453
 
package/dist/index.d.ts CHANGED
@@ -14,6 +14,7 @@ interface McpService {
14
14
  'zh-CN': string;
15
15
  };
16
16
  apiKeyPlaceholder?: string;
17
+ apiKeyEnvVar?: string;
17
18
  config: McpServerConfig;
18
19
  }
19
20
  interface McpServerConfig {
@@ -446,7 +447,7 @@ declare function readMcpConfig(): ClaudeConfiguration | null;
446
447
  declare function writeMcpConfig(config: ClaudeConfiguration): void;
447
448
  declare function backupMcpConfig(): string | null;
448
449
  declare function mergeMcpServers(existing: ClaudeConfiguration | null, newServers: Record<string, McpServerConfig>): ClaudeConfiguration;
449
- declare function buildMcpServerConfig(baseConfig: McpServerConfig, apiKey?: string, placeholder?: string): McpServerConfig;
450
+ declare function buildMcpServerConfig(baseConfig: McpServerConfig, apiKey?: string, placeholder?: string, envVarName?: string): McpServerConfig;
450
451
  declare function fixWindowsMcpConfig(config: ClaudeConfiguration): ClaudeConfiguration;
451
452
  declare function addCompletedOnboarding(): void;
452
453
 
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AI_OUTPUT_LANGUAGES, C as CLAUDE_DIR, e as CLAUDE_MD_FILE, f as ClAUDE_CONFIG_FILE, I as I18N, L as LANG_LABELS, M as MCP_SERVICES, S as SETTINGS_FILE, h as SUPPORTED_LANGS, Z as ZCF_CONFIG_FILE, F as addCompletedOnboarding, v as applyAiLanguageDirective, n as backupExistingConfig, z as backupMcpConfig, D as buildMcpServerConfig, d as cleanupPermissions, c as commandExists, q as configureApi, p as copyConfigFiles, l as ensureClaudeDir, E as fixWindowsMcpConfig, t as getExistingApiConfig, w as getMcpConfigPath, g as getPlatform, a as importRecommendedEnv, b as importRecommendedPermissions, i as init, k as installClaudeCode, j as isClaudeCodeInstalled, m as mergeAndCleanPermissions, r as mergeConfigs, B as mergeMcpServers, s as mergeSettingsFile, o as openSettingsJson, x as readMcpConfig, u as updateDefaultModel, y as writeMcpConfig } from './shared/zcf.CYdvtE_u.mjs';
1
+ export { A as AI_OUTPUT_LANGUAGES, C as CLAUDE_DIR, e as CLAUDE_MD_FILE, f as ClAUDE_CONFIG_FILE, I as I18N, L as LANG_LABELS, M as MCP_SERVICES, S as SETTINGS_FILE, h as SUPPORTED_LANGS, Z as ZCF_CONFIG_FILE, F as addCompletedOnboarding, v as applyAiLanguageDirective, n as backupExistingConfig, z as backupMcpConfig, D as buildMcpServerConfig, d as cleanupPermissions, c as commandExists, q as configureApi, p as copyConfigFiles, l as ensureClaudeDir, E as fixWindowsMcpConfig, t as getExistingApiConfig, w as getMcpConfigPath, g as getPlatform, a as importRecommendedEnv, b as importRecommendedPermissions, i as init, k as installClaudeCode, j as isClaudeCodeInstalled, m as mergeAndCleanPermissions, r as mergeConfigs, B as mergeMcpServers, s as mergeSettingsFile, o as openSettingsJson, x as readMcpConfig, u as updateDefaultModel, y as writeMcpConfig } from './shared/zcf.DnmrEWlk.mjs';
2
2
  import 'inquirer';
3
3
  import 'ansis';
4
4
  import 'node:fs';
@@ -7,7 +7,7 @@ import { fileURLToPath } from 'node:url';
7
7
  import { exec } from 'tinyexec';
8
8
  import { homedir, platform } from 'node:os';
9
9
 
10
- const version = "2.4.1";
10
+ const version = "2.5.1";
11
11
  const homepage = "https://github.com/UfoMiao/zcf";
12
12
 
13
13
  const CLAUDE_DIR = join(homedir(), ".claude");
@@ -465,12 +465,14 @@ const MCP_SERVICES = [
465
465
  "zh-CN": "\u8BF7\u8F93\u5165 Exa API Key",
466
466
  en: "Enter Exa API Key"
467
467
  },
468
- apiKeyPlaceholder: "YOUR_EXA_API_KEY",
468
+ apiKeyEnvVar: "EXA_API_KEY",
469
469
  config: {
470
470
  type: "stdio",
471
471
  command: "npx",
472
- args: ["-y", "mcp-remote", "https://mcp.exa.ai/mcp?exaApiKey=YOUR_EXA_API_KEY"],
473
- env: {}
472
+ args: ["-y", "exa-mcp-server"],
473
+ env: {
474
+ EXA_API_KEY: "YOUR_EXA_API_KEY"
475
+ }
474
476
  }
475
477
  }
476
478
  ];
@@ -1391,12 +1393,16 @@ function applyPlatformCommand(config) {
1391
1393
  config.args = [...mcpCmd.slice(1), ...config.args || []];
1392
1394
  }
1393
1395
  }
1394
- function buildMcpServerConfig(baseConfig, apiKey, placeholder = "YOUR_EXA_API_KEY") {
1396
+ function buildMcpServerConfig(baseConfig, apiKey, placeholder = "YOUR_EXA_API_KEY", envVarName) {
1395
1397
  const config = deepClone(baseConfig);
1396
1398
  applyPlatformCommand(config);
1397
1399
  if (!apiKey) {
1398
1400
  return config;
1399
1401
  }
1402
+ if (envVarName && config.env) {
1403
+ config.env[envVarName] = apiKey;
1404
+ return config;
1405
+ }
1400
1406
  if (config.args) {
1401
1407
  config.args = config.args.map((arg) => arg.replace(placeholder, apiKey));
1402
1408
  }
@@ -1742,7 +1748,7 @@ async function init(options = {}) {
1742
1748
  continue;
1743
1749
  }
1744
1750
  if (apiKey) {
1745
- config = buildMcpServerConfig(service.config, apiKey, service.apiKeyPlaceholder);
1751
+ config = buildMcpServerConfig(service.config, apiKey, service.apiKeyPlaceholder, service.apiKeyEnvVar);
1746
1752
  } else {
1747
1753
  continue;
1748
1754
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zcf",
3
3
  "type": "module",
4
- "version": "2.4.1",
4
+ "version": "2.5.1",
5
5
  "description": "Zero-Config Claude-Code Flow - One-click configuration tool for Claude Code",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/UfoMiao/zcf",
@@ -33,9 +33,12 @@
33
33
  "@changesets/cli": "^2.29.5",
34
34
  "@types/inquirer": "^9.0.8",
35
35
  "@types/node": "^22.17.0",
36
+ "@vitest/coverage-v8": "^3.2.4",
37
+ "@vitest/ui": "^3.2.4",
36
38
  "tsx": "^4.20.3",
37
39
  "typescript": "^5.9.2",
38
- "unbuild": "^3.6.0"
40
+ "unbuild": "^3.6.0",
41
+ "vitest": "^3.2.4"
39
42
  },
40
43
  "keywords": [
41
44
  "claude",
@@ -54,7 +57,11 @@
54
57
  "dev": "tsx ./src/cli.ts",
55
58
  "build": "unbuild",
56
59
  "typecheck": "tsc",
57
- "test": "npm run build && node bin/zcf.mjs",
60
+ "test": "vitest",
61
+ "test:ui": "vitest --ui",
62
+ "test:coverage": "vitest --coverage",
63
+ "test:run": "vitest run",
64
+ "test:watch": "vitest watch",
58
65
  "changeset": "changeset",
59
66
  "version": "changeset version",
60
67
  "release": "pnpm build && changeset publish"