blade-code 0.0.8 → 0.0.10

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.en.md CHANGED
@@ -21,7 +21,7 @@ English | [简体中文](README.md)
21
21
  <tr>
22
22
  <td width="50%" valign="top">
23
23
  <h3>🤖 Intelligent Conversations</h3>
24
- <p>Natural language interactions powered by LLMs with context understanding and multi-turn dialogues</p>
24
+ <p>Natural language interactions powered by LLMs with context understanding and multi-turn dialogues. Simply run <code>blade "task"</code> to launch the UI and auto-send your first message.</p>
25
25
  </td>
26
26
  <td width="50%" valign="top">
27
27
  <h3>🛠️ Rich Toolset</h3>
@@ -92,6 +92,8 @@ blade
92
92
  blade --print "Hello, introduce yourself"
93
93
  ```
94
94
 
95
+ > On the first run, if no API key is detected, Blade will automatically open an interactive setup wizard in your terminal to collect Provider, Base URL, API Key, and model information before continuing.
96
+
95
97
  ---
96
98
 
97
99
  ## 🔐 Configure API Keys
@@ -110,20 +112,29 @@ export VOLCENGINE_API_KEY="your-volcengine-api-key"
110
112
  export BLADE_BASE_URL="https://ark.cn-beijing.volces.com/api/v3"
111
113
  ```
112
114
 
113
- ### Method 2: Command Line Arguments
115
+ ### Method 2: First-Run Setup Wizard (Recommended Experience)
116
+
117
+ ```bash
118
+ blade
119
+ # If no API key is configured, an interactive wizard will guide you through Provider, Base URL, API Key, and model setup.
120
+ ```
121
+
122
+ ### Method 3: Command Line Arguments
114
123
 
115
124
  ```bash
116
- blade --print "Hello" # Uses configured API key
125
+ blade --api-key your-api-key --base-url https://api.example.com "Hello"
117
126
  ```
118
127
 
119
- ### Method 3: Configuration File
128
+ ### Method 4: Configuration File
120
129
 
121
130
  ```bash
122
- # Copy example config
123
- cp config.env.example .env
131
+ # User-level configuration
132
+ mkdir -p ~/.blade
133
+ nano ~/.blade/config.json
124
134
 
125
- # Edit .env file with your credentials
126
- nano .env
135
+ # Project-level configuration
136
+ mkdir -p .blade
137
+ nano .blade/config.json
127
138
  ```
128
139
 
129
140
  ### Get API Keys
@@ -141,25 +152,30 @@ nano .env
141
152
  # Interactive mode (default)
142
153
  blade
143
154
 
144
- # Direct message (with --print for non-interactive)
145
- blade --print "What is artificial intelligence?"
155
+ # Direct message (automatically sent once the UI is ready)
156
+ blade "What is artificial intelligence?"
146
157
 
147
158
  # Code generation
148
- blade --print "Write a debounce function in JavaScript"
159
+ blade "Write a debounce function in JavaScript"
160
+
161
+ # Non-interactive quick answer
162
+ blade --print "Summarize the repo in one sentence"
149
163
  ```
150
164
 
165
+ > Any message passed as `blade "..."` is automatically injected and executed once the interactive UI finishes initializing—no extra keystrokes required.
166
+
151
167
  ### Smart Tool Invocation
152
168
 
153
169
  Blade Code automatically selects appropriate tools based on your needs:
154
170
 
155
171
  ```bash
156
172
  # File operations
157
- blade --print "List all TypeScript files in the current directory"
173
+ blade "List all TypeScript files in the current directory"
158
174
 
159
175
  # Git operations
160
- blade --print "Show the last 5 commit logs"
176
+ blade "Show the last 5 commit logs"
161
177
 
162
- # Code review
178
+ # Code review (non-interactive example)
163
179
  blade --print "Review code quality in src/utils directory"
164
180
  ```
165
181
 
@@ -167,7 +183,7 @@ blade --print "Review code quality in src/utils directory"
167
183
 
168
184
  ```bash
169
185
  # Create or use named session
170
- blade --sessionId "project-alpha" "Start new project"
186
+ blade --session-id "project-alpha" "Start new project"
171
187
 
172
188
  # Continue recent session
173
189
  blade --continue
@@ -176,7 +192,7 @@ blade --continue
176
192
  blade --resume <conversation-id>
177
193
 
178
194
  # Fork session (create new session from existing)
179
- blade --resume <id> --forkSession
195
+ blade --resume <id> --fork-session
180
196
  ```
181
197
 
182
198
  ### Print Mode
@@ -188,23 +204,23 @@ Perfect for piping and scripting:
188
204
  blade --print "Generate a README template" > README.md
189
205
 
190
206
  # Specify output format
191
- blade --print --outputFormat json "Get project info"
207
+ blade --print --output-format json "Get project info"
192
208
 
193
209
  # Stream JSON output
194
- blade --print --outputFormat stream-json "Analyze code"
210
+ blade --print --output-format stream-json "Analyze code"
195
211
  ```
196
212
 
197
213
  ### Input/Output Options
198
214
 
199
215
  ```bash
200
216
  # Read from stdin (stream JSON format)
201
- cat input.json | blade --inputFormat stream-json --print
217
+ cat input.json | blade --input-format stream-json --print
202
218
 
203
219
  # Include partial message chunks
204
- blade --print --includePartialMessages "Generate long text"
220
+ blade --print --include-partial-messages "Generate long text"
205
221
 
206
222
  # Replay user messages
207
- blade --replayUserMessages < input.txt
223
+ blade --replay-user-messages < input.txt
208
224
  ```
209
225
 
210
226
  ---
@@ -220,10 +236,10 @@ Model Context Protocol allows integration of external tools and resources:
220
236
  blade mcp
221
237
 
222
238
  # Load MCP config from JSON file
223
- blade --mcpConfig config.json "Use external tools"
239
+ blade --mcp-config config.json "Use external tools"
224
240
 
225
241
  # Strict mode (only use specified MCP config)
226
- blade --mcpConfig config.json --strictMcpConfig "Query"
242
+ blade --mcp-config config.json --strict-mcp-config "Query"
227
243
  ```
228
244
 
229
245
  ### Configuration Management
@@ -249,10 +265,13 @@ blade setup-token
249
265
  blade --model qwen-max --print "Complex question"
250
266
 
251
267
  # Set fallback model
252
- blade --fallbackModel qwen-turbo --print "Question"
268
+ blade --fallback-model qwen-turbo --print "Question"
253
269
 
254
270
  # Custom system prompt
255
- blade --appendSystemPrompt "You are a senior architect" --print "Design microservices architecture"
271
+ blade --append-system-prompt "You are a senior architect" --print "Design microservices architecture"
272
+
273
+ # Replace default system prompt entirely
274
+ blade --system-prompt "You are a TypeScript expert" --print "Explain decorators"
256
275
 
257
276
  # Custom agent config
258
277
  blade --agents '{"reviewer": {"model": "qwen-max"}}' --print "Review code"
@@ -260,22 +279,22 @@ blade --agents '{"reviewer": {"model": "qwen-max"}}' --print "Review code"
260
279
 
261
280
  ### Security & Permissions
262
281
 
263
- ```bash
264
- # Skip permission checks (dangerous)
265
- blade --dangerouslySkipPermissions --print "Execute command"
282
+ Blade ships with a three-tier permission system (`allow` / `ask` / `deny`). You can fine-tune runtime behavior with CLI flags:
266
283
 
284
+ ```bash
267
285
  # Allow specific tools only
268
- blade --allowedTools "read,write" --print "Handle files"
286
+ blade --allowed-tools "read,write" --print "Handle files"
269
287
 
270
288
  # Disallow specific tools
271
- blade --disallowedTools "bash,execute" --print "Safe operations"
289
+ blade --disallowed-tools "bash,execute" --print "Safe operations"
272
290
 
273
291
  # Permission modes
274
- blade --permissionMode plan --print "Plan task" # Plan only, no execution
275
- blade --permissionMode acceptEdits --print "Modify code" # Auto-accept edits
292
+ blade --permission-mode plan --print "Plan task" # Plan only, no execution
293
+ blade --permission-mode autoEdit --print "Modify code" # Auto-approve edits
294
+ blade --yolo --print "Run high-trust operations" # Approve every tool call
276
295
 
277
296
  # Add allowed directories
278
- blade --addDir /path/to/dir --print "Access directory"
297
+ blade --add-dir /path/to/dir --print "Access directory"
279
298
  ```
280
299
 
281
300
  ### IDE Integration
@@ -292,7 +311,7 @@ blade --ide
292
311
  blade --settings settings.json
293
312
 
294
313
  # Specify config sources
295
- blade --settingSources "global,user,local"
314
+ blade --setting-sources "global,user,local"
296
315
  ```
297
316
 
298
317
  ---
@@ -324,40 +343,41 @@ blade --settingSources "global,user,local"
324
343
  | Option | Short | Description |
325
344
  |--------|-------|-------------|
326
345
  | `--print` | `-p` | Print response and exit (for piping) |
327
- | `--outputFormat <format>` | | Output format: text/json/stream-json (with --print only) |
328
- | `--includePartialMessages` | | Include partial message chunks |
346
+ | `--output-format <format>` | | Output format: text/json/stream-json (with --print only) |
347
+ | `--include-partial-messages` | | Include partial message chunks |
329
348
 
330
349
  ### Input Options
331
350
 
332
351
  | Option | Description |
333
352
  |--------|-------------|
334
- | `--inputFormat <format>` | Input format: text/stream-json |
335
- | `--replayUserMessages` | Re-emit user messages from stdin |
353
+ | `--input-format <format>` | Input format: text/stream-json |
354
+ | `--replay-user-messages` | Re-emit user messages from stdin |
336
355
 
337
356
  ### Security Options
338
357
 
339
358
  | Option | Description |
340
359
  |--------|-------------|
341
- | `--dangerouslySkipPermissions` | Skip all permission checks (dangerous) |
342
- | `--allowedTools <tools>` | Allowed tools list (comma or space separated) |
343
- | `--disallowedTools <tools>` | Disallowed tools list (comma or space separated) |
344
- | `--permissionMode <mode>` | Permission mode: acceptEdits/bypassPermissions/default/plan |
345
- | `--addDir <dirs>` | Additional directories for tool access |
360
+ | `--allowed-tools <tools>` | Allowed tools list (comma or space separated) |
361
+ | `--disallowed-tools <tools>` | Disallowed tools list (comma or space separated) |
362
+ | `--permission-mode <mode>` | Permission mode: default/autoEdit/yolo/plan |
363
+ | `--yolo` | Shortcut for `--permission-mode yolo` |
364
+ | `--add-dir <dirs>` | Additional directories for tool access |
346
365
 
347
366
  ### MCP Options
348
367
 
349
368
  | Option | Description |
350
369
  |--------|-------------|
351
- | `--mcpConfig <files>` | Load MCP servers from JSON files or strings |
352
- | `--strictMcpConfig` | Only use servers from --mcpConfig |
370
+ | `--mcp-config <files>` | Load MCP servers from JSON files or strings |
371
+ | `--strict-mcp-config` | Only use servers from --mcp-config |
353
372
 
354
373
  ### AI Options
355
374
 
356
375
  | Option | Description |
357
376
  |--------|-------------|
358
- | `--appendSystemPrompt <text>` | Append system prompt to default |
377
+ | `--append-system-prompt <text>` | Append system prompt to default |
378
+ | `--system-prompt <text>` | Replace default system prompt |
359
379
  | `--model <name>` | Model for current session |
360
- | `--fallbackModel <name>` | Enable automatic fallback to specified model |
380
+ | `--fallback-model <name>` | Enable automatic fallback to specified model |
361
381
  | `--agents <json>` | Custom agent configuration JSON |
362
382
 
363
383
  ### Session Options
@@ -366,15 +386,15 @@ blade --settingSources "global,user,local"
366
386
  |--------|-------|-------------|
367
387
  | `--continue` | `-c` | Continue recent session |
368
388
  | `--resume <id>` | `-r` | Resume specific session |
369
- | `--forkSession` | | Create new session ID when resuming |
370
- | `--sessionId <id>` | | Use specific session ID |
389
+ | `--fork-session` | | Create new session ID when resuming |
390
+ | `--session-id <id>` | | Use specific session ID |
371
391
 
372
392
  ### Configuration Options
373
393
 
374
394
  | Option | Description |
375
395
  |--------|-------------|
376
396
  | `--settings <path>` | Settings JSON file path or JSON string |
377
- | `--settingSources <sources>` | Setting sources to load (comma separated) |
397
+ | `--setting-sources <sources>` | Setting sources to load (comma separated) |
378
398
 
379
399
  ### Integration Options
380
400
 
package/README.md CHANGED
@@ -21,7 +21,7 @@
21
21
  <tr>
22
22
  <td width="50%" valign="top">
23
23
  <h3>🤖 智能对话</h3>
24
- <p>基于大语言模型的自然语言交互,支持上下文理解和多轮对话</p>
24
+ <p>基于大语言模型的自然语言交互,支持上下文理解和多轮对话,直接运行 <code>blade "任务"</code> 即可自动进入界面并发送首条消息</p>
25
25
  </td>
26
26
  <td width="50%" valign="top">
27
27
  <h3>🛠️ 丰富工具</h3>
@@ -52,6 +52,15 @@
52
52
 
53
53
  ---
54
54
 
55
+ ## 📖 文档
56
+
57
+ - **[完整文档](docs/index.md)** - 文档中心导航
58
+ - **[用户文档](docs/public/README.md)** - 安装、配置、使用指南
59
+ - **[开发者文档](docs/development/README.md)** - 架构设计、技术实现
60
+ - **[贡献指南](docs/contributing/README.md)** - 参与开源贡献
61
+
62
+ ---
63
+
55
64
  ## 🚀 快速开始
56
65
 
57
66
  ### ⚡ 零安装试用
@@ -92,6 +101,8 @@ blade
92
101
  blade --print "你好,介绍一下自己"
93
102
  ```
94
103
 
104
+ > 首次运行若未检测到 API 密钥,会自动弹出终端设置向导,按提示填写 Provider / Base URL / API Key / 模型后即可继续使用。
105
+
95
106
  ---
96
107
 
97
108
  ## 🔐 配置 API 密钥
@@ -110,20 +121,31 @@ export VOLCENGINE_API_KEY="your-volcengine-api-key"
110
121
  export BLADE_BASE_URL="https://ark.cn-beijing.volces.com/api/v3"
111
122
  ```
112
123
 
113
- ### 方式二:命令行参数
124
+ ### 方式二:首启设置向导(推荐体验)
114
125
 
115
126
  ```bash
116
- blade --api-key your-api-key --base-url https://api.example.com "你好"
127
+ blade
128
+ # 若未配置 API Key,将自动引导完成 Provider、Base URL、API Key、模型的填写
117
129
  ```
118
130
 
119
- ### 方式三:配置文件
131
+ ### 方式三:命令行参数
120
132
 
121
133
  ```bash
122
- # 复制示例配置文件
123
- cp config.env.example .env
134
+ blade --api-key your-api-key --base-url https://api.example.com "你好"
135
+ ```
124
136
 
125
- # 编辑 .env 文件,填入您的配置
126
- nano .env
137
+ ### 方式四:配置文件
138
+
139
+ ```bash
140
+ # 用户级配置
141
+ mkdir -p ~/.blade
142
+ nano ~/.blade/config.json
143
+
144
+ # 项目级配置(提交到仓库)
145
+ mkdir -p .blade
146
+ nano .blade/config.json
147
+ # 或者为当前机器准备不提交的设置
148
+ nano .blade/settings.local.json
127
149
  ```
128
150
 
129
151
  ### 获取 API 密钥
@@ -141,7 +163,7 @@ nano .env
141
163
  # 交互式模式(默认)
142
164
  blade
143
165
 
144
- # 直接发送消息
166
+ # 直接发送消息(会在 UI 初始化后自动输入并执行)
145
167
  blade "什么是人工智能?"
146
168
 
147
169
  # 代码生成
@@ -167,7 +189,7 @@ blade "审查 src/utils 目录的代码质量"
167
189
 
168
190
  ```bash
169
191
  # 创建或使用命名会话
170
- blade --sessionId "project-alpha" "开始新项目"
192
+ blade --session-id "project-alpha" "开始新项目"
171
193
 
172
194
  # 继续最近的会话
173
195
  blade --continue
@@ -176,7 +198,7 @@ blade --continue
176
198
  blade --resume <conversation-id>
177
199
 
178
200
  # Fork 会话(从现有会话创建新会话)
179
- blade --resume <id> --forkSession
201
+ blade --resume <id> --fork-session
180
202
  ```
181
203
 
182
204
  ### 打印模式
@@ -188,23 +210,23 @@ blade --resume <id> --forkSession
188
210
  blade --print "生成一个 README 模板" > README.md
189
211
 
190
212
  # 指定输出格式
191
- blade --print --outputFormat json "获取项目信息"
213
+ blade --print --output-format json "获取项目信息"
192
214
 
193
215
  # 流式 JSON 输出
194
- blade --print --outputFormat stream-json "分析代码"
216
+ blade --print --output-format stream-json "分析代码"
195
217
  ```
196
218
 
197
219
  ### 输入/输出选项
198
220
 
199
221
  ```bash
200
222
  # 从标准输入读取(流式 JSON 格式)
201
- cat input.json | blade --inputFormat stream-json --print
223
+ cat input.json | blade --input-format stream-json --print
202
224
 
203
225
  # 包含部分消息块
204
- blade --print --includePartialMessages "长文本生成"
226
+ blade --print --include-partial-messages "长文本生成"
205
227
 
206
228
  # 重新发送用户消息
207
- blade --replayUserMessages < input.txt
229
+ blade --replay-user-messages < input.txt
208
230
  ```
209
231
 
210
232
  ---
@@ -220,10 +242,10 @@ Model Context Protocol 允许集成外部工具和资源:
220
242
  blade mcp
221
243
 
222
244
  # 从 JSON 文件加载 MCP 配置
223
- blade --mcpConfig config.json "使用外部工具"
245
+ blade --mcp-config config.json "使用外部工具"
224
246
 
225
247
  # 仅使用指定的 MCP 配置(严格模式)
226
- blade --mcpConfig config.json --strictMcpConfig "查询"
248
+ blade --mcp-config config.json --strict-mcp-config "查询"
227
249
  ```
228
250
 
229
251
  ### 配置管理
@@ -249,10 +271,13 @@ blade setup-token
249
271
  blade --model qwen-max "复杂的问题"
250
272
 
251
273
  # 设置回退模型
252
- blade --fallbackModel qwen-turbo "问题"
274
+ blade --fallback-model qwen-turbo "问题"
253
275
 
254
276
  # 自定义系统提示
255
- blade --appendSystemPrompt "你是一位资深架构师" "设计微服务架构"
277
+ blade --append-system-prompt "你是一位资深架构师" "设计微服务架构"
278
+
279
+ # 完全替换默认系统提示
280
+ blade --system-prompt "你是一位 TypeScript 专家" "解释装饰器"
256
281
 
257
282
  # 自定义 Agent 配置
258
283
  blade --agents '{"reviewer": {"model": "qwen-max"}}' "审查代码"
@@ -260,24 +285,48 @@ blade --agents '{"reviewer": {"model": "qwen-max"}}' "审查代码"
260
285
 
261
286
  ### 安全与权限
262
287
 
263
- ```bash
264
- # 跳过权限检查(危险)
265
- blade --dangerouslySkipPermissions "执行命令"
288
+ Blade 提供强大的三级权限控制系统(allow/ask/deny):
266
289
 
290
+ ```bash
267
291
  # 仅允许特定工具
268
- blade --allowedTools "read,write" "处理文件"
292
+ blade --allowed-tools "read,write" "处理文件"
269
293
 
270
294
  # 禁止特定工具
271
- blade --disallowedTools "bash,execute" "安全操作"
295
+ blade --disallowed-tools "bash,execute" "安全操作"
272
296
 
273
297
  # 权限模式
274
- blade --permissionMode plan "规划任务" # 仅规划不执行
275
- blade --permissionMode acceptEdits "修改代码" # 自动接受编辑
298
+ blade --permission-mode plan "规划任务" # 仅规划不执行
299
+ blade --permission-mode autoEdit "修改代码" # 自动接受编辑
300
+ blade --yolo "任意工具自动批准" # 开启 YOLO 模式
276
301
 
277
302
  # 添加允许访问的目录
278
- blade --addDir /path/to/dir "访问目录"
303
+ blade --add-dir /path/to/dir "访问目录"
304
+ ```
305
+
306
+ **权限配置示例** (`.blade/settings.json`):
307
+ ```json
308
+ {
309
+ "permissions": {
310
+ "allow": [
311
+ "Read(file_path:**/*.ts)",
312
+ "Grep",
313
+ "Glob"
314
+ ],
315
+ "ask": [
316
+ "Write",
317
+ "Edit",
318
+ "Bash(command:npm *)"
319
+ ],
320
+ "deny": [
321
+ "Read(file_path:.env)",
322
+ "Bash(command:rm -rf *)"
323
+ ]
324
+ }
325
+ }
279
326
  ```
280
327
 
328
+ 详见 [权限系统指南](docs/public/configuration/permissions.md)
329
+
281
330
  ### IDE 集成
282
331
 
283
332
  ```bash
@@ -292,7 +341,7 @@ blade --ide
292
341
  blade --settings settings.json
293
342
 
294
343
  # 指定配置源
295
- blade --settingSources "global,user,local"
344
+ blade --setting-sources "global,user,local"
296
345
  ```
297
346
 
298
347
  ---
@@ -324,40 +373,41 @@ blade --settingSources "global,user,local"
324
373
  | 选项 | 简写 | 说明 |
325
374
  |------|------|------|
326
375
  | `--print` | `-p` | 打印响应并退出(适合管道) |
327
- | `--outputFormat <format>` | | 输出格式:text/json/stream-json(仅与 --print 配合) |
328
- | `--includePartialMessages` | | 包含部分消息块 |
376
+ | `--output-format <format>` | | 输出格式:text/json/stream-json(仅与 --print 配合) |
377
+ | `--include-partial-messages` | | 包含部分消息块 |
329
378
 
330
379
  ### 输入选项
331
380
 
332
381
  | 选项 | 说明 |
333
382
  |------|------|
334
- | `--inputFormat <format>` | 输入格式:text/stream-json |
335
- | `--replayUserMessages` | 重新发送来自 stdin 的用户消息 |
383
+ | `--input-format <format>` | 输入格式:text/stream-json |
384
+ | `--replay-user-messages` | 重新发送来自 stdin 的用户消息 |
336
385
 
337
386
  ### 安全选项
338
387
 
339
388
  | 选项 | 说明 |
340
389
  |------|------|
341
- | `--dangerouslySkipPermissions` | 跳过所有权限检查(危险) |
342
- | `--allowedTools <tools>` | 允许的工具列表(逗号或空格分隔) |
343
- | `--disallowedTools <tools>` | 禁止的工具列表(逗号或空格分隔) |
344
- | `--permissionMode <mode>` | 权限模式:acceptEdits/bypassPermissions/default/plan |
345
- | `--addDir <dirs>` | 允许工具访问的额外目录 |
390
+ | `--allowed-tools <tools>` | 允许的工具列表(逗号或空格分隔) |
391
+ | `--disallowed-tools <tools>` | 禁止的工具列表(逗号或空格分隔) |
392
+ | `--permission-mode <mode>` | 权限模式:default/autoEdit/yolo/plan |
393
+ | `--yolo` | YOLO 模式快捷开关(等同于 `--permission-mode yolo`) |
394
+ | `--add-dir <dirs>` | 允许工具访问的额外目录 |
346
395
 
347
396
  ### MCP 选项
348
397
 
349
398
  | 选项 | 说明 |
350
399
  |------|------|
351
- | `--mcpConfig <files>` | 从 JSON 文件或字符串加载 MCP 服务器 |
352
- | `--strictMcpConfig` | 仅使用 --mcpConfig 指定的服务器 |
400
+ | `--mcp-config <files>` | 从 JSON 文件或字符串加载 MCP 服务器 |
401
+ | `--strict-mcp-config` | 仅使用 --mcp-config 指定的服务器 |
353
402
 
354
403
  ### AI 选项
355
404
 
356
405
  | 选项 | 说明 |
357
406
  |------|------|
358
- | `--appendSystemPrompt <text>` | 追加系统提示到默认提示 |
407
+ | `--append-system-prompt <text>` | 追加系统提示到默认提示 |
408
+ | `--system-prompt <text>` | 完全替换默认系统提示 |
359
409
  | `--model <name>` | 当前会话使用的模型 |
360
- | `--fallbackModel <name>` | 启用自动回退到指定模型 |
410
+ | `--fallback-model <name>` | 启用自动回退到指定模型 |
361
411
  | `--agents <json>` | 自定义 Agent 的 JSON 对象 |
362
412
 
363
413
  ### 会话选项
@@ -366,15 +416,15 @@ blade --settingSources "global,user,local"
366
416
  |------|------|------|
367
417
  | `--continue` | `-c` | 继续最近的会话 |
368
418
  | `--resume <id>` | `-r` | 恢复指定会话 |
369
- | `--forkSession` | | 恢复会话时创建新会话 ID |
370
- | `--sessionId <id>` | | 使用特定会话 ID |
419
+ | `--fork-session` | | 恢复会话时创建新会话 ID |
420
+ | `--session-id <id>` | | 使用特定会话 ID |
371
421
 
372
422
  ### 配置选项
373
423
 
374
424
  | 选项 | 说明 |
375
425
  |------|------|
376
426
  | `--settings <path>` | | 设置 JSON 文件路径或 JSON 字符串 |
377
- | `--settingSources <sources>` | | 要加载的设置源(逗号分隔) |
427
+ | `--setting-sources <sources>` | | 要加载的设置源(逗号分隔) |
378
428
 
379
429
  ### 集成选项
380
430
 
@@ -397,13 +447,19 @@ Blade Code 采用现代化的扁平化架构设计:
397
447
 
398
448
  ```
399
449
  src/
400
- ├── agent/ # Agent 核心逻辑
450
+ ├── agent/ # Agent 核心逻辑和控制器
401
451
  ├── cli/ # CLI 配置和中间件
402
- ├── commands/ # 命令处理器
403
- ├── config/ # 配置管理
404
- ├── tools/ # 工具系统
405
- ├── ui/ # UI 组件(基于 Ink)
406
- ├── services/ # 共享服务
452
+ ├── commands/ # CLI 命令定义和处理
453
+ ├── config/ # 统一配置管理(双文件系统)
454
+ ├── tools/ # 工具系统(含执行管道)
455
+ ├── builtin/ # 内置工具
456
+ ├── execution/ # 6阶段执行管道
457
+ │ ├── registry/ # 工具注册中心
458
+ │ └── validation/ # 参数验证
459
+ ├── ui/ # UI 组件和界面(基于 Ink)
460
+ ├── services/ # 共享服务层
461
+ ├── prompts/ # 提示模板管理
462
+ ├── mcp/ # MCP 协议实现
407
463
  └── utils/ # 工具函数
408
464
  ```
409
465
 
@@ -414,6 +470,9 @@ src/
414
470
  - 🎨 **React for CLI**:基于 Ink 的现代化 UI
415
471
  - 🔧 **TypeScript**:完整类型支持
416
472
  - ✅ **全面测试**:单元、集成、E2E 测试覆盖
473
+ - 🔒 **6阶段执行管道**:Discovery → Validation → Permission → Confirmation → Execution → Formatting
474
+ - 🛡️ **三级权限控制**:allow/ask/deny 精细化权限管理
475
+ - 🎯 **双配置文件系统**:config.json(基础配置) + settings.json(行为配置)
417
476
 
418
477
  ---
419
478