jinzd-ai-cli 0.2.2 → 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/README.md +315 -236
- package/README.zh-CN.md +328 -161
- package/dist/{chunk-NGGVPDNF.js → chunk-MVARMOOJ.js} +1 -1
- package/dist/{chunk-YSHQDGVZ.js → chunk-ZV5BU6FL.js} +1 -1
- package/dist/index.js +4 -4
- package/dist/{run-tests-3Y3P7QTJ.js → run-tests-ONH2KZTI.js} +1 -1
- package/dist/{server-KZ472I7D.js → server-6JLWLVZ5.js} +2 -2
- package/package.json +10 -11
- package/CLAUDE.md +0 -2124
- package/dist/.icon-ico/icon.ico +0 -0
- package/dist/electron-server.js +0 -8033
package/README.zh-CN.md
CHANGED
|
@@ -1,161 +1,328 @@
|
|
|
1
|
-
[English](README.md) | **中文**
|
|
2
|
-
|
|
3
|
-
# ai-cli
|
|
4
|
-
|
|
5
|
-
> 跨平台
|
|
6
|
-
|
|
7
|
-
[](https://www.npmjs.com/package/jinzd-ai-cli)
|
|
8
|
-
[](LICENSE)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
|
45
|
-
|
|
46
|
-
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
|
53
|
-
|
|
54
|
-
|
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
|
144
|
-
|
|
145
|
-
| `
|
|
146
|
-
|
|
|
147
|
-
| `
|
|
148
|
-
| `
|
|
149
|
-
| `
|
|
150
|
-
| `
|
|
151
|
-
| `
|
|
152
|
-
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
1
|
+
[English](README.md) | **中文**
|
|
2
|
+
|
|
3
|
+
# ai-cli
|
|
4
|
+
|
|
5
|
+
> 跨平台 AI 编程助手 — CLI 终端、Web 界面、桌面应用三合一,支持 7 大 Provider 与 Agentic 工具调用
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/jinzd-ai-cli)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
[](https://nodejs.org)
|
|
10
|
+
[]()
|
|
11
|
+
[](https://github.com/jinzhengdong/ai-cli/releases)
|
|
12
|
+
|
|
13
|
+
## 特性亮点
|
|
14
|
+
|
|
15
|
+
- **7 大内置 Provider** — Claude、Gemini、DeepSeek、OpenAI、智谱 GLM、Kimi、OpenRouter(300+ 模型)
|
|
16
|
+
- **三种使用方式** — 终端 CLI、浏览器 Web UI(`aicli web`)、Electron 桌面应用
|
|
17
|
+
- **Agentic 工具调用** — AI 自主执行 bash 命令、读写文件、搜索代码、抓取网页、运行测试(每轮最多 25 次)
|
|
18
|
+
- **流式工具调用** — 实时流式展示 AI 推理过程和工具调用
|
|
19
|
+
- **子代理系统** — 将复杂子任务委派给独立子代理执行
|
|
20
|
+
- **深度推理** — Claude Extended Thinking,`/think` 一键切换
|
|
21
|
+
- **规划模式** — `/plan` 进入只读规划,AI 先分析后执行
|
|
22
|
+
- **MCP 协议** — 接入外部 MCP 服务器,动态发现工具
|
|
23
|
+
- **多用户认证** — Web UI 支持多用户密码登录
|
|
24
|
+
- **PWA 支持** — Web UI 可安装为桌面/移动应用,支持局域网访问
|
|
25
|
+
- **三层级上下文** — 全局 / 项目 / 子目录上下文文件自动注入
|
|
26
|
+
- **无头模式** — `aicli -p "提示词"` 用于 CI/CD 管道和脚本
|
|
27
|
+
- **35+ REPL 命令** — 会话管理、检查点、代码审查、脚手架等
|
|
28
|
+
- **跨平台** — Windows、macOS、Linux
|
|
29
|
+
|
|
30
|
+
## 安装
|
|
31
|
+
|
|
32
|
+
### npm 安装(推荐)
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install -g jinzd-ai-cli
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
需要 Node.js >= 20。安装后使用 `aicli` 启动。
|
|
39
|
+
|
|
40
|
+
### Electron 桌面应用(Windows)
|
|
41
|
+
|
|
42
|
+
从 [GitHub Releases](https://github.com/jinzhengdong/ai-cli/releases) 下载安装包,无需 Node.js:
|
|
43
|
+
|
|
44
|
+
| 平台 | 下载 |
|
|
45
|
+
|------|------|
|
|
46
|
+
| Windows x64 | [`ai-cli-setup.exe`](https://github.com/jinzhengdong/ai-cli/releases/latest) |
|
|
47
|
+
|
|
48
|
+
### 独立可执行文件
|
|
49
|
+
|
|
50
|
+
预编译 CLI 二进制(无需 Node.js,约 56 MB):
|
|
51
|
+
|
|
52
|
+
| 平台 | 文件 |
|
|
53
|
+
|------|------|
|
|
54
|
+
| Windows x64 | `ai-cli-win.exe` |
|
|
55
|
+
| macOS arm64 | `ai-cli-mac` |
|
|
56
|
+
| macOS x64 | `ai-cli-mac-x64` |
|
|
57
|
+
| Linux x64 | `ai-cli-linux` |
|
|
58
|
+
|
|
59
|
+
## 快速开始
|
|
60
|
+
|
|
61
|
+
### 终端 CLI
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
aicli
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
首次运行会进入交互式配置向导,选择 Provider 并输入 API Key。配置保存在 `~/.aicli/config.json`。
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
[deepseek] > 你好!帮我分析一下这个项目
|
|
71
|
+
[deepseek] > @src/main.ts 审查这个文件有没有 bug
|
|
72
|
+
[deepseek] > @screenshot.png 这张图片里有什么?
|
|
73
|
+
[deepseek] > /help
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
使用 `@文件路径` 在提示词中引用文件或图片。
|
|
77
|
+
|
|
78
|
+
### Web UI
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
aicli web # 在 localhost:3456 启动
|
|
82
|
+
aicli web --port 8080 # 自定义端口
|
|
83
|
+
aicli web --host 0.0.0.0 # 局域网访问(手机/平板)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
功能:多 Tab 会话、文件树面板、拖拽/粘贴图片、Prompt 模板库、8 套 DaisyUI 主题、PWA 可安装、键盘快捷键、Diff 语法高亮。
|
|
87
|
+
|
|
88
|
+
### 用户管理
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
aicli user create admin # 创建用户(启用认证)
|
|
92
|
+
aicli user list # 列出所有用户
|
|
93
|
+
aicli user reset-password x # 重置密码
|
|
94
|
+
aicli user delete x # 删除用户
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## 支持的 Provider
|
|
98
|
+
|
|
99
|
+
| Provider | 模型 | 获取 API Key |
|
|
100
|
+
|----------|------|-------------|
|
|
101
|
+
| **Claude** | Opus 4, Sonnet 4, Haiku 4 | [console.anthropic.com](https://console.anthropic.com) |
|
|
102
|
+
| **Gemini** | 2.5 Pro, 2.5 Flash | [aistudio.google.com](https://aistudio.google.com) |
|
|
103
|
+
| **DeepSeek** | DeepSeek-Chat (V3), Reasoner (R1) | [platform.deepseek.com](https://platform.deepseek.com) |
|
|
104
|
+
| **OpenAI** | GPT-5.4, GPT-4o, o3, o4-mini | [platform.openai.com](https://platform.openai.com) |
|
|
105
|
+
| **OpenRouter** | 300+ 模型(Claude/GPT/Gemini/Llama/Qwen/Mistral...) | [openrouter.ai](https://openrouter.ai) |
|
|
106
|
+
| **智谱清言** | GLM-4, GLM-5 | [open.bigmodel.cn](https://open.bigmodel.cn) |
|
|
107
|
+
| **Kimi** | Moonshot, Kimi-K2 | [platform.moonshot.cn](https://platform.moonshot.cn) |
|
|
108
|
+
|
|
109
|
+
也可通过 `customBaseUrls` 配置接入任意 OpenAI 兼容 API。
|
|
110
|
+
|
|
111
|
+
## 内置工具(Agentic 能力)
|
|
112
|
+
|
|
113
|
+
AI 在对话中可自主调用 16 个工具:
|
|
114
|
+
|
|
115
|
+
| 工具 | 安全级别 | 说明 |
|
|
116
|
+
|------|---------|------|
|
|
117
|
+
| `bash` | 动态判断 | 执行 shell 命令(Windows: PowerShell,Unix: $SHELL) |
|
|
118
|
+
| `read_file` | 安全 | 读取文件内容(10 MB 限制,支持图片) |
|
|
119
|
+
| `write_file` | 写入 | 创建/覆盖文件(diff 预览 + 确认) |
|
|
120
|
+
| `edit_file` | 写入 | 精确字符串替换,模糊匹配提示 |
|
|
121
|
+
| `list_dir` | 安全 | 列出目录内容 |
|
|
122
|
+
| `grep_files` | 安全 | 正则搜索文件内容 |
|
|
123
|
+
| `glob_files` | 安全 | 按 glob 模式匹配文件 |
|
|
124
|
+
| `web_fetch` | 安全 | 抓取网页转 Markdown(防 SSRF) |
|
|
125
|
+
| `google_search` | 安全 | Google 自定义搜索 |
|
|
126
|
+
| `run_interactive` | 安全 | 运行交互式程序并输入 |
|
|
127
|
+
| `run_tests` | 安全 | 自动检测并运行测试(JUnit XML 解析) |
|
|
128
|
+
| `spawn_agent` | 安全 | 委派子任务给隔离子代理 |
|
|
129
|
+
| `ask_user` | 安全 | 暂停并向用户提问 |
|
|
130
|
+
| `save_memory` | 安全 | 跨会话持久化重要信息 |
|
|
131
|
+
| `write_todos` | 安全 | 任务拆解,终端实时渲染进度 |
|
|
132
|
+
| `save_last_response` | 写入 | 保存 AI 回复到文件 |
|
|
133
|
+
|
|
134
|
+
**安全级别**:`安全` = 自动执行,`写入` = diff 预览 + 确认,`破坏性` = 醒目警告 + 确认。
|
|
135
|
+
|
|
136
|
+
## 主要 REPL 命令
|
|
137
|
+
|
|
138
|
+
| 命令 | 说明 |
|
|
139
|
+
|------|------|
|
|
140
|
+
| `/provider` | 切换 AI Provider |
|
|
141
|
+
| `/model` | 切换模型 |
|
|
142
|
+
| `/plan` | 进入只读规划模式 |
|
|
143
|
+
| `/think` | 切换 Claude 深度推理 |
|
|
144
|
+
| `/test` | 自动检测并运行测试 |
|
|
145
|
+
| `/review` | AI 代码审查 git diff |
|
|
146
|
+
| `/scaffold <描述>` | AI 生成项目骨架 |
|
|
147
|
+
| `/init` | AI 生成项目上下文文件 |
|
|
148
|
+
| `/compact` | 压缩对话历史 |
|
|
149
|
+
| `/session` | 会话管理(new / list / load) |
|
|
150
|
+
| `/checkpoint` | 保存/恢复会话检查点 |
|
|
151
|
+
| `/fork` | 从当前位置或检查点分叉对话 |
|
|
152
|
+
| `/search <关键词>` | 跨会话全文搜索 |
|
|
153
|
+
| `/skill` | 管理 Agent 技能包 |
|
|
154
|
+
| `/mcp` | 查看 MCP 服务器状态 |
|
|
155
|
+
| `/cost` | 显示 Token 用量统计 |
|
|
156
|
+
| `/undo` | 撤销上次文件操作 |
|
|
157
|
+
| `/doctor` | 健康检查(API Key、MCP、上下文) |
|
|
158
|
+
| `/export` | 导出会话为 Markdown 或 JSON |
|
|
159
|
+
| `/config` | 打开配置向导 |
|
|
160
|
+
| `/help` | 显示所有命令 |
|
|
161
|
+
|
|
162
|
+
完整命令参考见 [使用说明](USAGE.md)。
|
|
163
|
+
|
|
164
|
+
## CLI 参数
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
aicli [选项]
|
|
168
|
+
|
|
169
|
+
选项:
|
|
170
|
+
--provider <名称> 设置 AI Provider
|
|
171
|
+
-m, --model <名称> 设置模型
|
|
172
|
+
-p, --prompt <文本> 无头模式:单次提问后退出
|
|
173
|
+
--system <提示词> 覆盖 system prompt
|
|
174
|
+
--json 输出 JSON(无头模式)
|
|
175
|
+
--output-format <格式> text | streaming-json (NDJSON)
|
|
176
|
+
--resume <id> 恢复之前的会话
|
|
177
|
+
--allowed-tools <列表> 逗号分隔的工具白名单
|
|
178
|
+
--blocked-tools <列表> 逗号分隔的工具黑名单
|
|
179
|
+
--no-stream 禁用流式输出
|
|
180
|
+
|
|
181
|
+
子命令:
|
|
182
|
+
aicli web [选项] 启动 Web UI 服务器
|
|
183
|
+
aicli config 运行配置向导
|
|
184
|
+
aicli providers 列出所有 Provider
|
|
185
|
+
aicli sessions 列出最近会话
|
|
186
|
+
aicli user <操作> 管理 Web UI 用户
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### 无头模式
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
# 单次提问
|
|
193
|
+
aicli -p "用一句话解释递归"
|
|
194
|
+
|
|
195
|
+
# 管道输入
|
|
196
|
+
cat src/main.ts | aicli -p "审查这段代码"
|
|
197
|
+
|
|
198
|
+
# JSON 输出用于脚本
|
|
199
|
+
aicli -p "hello" --json
|
|
200
|
+
|
|
201
|
+
# 流式 JSON (NDJSON)
|
|
202
|
+
aicli -p "写一首诗" --output-format streaming-json
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## 配置
|
|
206
|
+
|
|
207
|
+
配置文件位于 `~/.aicli/config.json`。运行 `aicli config` 打开交互式向导,或直接编辑:
|
|
208
|
+
|
|
209
|
+
```json
|
|
210
|
+
{
|
|
211
|
+
"defaultProvider": "deepseek",
|
|
212
|
+
"apiKeys": {
|
|
213
|
+
"deepseek": "sk-...",
|
|
214
|
+
"claude": "sk-ant-...",
|
|
215
|
+
"openrouter": "sk-or-..."
|
|
216
|
+
},
|
|
217
|
+
"proxy": "http://127.0.0.1:10809",
|
|
218
|
+
"mcpServers": { },
|
|
219
|
+
"ui": {
|
|
220
|
+
"theme": "dark",
|
|
221
|
+
"wordWrap": 0,
|
|
222
|
+
"notificationThreshold": 10000
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### 代理配置(国内用户)
|
|
228
|
+
|
|
229
|
+
Gemini、Claude 等在国内需要代理:
|
|
230
|
+
|
|
231
|
+
**方式一:配置文件(持久)**
|
|
232
|
+
```json
|
|
233
|
+
{
|
|
234
|
+
"proxy": "http://127.0.0.1:10809"
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
运行 `aicli config` → 选择 `Configure proxy` 即可配置。
|
|
239
|
+
|
|
240
|
+
**方式二:环境变量(临时)**
|
|
241
|
+
```bash
|
|
242
|
+
# Windows
|
|
243
|
+
set HTTPS_PROXY=http://127.0.0.1:10809
|
|
244
|
+
aicli
|
|
245
|
+
|
|
246
|
+
# macOS / Linux
|
|
247
|
+
HTTPS_PROXY=http://127.0.0.1:10809 aicli
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### 环境变量
|
|
251
|
+
|
|
252
|
+
| 变量 | 说明 |
|
|
253
|
+
|------|------|
|
|
254
|
+
| `AICLI_API_KEY_CLAUDE` | Claude API Key |
|
|
255
|
+
| `AICLI_API_KEY_GEMINI` | Gemini API Key |
|
|
256
|
+
| `AICLI_API_KEY_DEEPSEEK` | DeepSeek API Key |
|
|
257
|
+
| `AICLI_API_KEY_OPENAI` | OpenAI API Key |
|
|
258
|
+
| `AICLI_API_KEY_OPENROUTER` | OpenRouter API Key |
|
|
259
|
+
| `AICLI_API_KEY_ZHIPU` | 智谱 API Key |
|
|
260
|
+
| `AICLI_API_KEY_KIMI` | Kimi API Key |
|
|
261
|
+
| `AICLI_PROVIDER` | 默认 Provider |
|
|
262
|
+
| `AICLI_NO_STREAM` | 设为 `1` 禁用流式输出 |
|
|
263
|
+
| `HTTPS_PROXY` / `HTTP_PROXY` | 代理地址 |
|
|
264
|
+
|
|
265
|
+
### 三层级上下文文件
|
|
266
|
+
|
|
267
|
+
ai-cli 自动发现并注入上下文文件到 system prompt:
|
|
268
|
+
|
|
269
|
+
| 层级 | 路径 | 用途 |
|
|
270
|
+
|------|------|------|
|
|
271
|
+
| 全局层 | `~/.aicli/AICLI.md` | 所有项目通用的个人偏好 |
|
|
272
|
+
| 项目层 | `<git-root>/AICLI.md` | 项目级规则(提交到 git 供团队共享) |
|
|
273
|
+
| 子目录层 | `<cwd>/AICLI.md` | 当前子目录的特定指令 |
|
|
274
|
+
|
|
275
|
+
每层也支持 `CLAUDE.md` 作为备选文件名。
|
|
276
|
+
|
|
277
|
+
### MCP 集成
|
|
278
|
+
|
|
279
|
+
接入外部 [MCP](https://modelcontextprotocol.io/) 服务器,动态发现工具。配置格式兼容 Claude Desktop:
|
|
280
|
+
|
|
281
|
+
```json
|
|
282
|
+
{
|
|
283
|
+
"mcpServers": {
|
|
284
|
+
"filesystem": {
|
|
285
|
+
"command": "npx",
|
|
286
|
+
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path"],
|
|
287
|
+
"timeout": 30000
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
支持项目级 `.mcp.json`,与全局配置自动合并。
|
|
294
|
+
|
|
295
|
+
## Web UI 功能
|
|
296
|
+
|
|
297
|
+
Web UI(`aicli web`)提供功能完备的浏览器界面:
|
|
298
|
+
|
|
299
|
+
- **多 Tab 会话** — 多个浏览器标签页并行对话
|
|
300
|
+
- **文件树面板** — 浏览项目目录,点击插入 `@path` 引用
|
|
301
|
+
- **图片上传** — 拖拽或 Ctrl+V 粘贴图片到聊天
|
|
302
|
+
- **Prompt 模板库** — CRUD + 标签 + 搜索 + 导入导出
|
|
303
|
+
- **8 套主题** — DaisyUI 主题,代码高亮自动联动
|
|
304
|
+
- **Diff 语法高亮** — 工具确认对话框中彩色 diff
|
|
305
|
+
- **键盘快捷键** — `Esc` 停止、`Ctrl+L` 清屏、`↑↓` 历史
|
|
306
|
+
- **导出** — `/export md` 或 `/export json` 浏览器下载
|
|
307
|
+
- **PWA** — 可安装为桌面/移动应用
|
|
308
|
+
- **局域网访问** — `--host 0.0.0.0` 供手机/平板访问
|
|
309
|
+
- **多用户认证** — 密码认证 + 用户数据隔离
|
|
310
|
+
- **自动重连** — 心跳 + 指数退避重连
|
|
311
|
+
|
|
312
|
+
## 测试
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
npm test # 运行全部 138 个测试
|
|
316
|
+
npm run test:watch # 监听模式
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
8 个测试套件覆盖:认证、会话、工具类型与危险级别、权限、输出截断、diff 渲染、edit-file 相似度、错误层级。
|
|
320
|
+
|
|
321
|
+
## 文档
|
|
322
|
+
|
|
323
|
+
- [完整使用说明](USAGE.md) — 所有功能的详细参考
|
|
324
|
+
- [English README](README.md) — English documentation
|
|
325
|
+
|
|
326
|
+
## License
|
|
327
|
+
|
|
328
|
+
[MIT](LICENSE)
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
theme,
|
|
36
36
|
truncateOutput,
|
|
37
37
|
undoStack
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-MVARMOOJ.js";
|
|
39
39
|
import {
|
|
40
40
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
41
41
|
AUTHOR,
|
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
REPO_URL,
|
|
56
56
|
SKILLS_DIR_NAME,
|
|
57
57
|
VERSION
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-ZV5BU6FL.js";
|
|
59
59
|
|
|
60
60
|
// src/index.ts
|
|
61
61
|
import { program } from "commander";
|
|
@@ -1904,7 +1904,7 @@ ${hint}` : "")
|
|
|
1904
1904
|
description: "Run project tests and show structured report",
|
|
1905
1905
|
usage: "/test [command|filter]",
|
|
1906
1906
|
async execute(args, _ctx) {
|
|
1907
|
-
const { executeTests } = await import("./run-tests-
|
|
1907
|
+
const { executeTests } = await import("./run-tests-ONH2KZTI.js");
|
|
1908
1908
|
const argStr = args.join(" ").trim();
|
|
1909
1909
|
let testArgs = {};
|
|
1910
1910
|
if (argStr) {
|
|
@@ -5292,7 +5292,7 @@ program.command("web").description("Start Web UI server with browser-based chat
|
|
|
5292
5292
|
console.error("Error: Invalid port number. Must be between 1 and 65535.");
|
|
5293
5293
|
process.exit(1);
|
|
5294
5294
|
}
|
|
5295
|
-
const { startWebServer } = await import("./server-
|
|
5295
|
+
const { startWebServer } = await import("./server-6JLWLVZ5.js");
|
|
5296
5296
|
await startWebServer({ port, host: options.host });
|
|
5297
5297
|
});
|
|
5298
5298
|
program.command("user [action] [username]").description("Manage Web UI users (list | create <name> | delete <name> | reset-password <name> | migrate <name>)").action(async (action, username) => {
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
setupProxy,
|
|
24
24
|
spawnAgentContext,
|
|
25
25
|
truncateOutput
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-MVARMOOJ.js";
|
|
27
27
|
import {
|
|
28
28
|
AGENTIC_BEHAVIOR_GUIDELINE,
|
|
29
29
|
CONTEXT_FILE_CANDIDATES,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
PLAN_MODE_SYSTEM_ADDON,
|
|
36
36
|
SKILLS_DIR_NAME,
|
|
37
37
|
VERSION
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-ZV5BU6FL.js";
|
|
39
39
|
import {
|
|
40
40
|
AuthManager
|
|
41
41
|
} from "./chunk-CPLT6CD3.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jinzd-ai-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Cross-platform REPL-style AI CLI with multi-provider support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -51,9 +51,13 @@
|
|
|
51
51
|
"node": ">=20.0.0"
|
|
52
52
|
},
|
|
53
53
|
"files": [
|
|
54
|
-
"dist",
|
|
55
|
-
"
|
|
56
|
-
"
|
|
54
|
+
"dist/index.js",
|
|
55
|
+
"dist/chunk-*.js",
|
|
56
|
+
"dist/server-*.js",
|
|
57
|
+
"dist/auth-*.js",
|
|
58
|
+
"dist/run-tests-*.js",
|
|
59
|
+
"dist/web/",
|
|
60
|
+
"README.md"
|
|
57
61
|
],
|
|
58
62
|
"keywords": [
|
|
59
63
|
"ai",
|
|
@@ -78,25 +82,20 @@
|
|
|
78
82
|
"@anthropic-ai/sdk": "^0.39.0",
|
|
79
83
|
"@google/generative-ai": "^0.24.0",
|
|
80
84
|
"@inquirer/prompts": "^7.0.0",
|
|
81
|
-
"@types/express": "^5.0.6",
|
|
82
|
-
"@types/ws": "^8.18.1",
|
|
83
|
-
"boxen": "^8.0.1",
|
|
84
85
|
"chalk": "^5.4.1",
|
|
85
86
|
"commander": "^13.0.0",
|
|
86
|
-
"dotenv": "^16.4.7",
|
|
87
87
|
"express": "^5.2.1",
|
|
88
|
-
"marked": "^15.0.0",
|
|
89
|
-
"marked-terminal": "^7.3.0",
|
|
90
88
|
"openai": "^4.77.0",
|
|
91
|
-
"ora": "^8.2.0",
|
|
92
89
|
"undici": "^7.22.0",
|
|
93
90
|
"uuid": "^11.0.5",
|
|
94
91
|
"ws": "^8.19.0",
|
|
95
92
|
"zod": "^3.24.1"
|
|
96
93
|
},
|
|
97
94
|
"devDependencies": {
|
|
95
|
+
"@types/express": "^5.0.6",
|
|
98
96
|
"@types/node": "^22.10.0",
|
|
99
97
|
"@types/uuid": "^10.0.0",
|
|
98
|
+
"@types/ws": "^8.18.1",
|
|
100
99
|
"@yao-pkg/pkg": "^6.14.0",
|
|
101
100
|
"electron": "^35.0.0",
|
|
102
101
|
"electron-builder": "^26.0.0",
|