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 +248 -246
- package/dist/cli.mjs +27 -13
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/{zcf.CYdvtE_u.mjs → zcf.DnmrEWlk.mjs} +12 -6
- package/package.json +10 -3
package/README.md
CHANGED
|
@@ -3,124 +3,126 @@
|
|
|
3
3
|
[](https://opensource.org/licenses/MIT)
|
|
4
4
|
[](https://claude.ai/code)
|
|
5
5
|
[](https://www.npmjs.com/package/zcf)
|
|
6
|
+
[](https://codecov.io/gh/UfoMiao/zcf)
|
|
7
|
+
[](https://deepwiki.com/UfoMiao/zcf)
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
[中文](README_zh.md) | **English**
|
|
8
10
|
|
|
9
|
-
>
|
|
11
|
+
> Zero-config, one-click setup for Claude Code with bilingual support, intelligent agent system and personalized AI assistant
|
|
10
12
|
|
|
11
|
-

|
|
12
14
|
|
|
13
|
-
## 🚀
|
|
15
|
+
## 🚀 Quick Start
|
|
14
16
|
|
|
15
|
-
### 🎯
|
|
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`
|
|
24
|
-
- `2`
|
|
25
|
-
- `3-6`
|
|
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
|
-
#### 🆕
|
|
32
|
+
#### 🆕 First time using Claude Code
|
|
31
33
|
|
|
32
34
|
```bash
|
|
33
|
-
npx zcf i #
|
|
34
|
-
#
|
|
35
|
-
npx zcf →
|
|
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
|
-
#### 🔄
|
|
40
|
+
#### 🔄 Already have Claude Code installed
|
|
39
41
|
|
|
40
42
|
```bash
|
|
41
|
-
npx zcf u #
|
|
42
|
-
#
|
|
43
|
-
npx zcf →
|
|
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
|
|
49
|
-
> -
|
|
50
|
-
> - `zcf i` =
|
|
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
|
-
|
|
56
|
+
Full initialization (`npx zcf`) will automatically:
|
|
55
57
|
|
|
56
|
-
- ✅
|
|
57
|
-
- ✅
|
|
58
|
-
- ✅
|
|
59
|
-
- ✅
|
|
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
|
-
-
|
|
67
|
-
-
|
|
68
|
-
- `/feat
|
|
69
|
-
- `/workflow
|
|
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
|
|
74
|
-
> -
|
|
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
|
-
-
|
|
82
|
-
- AI
|
|
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
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
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
|
|
106
|
-
- **API Key
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
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
|
-
-
|
|
114
|
-
-
|
|
115
|
-
-
|
|
116
|
-
- MCP
|
|
117
|
-
-
|
|
118
|
-
- AI
|
|
119
|
-
- ZCF
|
|
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
|
-
###
|
|
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.
|
|
138
|
-
3.
|
|
139
|
-
4.
|
|
140
|
-
5.
|
|
141
|
-
6.
|
|
142
|
-
7.
|
|
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
|
-
-.
|
|
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
|
-
###
|
|
154
|
+
### Full Initialization Flow (Select 1 or use `zcf i`)
|
|
153
155
|
|
|
154
156
|
```bash
|
|
155
|
-
?
|
|
156
|
-
❯ 简体中文 (zh-CN) -
|
|
157
|
-
English (en) -
|
|
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
|
-
?
|
|
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
|
-
?
|
|
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
|
-
?
|
|
175
|
+
? Claude Code not found. Install automatically? (Y/n)
|
|
174
176
|
|
|
175
|
-
✔ Claude Code
|
|
177
|
+
✔ Claude Code installed successfully
|
|
176
178
|
|
|
177
|
-
?
|
|
178
|
-
❯
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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
|
-
?
|
|
185
|
-
?
|
|
186
|
+
? Enter API URL: https://api.anthropic.com
|
|
187
|
+
? Enter Auth Token or API Key: xxx
|
|
186
188
|
|
|
187
|
-
?
|
|
188
|
-
❯
|
|
189
|
-
|
|
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
|
-
✔
|
|
194
|
-
✔
|
|
195
|
-
✔ API
|
|
195
|
+
✔ All config files backed up to ~/.claude/backup/xxx
|
|
196
|
+
✔ Config files copied to ~/.claude
|
|
197
|
+
✔ API configured
|
|
196
198
|
|
|
197
|
-
?
|
|
199
|
+
? Configure MCP services? (Y/n)
|
|
198
200
|
|
|
199
|
-
?
|
|
200
|
-
❯ ◯
|
|
201
|
-
◯ Context7
|
|
202
|
-
◯ DeepWiki -
|
|
203
|
-
◯ Playwright
|
|
204
|
-
◯ 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
|
-
?
|
|
208
|
+
? Enter Exa API Key (get from https://dashboard.exa.ai/api-keys)
|
|
207
209
|
|
|
208
|
-
✔ MCP
|
|
210
|
+
✔ MCP services configured
|
|
209
211
|
|
|
210
|
-
🎉
|
|
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` | - |
|
|
220
|
-
| `zcf init` | `zcf i` |
|
|
221
|
-
| `zcf update` | `zcf u` |
|
|
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
|
-
#
|
|
235
|
-
npx zcf u #
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
|
|
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 #
|
|
285
|
-
│ ├── settings.json #
|
|
286
|
-
│ ├── en/ #
|
|
287
|
-
│ │ ├── rules.md #
|
|
288
|
-
│ │ ├── personality.md # AI
|
|
289
|
-
│ │ ├── mcp.md # MCP
|
|
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
|
-
## ✨
|
|
299
|
+
## ✨ Core Features (v2.0 Enhanced)
|
|
298
300
|
|
|
299
|
-
### 🤖
|
|
301
|
+
### 🤖 Professional Agents
|
|
300
302
|
|
|
301
|
-
-
|
|
302
|
-
- **UI/UX
|
|
303
|
-
- **AI
|
|
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
|
-
-
|
|
308
|
-
-
|
|
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
|
-
-
|
|
315
|
-
-
|
|
316
|
-
- AI
|
|
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
|
-
#
|
|
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.
|
|
350
|
-
3.
|
|
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.
|
|
357
|
-
2.
|
|
358
|
-
3.
|
|
359
|
-
4.
|
|
360
|
-
5.
|
|
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
|
|
368
|
+
ZCF fully supports Windows platform:
|
|
367
369
|
|
|
368
|
-
-
|
|
369
|
-
-
|
|
370
|
-
-
|
|
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
|
-
|
|
374
|
+
If you encounter MCP connection issues on Windows, running `npx zcf` will automatically fix the configuration format.
|
|
373
375
|
|
|
374
|
-
#### Termux
|
|
376
|
+
#### Termux Support (v2.1 new)
|
|
375
377
|
|
|
376
|
-
ZCF
|
|
378
|
+
ZCF now supports running in Android Termux environment:
|
|
377
379
|
|
|
378
|
-
-
|
|
379
|
-
-
|
|
380
|
-
-
|
|
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
|
-
###
|
|
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
|
-
-
|
|
390
|
-
-
|
|
391
|
-
-
|
|
392
|
-
-
|
|
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
|
-
|
|
399
|
+
Some prompts in this project are inspired by the following excellent works:
|
|
398
400
|
|
|
399
|
-
- [Linux.do -
|
|
400
|
-
- [Linux.do - claude code
|
|
401
|
-
- [Linux.do - cursor
|
|
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
|
-
|
|
413
|
+
If this project helps you, please give me a ⭐️ Star!
|
|
412
414
|
|
|
413
|
-
[](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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
504
|
+
}
|
|
505
|
+
async function handleUpdateCommand(options) {
|
|
494
506
|
await update({ configLang: options.configLang });
|
|
495
|
-
}
|
|
496
|
-
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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
|
-
|
|
468
|
+
apiKeyEnvVar: "EXA_API_KEY",
|
|
469
469
|
config: {
|
|
470
470
|
type: "stdio",
|
|
471
471
|
command: "npx",
|
|
472
|
-
args: ["-y", "mcp-
|
|
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
|
+
"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": "
|
|
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"
|