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 +244 -244
- package/dist/cli.mjs +26 -12
- package/dist/index.mjs +1 -1
- package/dist/shared/{zcf.CYdvtE_u.mjs → zcf.DgtRGf5j.mjs} +1 -1
- package/package.json +10 -3
package/README.md
CHANGED
|
@@ -4,123 +4,123 @@
|
|
|
4
4
|
[](https://claude.ai/code)
|
|
5
5
|
[](https://www.npmjs.com/package/zcf)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
[中文](README_zh.md) | **English**
|
|
8
8
|
|
|
9
|
-
>
|
|
9
|
+
> Zero-config, one-click setup for Claude Code with bilingual support, intelligent agent system and personalized AI assistant
|
|
10
10
|
|
|
11
|
-

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