zencode-cli 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +117 -287
- package/dist/bin/zencode.js +1440 -1545
- package/dist/bin/zencode.js.map +1 -1
- package/package.json +56 -56
- package/DESIGN.md +0 -613
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 ZenCode Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -4,20 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
## 特性
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
7
|
+
- **单 Agent 循环** — 理解需求 → 收集上下文 → 写代码 → 执行验证,一个 Agent 完成所有工作
|
|
8
|
+
- **先读后改** — 系统级强制:未读取的文件无法编辑,杜绝盲改
|
|
9
|
+
- **覆盖保护** — write-file 已存在的文件必须显式确认,防止误覆盖
|
|
10
|
+
- **并行子 Agent** — spawn-agents 并行处理多文件任务
|
|
11
|
+
- **可配置子 Agent** — dispatch 工具支持 YAML 定义的专用子 Agent
|
|
12
|
+
- **自定义技能** — 用户可定义斜杠命令,展开为完整提示词
|
|
13
|
+
- **全屏 TUI** — 交互式终端界面,流式输出、工具确认、实时进度
|
|
14
|
+
- **跨平台** — 自动识别 Windows/Linux/macOS,命令提示适配当前平台
|
|
15
|
+
- **deepseek-reasoner 兼容** — 支持 reasoning_content 思维链显示
|
|
12
16
|
|
|
13
17
|
## 安装
|
|
14
18
|
|
|
15
19
|
```bash
|
|
16
|
-
# 从 npm 安装
|
|
17
20
|
npm install -g zencode-cli
|
|
18
|
-
|
|
19
|
-
# 或者用 yarn
|
|
20
|
-
yarn global add zencode-cli
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## 快速开始
|
|
@@ -26,6 +26,9 @@ yarn global add zencode-cli
|
|
|
26
26
|
# 交互式 TUI 模式(推荐)
|
|
27
27
|
zencode
|
|
28
28
|
|
|
29
|
+
# 简单 REPL 模式
|
|
30
|
+
zencode --simple
|
|
31
|
+
|
|
29
32
|
# 单次执行
|
|
30
33
|
zencode "帮我写一个 Hello World"
|
|
31
34
|
|
|
@@ -37,260 +40,171 @@ zencode --help
|
|
|
37
40
|
|
|
38
41
|
### 配置文件
|
|
39
42
|
|
|
40
|
-
|
|
43
|
+
`~/.zencode/config.yaml`(全局)或项目目录下 `.zencode/config.yaml`(项目级):
|
|
41
44
|
|
|
42
45
|
```yaml
|
|
43
46
|
# 模型配置
|
|
44
|
-
model: deepseek-chat
|
|
45
|
-
api_key: sk-xxx
|
|
46
|
-
base_url: https://api.deepseek.com/v1
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
agent_mode: dual # single | dual
|
|
50
|
-
collaboration: delegated # delegated | autonomous | controlled
|
|
47
|
+
model: deepseek-chat
|
|
48
|
+
api_key: sk-xxx
|
|
49
|
+
base_url: https://api.deepseek.com/v1
|
|
50
|
+
temperature: 0.7
|
|
51
|
+
max_tokens: 8192
|
|
51
52
|
|
|
52
53
|
# 功能开关
|
|
53
54
|
features:
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
git: auto # auto | on | off
|
|
56
|
+
mcp: off # on | off(暂未实现)
|
|
57
|
+
planning_layer: on # on | off
|
|
58
|
+
parallel_agents: on # on | off
|
|
59
|
+
todo: on # on | off
|
|
56
60
|
|
|
57
|
-
#
|
|
58
|
-
max_tokens: 8192
|
|
59
|
-
temperature: 0.7
|
|
60
|
-
max_tool_output: 4000 # 工具输出最大字符数
|
|
61
|
-
|
|
62
|
-
# 权限配置(可选)
|
|
61
|
+
# 权限配置
|
|
63
62
|
permissions:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
auto_approve: # 自动执行的工具
|
|
64
|
+
- read-file
|
|
65
|
+
- glob
|
|
66
|
+
- grep
|
|
67
|
+
- spawn-agents
|
|
68
|
+
- todo
|
|
69
|
+
- dispatch
|
|
70
|
+
require_approval: # 需用户确认的工具
|
|
71
|
+
- write-file
|
|
72
|
+
- edit-file
|
|
73
|
+
- bash
|
|
74
|
+
- git
|
|
75
|
+
|
|
76
|
+
# 自定义提示词
|
|
77
|
+
prompts:
|
|
78
|
+
- "始终使用中文回答"
|
|
79
|
+
|
|
80
|
+
# 工具输出最大长度
|
|
81
|
+
max_tool_output: 30000
|
|
67
82
|
```
|
|
68
83
|
|
|
84
|
+
配置优先级(从低到高):默认值 < 全局 `~/.zencode/config.yaml` < 项目 `.zencode/config.yaml` < 项目根 `.zencode.yaml` < 环境变量 < CLI 参数
|
|
85
|
+
|
|
69
86
|
### 环境变量
|
|
70
87
|
|
|
71
88
|
| 变量 | 说明 |
|
|
72
89
|
|------|------|
|
|
73
|
-
| `ZENCODE_API_KEY` | API
|
|
90
|
+
| `ZENCODE_API_KEY` | API 密钥 |
|
|
74
91
|
| `ZENCODE_BASE_URL` | API 地址 |
|
|
75
92
|
| `ZENCODE_MODEL` | 模型名称 |
|
|
76
93
|
|
|
77
94
|
### CLI 参数
|
|
78
95
|
|
|
79
|
-
```
|
|
96
|
+
```
|
|
80
97
|
zencode [options] [prompt...]
|
|
81
98
|
|
|
82
99
|
Arguments:
|
|
83
100
|
prompt 直接执行的提示词(非交互式)
|
|
84
101
|
|
|
85
102
|
Options:
|
|
86
|
-
-V, --version
|
|
103
|
+
-V, --version 显示版本号
|
|
87
104
|
-m, --model <model> 指定模型名称
|
|
88
105
|
-k, --api-key <key> API 密钥
|
|
89
106
|
-u, --base-url <url> API 基础 URL
|
|
90
|
-
--single 使用单 Agent 模式
|
|
91
|
-
--dual 使用双 Agent 模式
|
|
92
|
-
--mode <mode> 协作模式 (delegated/autonomous/controlled)
|
|
93
107
|
--simple 使用简单 REPL 模式(非全屏 TUI)
|
|
94
|
-
-h, --help
|
|
108
|
+
-h, --help 显示帮助
|
|
95
109
|
```
|
|
96
110
|
|
|
97
|
-
##
|
|
98
|
-
|
|
99
|
-
### 1. 交互式 TUI 模式(默认)
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
zencode
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
启动全屏终端界面:
|
|
106
|
-
- 上半部分:对话历史(流式输出)
|
|
107
|
-
- 下半部分:输入框 + 状态栏
|
|
108
|
-
|
|
109
|
-
```
|
|
110
|
-
┌─────────────────────────────────────────────────────────┐
|
|
111
|
-
│ ◆ 你好,我想创建一个春节祝福网页 │
|
|
112
|
-
│ │
|
|
113
|
-
│ ⏳ + write-file demo/index.html │
|
|
114
|
-
│ ✎ 生成中... 150 行 │
|
|
115
|
-
│ ✓ + write-file demo/index.html 203 行 │
|
|
116
|
-
│ <!DOCTYPE html>... │
|
|
117
|
-
├─────────────────────────────────────────────────────────┤
|
|
118
|
-
│ > 创建马年春节祝福网页 │
|
|
119
|
-
│ ───────────────────────────────────────────────────── │
|
|
120
|
-
│ dual(delegated) ▶ deepseek-chat │ ⚙ coder │ /help │
|
|
121
|
-
└─────────────────────────────────────────────────────────┘
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### 2. 单次执行模式
|
|
125
|
-
|
|
126
|
-
```bash
|
|
127
|
-
zencode "帮我写一个 Python 脚本,批量重命名文件"
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### 3. 简单 REPL 模式
|
|
131
|
-
|
|
132
|
-
```bash
|
|
133
|
-
zencode --simple
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
适合不支持全屏 TUI 的终端环境。
|
|
137
|
-
|
|
138
|
-
## Agent 模式
|
|
111
|
+
## 工具
|
|
139
112
|
|
|
140
|
-
|
|
113
|
+
| 工具 | 默认权限 | 说明 |
|
|
114
|
+
|------|---------|------|
|
|
115
|
+
| `read-file` | auto | 读取文件 |
|
|
116
|
+
| `write-file` | confirm | 写入文件 |
|
|
117
|
+
| `edit-file` | confirm | 编辑文件 |
|
|
118
|
+
| `bash` | confirm | 执行命令 |
|
|
119
|
+
| `glob` | auto | 文件搜索 |
|
|
120
|
+
| `grep` | auto | 内容搜索 |
|
|
121
|
+
| `spawn-agents` | auto | 并行子 Agent |
|
|
122
|
+
| `dispatch` | auto | 分派子 Agent |
|
|
123
|
+
| `todo` | auto | 任务计划 |
|
|
141
124
|
|
|
142
|
-
|
|
125
|
+
权限级别:`auto`(自动执行)、`confirm`(需确认)、`deny`(禁止)
|
|
143
126
|
|
|
144
|
-
|
|
145
|
-
zencode --single
|
|
146
|
-
# 或
|
|
147
|
-
zencode --single "修复 src/utils.ts 中的类型错误"
|
|
148
|
-
```
|
|
127
|
+
## 安全机制
|
|
149
128
|
|
|
150
|
-
###
|
|
129
|
+
### 先读后改(ReadTracker)
|
|
151
130
|
|
|
152
|
-
|
|
153
|
-
用户请求
|
|
154
|
-
↓
|
|
155
|
-
Orchestrator(调度者)
|
|
156
|
-
├── 评估任务复杂度
|
|
157
|
-
├── 收集上下文(glob/read-file)
|
|
158
|
-
├── 记入 memo(共享记忆)
|
|
159
|
-
└── 委派给 Coder
|
|
160
|
-
↓
|
|
161
|
-
Coder(编码者)
|
|
162
|
-
├── 读 memo 获取上下文
|
|
163
|
-
├── write-file / edit-file
|
|
164
|
-
├── 写 memo 记录改动
|
|
165
|
-
└── 返回结果
|
|
166
|
-
```
|
|
131
|
+
系统级强制:每个 Agent 会话中维护已读文件集合。
|
|
167
132
|
|
|
168
|
-
|
|
133
|
+
- `read-file` 成功 → 标记已读
|
|
134
|
+
- `write-file` 成功 → 标记已读(刚写的文件 Agent 已知内容)
|
|
135
|
+
- `edit-file` 调用前 → 检查是否已读,未读则拒绝
|
|
169
136
|
|
|
170
|
-
|
|
171
|
-
|------|------|----------|
|
|
172
|
-
| `delegated` | 调度者委派任务,Coder 有完整工具 | 大多数场景 |
|
|
173
|
-
| `autonomous` | Coder 自主决策,适合强模型 | 简单任务、能力强模型 |
|
|
174
|
-
| `controlled` | Coder 只返回代码,调度者执行 | 需要严格控制文件操作 |
|
|
137
|
+
### 覆盖保护
|
|
175
138
|
|
|
176
|
-
|
|
177
|
-
# 切换协作模式
|
|
178
|
-
zencode --mode delegated
|
|
179
|
-
zencode --mode autonomous
|
|
180
|
-
zencode --mode controlled
|
|
181
|
-
```
|
|
139
|
+
write-file 目标文件已存在时,要求设置 `overwrite: true` 才能覆盖。
|
|
182
140
|
|
|
183
|
-
|
|
184
|
-
```
|
|
185
|
-
/mode delegated
|
|
186
|
-
/mode autonomous
|
|
187
|
-
/mode controlled
|
|
188
|
-
```
|
|
141
|
+
## TUI 命令
|
|
189
142
|
|
|
190
|
-
|
|
143
|
+
| 命令 | 说明 |
|
|
144
|
+
|------|------|
|
|
145
|
+
| `/help` | 显示帮助 |
|
|
146
|
+
| `/skills` | 列出所有可用技能 |
|
|
147
|
+
| `/agents` | 列出所有可用子 Agent |
|
|
148
|
+
| `/parallel` | 切换并行子 Agent on/off |
|
|
149
|
+
| `/todo` | 切换 Todo 计划 on/off |
|
|
150
|
+
| `/clear` | 清空对话历史 |
|
|
151
|
+
| `/info` | 显示当前配置 |
|
|
191
152
|
|
|
192
|
-
|
|
153
|
+
## 快捷键
|
|
193
154
|
|
|
194
|
-
|
|
155
|
+
| 快捷键 | 说明 |
|
|
156
|
+
|--------|------|
|
|
157
|
+
| `Ctrl+C` / `Escape` | 取消当前请求 |
|
|
158
|
+
| `Ctrl+D` | 退出程序 |
|
|
159
|
+
| `Enter` | 发送消息 |
|
|
195
160
|
|
|
196
|
-
|
|
197
|
-
# 写入
|
|
198
|
-
memo write key="项目结构" value="使用 React + Vite"
|
|
161
|
+
## 扩展
|
|
199
162
|
|
|
200
|
-
|
|
201
|
-
memo read 项目结构
|
|
163
|
+
### 自定义子 Agent
|
|
202
164
|
|
|
203
|
-
|
|
204
|
-
memo list
|
|
165
|
+
在 `~/.zencode/agents/` 或 `.zencode/agents/` 放置 YAML 文件:
|
|
205
166
|
|
|
206
|
-
|
|
207
|
-
|
|
167
|
+
```yaml
|
|
168
|
+
name: reviewer
|
|
169
|
+
description: 代码审查专家
|
|
170
|
+
system_prompt: 你是代码审查专家,专注于发现潜在问题。
|
|
171
|
+
tools:
|
|
172
|
+
- read-file
|
|
173
|
+
- glob
|
|
174
|
+
- grep
|
|
208
175
|
```
|
|
209
176
|
|
|
210
|
-
|
|
211
|
-
1. Orchestrator 收集上下文 → `memo write`
|
|
212
|
-
2. 委派时引用 memo key
|
|
213
|
-
3. Coder 先 `memo read` 获取上下文
|
|
214
|
-
4. Coder 完成后 `memo write` 记录改动
|
|
215
|
-
|
|
216
|
-
### Todo 计划
|
|
177
|
+
使用时 Agent 会通过 `dispatch` 工具自动调度。
|
|
217
178
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
```
|
|
221
|
-
# 在 TUI 中
|
|
222
|
-
/todo # 切换 todo 功能
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
```bash
|
|
226
|
-
# 添加任务
|
|
227
|
-
todo add "创建 HTML 结构"
|
|
179
|
+
### 自定义技能
|
|
228
180
|
|
|
229
|
-
|
|
230
|
-
todo list
|
|
181
|
+
在 `~/.zencode/skills/` 或 `.zencode/skills/` 放置 YAML 文件:
|
|
231
182
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
并行处理多文件任务。
|
|
242
|
-
|
|
243
|
-
```
|
|
244
|
-
# 在 TUI 中
|
|
245
|
-
/parallel # 切换并行功能
|
|
183
|
+
```yaml
|
|
184
|
+
name: review
|
|
185
|
+
description: 审查当前项目代码
|
|
186
|
+
prompt: |
|
|
187
|
+
请审查当前项目的代码质量,重点关注:
|
|
188
|
+
1. 潜在 bug
|
|
189
|
+
2. 安全问题
|
|
190
|
+
3. 代码规范
|
|
246
191
|
```
|
|
247
192
|
|
|
248
|
-
|
|
249
|
-
- 并行读取多个文件
|
|
250
|
-
- 并行搜索代码
|
|
251
|
-
- 多文件批量处理
|
|
252
|
-
|
|
253
|
-
## 快捷键
|
|
254
|
-
|
|
255
|
-
| 快捷键 | 说明 |
|
|
256
|
-
|--------|------|
|
|
257
|
-
| `Ctrl+C` | 取消当前请求 / 退出 |
|
|
258
|
-
| `Ctrl+D` | 退出程序 |
|
|
259
|
-
| `Enter` | 发送消息 |
|
|
260
|
-
| `↑/↓` | 历史命令(简单模式) |
|
|
261
|
-
|
|
262
|
-
### TUI 命令
|
|
263
|
-
|
|
264
|
-
| 命令 | 说明 |
|
|
265
|
-
|------|------|
|
|
266
|
-
| `/help` | 显示帮助 |
|
|
267
|
-
| `/mode [模式]` | 切换协作模式 |
|
|
268
|
-
| `/single` | 切换到单 Agent |
|
|
269
|
-
| `/dual` | 切换到双 Agent |
|
|
270
|
-
| `/parallel` | 开关并行子 Agent |
|
|
271
|
-
| `/todo` | 开关 Todo 计划 |
|
|
272
|
-
| `/clear` | 清空对话历史 |
|
|
273
|
-
| `/info` | 显示当前配置 |
|
|
193
|
+
然后在 TUI 中输入 `/review` 即可触发。
|
|
274
194
|
|
|
275
195
|
## 支持的模型
|
|
276
196
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
### 推荐模型
|
|
280
|
-
|
|
281
|
-
| 模型 | API | 特点 |
|
|
282
|
-
|------|-----|------|
|
|
283
|
-
| DeepSeek Chat | deepseek.com | 性价比高,效果好 |
|
|
284
|
-
| Qwen Turbo | dashscope.aliyun.com | 阿里出品 |
|
|
285
|
-
| GPT-4o | openai.com | 能力强 |
|
|
286
|
-
|
|
287
|
-
### 配置示例
|
|
197
|
+
通过 OpenAI 兼容 API 连接各种模型:
|
|
288
198
|
|
|
289
199
|
```yaml
|
|
290
200
|
# DeepSeek
|
|
291
201
|
model: deepseek-chat
|
|
292
202
|
base_url: https://api.deepseek.com/v1
|
|
293
203
|
|
|
204
|
+
# DeepSeek Reasoner(支持思维链)
|
|
205
|
+
model: deepseek-reasoner
|
|
206
|
+
base_url: https://api.deepseek.com
|
|
207
|
+
|
|
294
208
|
# 阿里 Qwen
|
|
295
209
|
model: qwen-turbo
|
|
296
210
|
base_url: https://dashscope.aliyuncs.com/compatible-mode/v1
|
|
@@ -300,99 +214,15 @@ model: gpt-4o
|
|
|
300
214
|
base_url: https://api.openai.com/v1
|
|
301
215
|
```
|
|
302
216
|
|
|
303
|
-
## 工具
|
|
304
|
-
|
|
305
|
-
ZenCode 内置以下工具:
|
|
306
|
-
|
|
307
|
-
| 工具 | 说明 | 权限 |
|
|
308
|
-
|------|------|------|
|
|
309
|
-
| `read-file` | 读取文件内容 | auto |
|
|
310
|
-
| `write-file` | 创建/覆盖文件 | confirm |
|
|
311
|
-
| `edit-file` | 编辑文件 | confirm |
|
|
312
|
-
| `glob` | 文件搜索 | auto |
|
|
313
|
-
| `grep` | 代码搜索 | auto |
|
|
314
|
-
| `bash` | 执行命令 | confirm |
|
|
315
|
-
| `spawn-agents` | 并行子 Agent | confirm |
|
|
316
|
-
| `memo` | 共享备忘录 | auto |
|
|
317
|
-
| `todo` | 任务计划 | auto |
|
|
318
|
-
|
|
319
|
-
权限级别:
|
|
320
|
-
- `auto` — 自动执行
|
|
321
|
-
- `confirm` — 需要用户确认
|
|
322
|
-
- `deny` — 禁止执行
|
|
323
|
-
|
|
324
|
-
## 提示词技巧
|
|
325
|
-
|
|
326
|
-
### 1. 明确目标
|
|
327
|
-
|
|
328
|
-
```
|
|
329
|
-
❌ 帮我优化一下代码
|
|
330
|
-
✅ 重构 src/utils.ts 中的 formatDate 函数,使用 dayjs
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
### 2. 提供上下文
|
|
334
|
-
|
|
335
|
-
```
|
|
336
|
-
✅ 在 demo/ 目录下创建 index.html,使用现有 weather.html 的样式
|
|
337
|
-
✅ 修改 src/api/user.ts,增加获取用户头像的接口
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
### 3. 分步执行
|
|
341
|
-
|
|
342
|
-
```
|
|
343
|
-
✅ 第一步:创建数据模型
|
|
344
|
-
✅ 第二步:实现 API 接口
|
|
345
|
-
```
|
|
346
|
-
|
|
347
|
-
### 4. 指定约束
|
|
348
|
-
|
|
349
|
-
```
|
|
350
|
-
✅ 用 TypeScript,不要 any
|
|
351
|
-
✅ 保持现有代码风格,使用 React Hooks
|
|
352
|
-
✅ 不要添加测试,只做核心功能
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
## 常见问题
|
|
356
|
-
|
|
357
|
-
### Q: 工具执行被拒绝
|
|
358
|
-
|
|
359
|
-
A: 检查配置文件的 `permissions` 设置,或在 TUI 中按 `y` 允许执行。
|
|
360
|
-
|
|
361
|
-
### Q: 模型响应慢
|
|
362
|
-
|
|
363
|
-
A: 尝试:
|
|
364
|
-
1. 换更快的模型(如 qwen-turbo)
|
|
365
|
-
2. 减少 `max_tokens`
|
|
366
|
-
3. 使用 `--simple` 模式减少 UI 开销
|
|
367
|
-
|
|
368
|
-
### Q: Windows 终端显示异常
|
|
369
|
-
|
|
370
|
-
A: 确保使用支持 ANSI 的终端(如 Windows Terminal、PowerShell)。
|
|
371
|
-
|
|
372
|
-
### Q: 如何更新
|
|
373
|
-
|
|
374
|
-
```bash
|
|
375
|
-
npm update -g zencode-cli
|
|
376
|
-
```
|
|
377
|
-
|
|
378
217
|
## 开发
|
|
379
218
|
|
|
380
219
|
```bash
|
|
381
|
-
# 克隆项目
|
|
382
220
|
git clone https://github.com/your-repo/zencode.git
|
|
383
221
|
cd zencode
|
|
384
|
-
|
|
385
|
-
# 安装依赖
|
|
386
222
|
npm install
|
|
387
|
-
|
|
388
|
-
#
|
|
389
|
-
npm
|
|
390
|
-
|
|
391
|
-
# 构建
|
|
392
|
-
npm run build
|
|
393
|
-
|
|
394
|
-
# 链接本地
|
|
395
|
-
npm link
|
|
223
|
+
npm run dev # 开发模式
|
|
224
|
+
npm run build # 构建
|
|
225
|
+
npm link # 链接本地
|
|
396
226
|
```
|
|
397
227
|
|
|
398
228
|
## 许可证
|