zcf 2.4.1 → 2.5.0

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