deepminer-cli 0.1.24 → 0.1.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,6 +13,8 @@ DeepMiner 系统的命令行工具,用于管理认证、配置和 AI 会话。
13
13
  - **文件上传**: 上传文件到 OSS,带文件大小验证
14
14
  - **AI 会话**: 启动 AI 助手会话,支持自定义消息和 claw_param 参数
15
15
  - **JSON 输出**: 所有命令支持 `--json` 结构化输出,适合 AI agent 和脚本调用
16
+ - **错误提示**: 错误响应包含 `hint` 字段,提供可操作的修复建议
17
+ - **Dry Run**: `--dry-run` 预览 HTTP 请求而不实际执行
16
18
  - **CLI Schema**: 内置 `schema` 命令输出机器可读的能力描述
17
19
  - **zsh 自动补全**: 安装后自动配置
18
20
 
@@ -154,18 +156,46 @@ dm-cli --help # 显示帮助信息
154
156
  | Flag | 说明 |
155
157
  |------|------|
156
158
  | `--json` | 以 JSON 格式输出结果 |
159
+ | `--dry-run` | 预览 HTTP 请求而不实际执行 |
157
160
  | `--help` | 显示帮助信息 |
158
161
 
159
- JSON 模式下成功输出格式:
162
+ ### JSON 输出格式
163
+
164
+ 成功:
160
165
  ```json
161
166
  {"ok": true, "data": {...}}
162
167
  ```
163
168
 
164
- JSON 模式下错误输出格式:
169
+ 错误(含修复建议):
165
170
  ```json
166
- {"ok": false, "error": {"type": "auth", "message": "未登陆"}}
171
+ {"ok": false, "error": {"type": "auth", "message": "未登陆", "hint": "运行 'dm-cli auth login --username <user> --password <pass>' 登录"}}
172
+ ```
173
+
174
+ `hint` 字段提供可操作的修复建议,AI agent 可直接据此自动恢复。
175
+
176
+ ### Dry Run 模式
177
+
178
+ 使用 `--dry-run` 预览请求而不实际执行,适合调试和 AI agent 安全验证:
179
+
180
+ ```bash
181
+ dm-cli --dry-run auth login --username user --password pass
182
+ # [DRY RUN] POST https://api.example.com/api/auth/authentication/login
183
+ # Headers:
184
+ # Content-Type: application/json
185
+ # Body:
186
+ # {"username": "user", "password": "pass"}
167
187
  ```
168
188
 
189
+ JSON 模式:
190
+ ```bash
191
+ dm-cli --dry-run --json agent start-thread --message "你好"
192
+ ```
193
+ ```json
194
+ {"ok": true, "dry_run": true, "data": {"method": "POST", "url": "...", "headers": {...}, "body": {...}}}
195
+ ```
196
+
197
+ 只读命令(`config show`、`auth status`、`version`、`schema`)和纯本地操作(`config init`、`auth logout`)不受 `--dry-run` 影响,正常执行。
198
+
169
199
  ## 文件说明
170
200
 
171
201
  ### 配置文件:`~/.dm-cli/config.json`
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepminer-cli",
3
- "version": "0.1.24",
3
+ "version": "0.1.25",
4
4
  "description": "DeepMiner CLI - Command-line tool for DM system with cross-platform support, JWT authentication, and workspace management",
5
5
  "keywords": [
6
6
  "deepminer",