@qwen-code/qwen-code 0.16.0-preview.0 → 0.16.1
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/bundled/qc-helper/docs/configuration/settings.md +39 -37
- package/bundled/qc-helper/docs/features/_meta.ts +2 -0
- package/bundled/qc-helper/docs/features/approval-mode.md +119 -2
- package/bundled/qc-helper/docs/features/auto-mode.md +263 -0
- package/bundled/qc-helper/docs/features/commands.md +11 -10
- package/bundled/qc-helper/docs/features/skills.md +3 -0
- package/bundled/qc-helper/docs/features/structured-output.md +309 -0
- package/bundled/qc-helper/docs/features/sub-agents.md +47 -5
- package/bundled/qc-helper/docs/qwen-serve.md +119 -14
- package/bundled/review/SKILL.md +12 -3
- package/chunks/{agent-ZNQPH67I.js → agent-2JCG7FDJ.js} +9 -11
- package/chunks/{anthropicContentGenerator-ICBDZ6R2.js → anthropicContentGenerator-RQJNXJIY.js} +6 -3
- package/chunks/{askUserQuestion-WQILGUSQ.js → askUserQuestion-PQPMPNM3.js} +1 -1
- package/chunks/{ca-S3XJMT6P.js → ca-UZ7BANMN.js} +3 -3
- package/chunks/{chunk-XVHR7ATJ.js → chunk-4AOCVI6J.js} +1 -0
- package/chunks/chunk-7LMPOVYW.js +956 -0
- package/chunks/{chunk-MNPZ2WO6.js → chunk-BAZDG3QU.js} +9104 -3955
- package/chunks/{chunk-AEJ2DKLP.js → chunk-C6WMLUNB.js} +1 -1
- package/chunks/{chunk-PPHYLJSS.js → chunk-CAVZVZX6.js} +2 -2
- package/chunks/{chunk-VTPOO6GV.js → chunk-CSWBPY3P.js} +1 -1
- package/chunks/chunk-D6LBYOCX.js +19126 -0
- package/chunks/{chunk-NAID3ZWF.js → chunk-DMIMF3CG.js} +1 -1
- package/chunks/{chunk-2B7UBDY5.js → chunk-GGNTZ2NH.js} +90 -19
- package/chunks/chunk-HW5S7L73.js +379 -0
- package/chunks/{chunk-C3LHPHN2.js → chunk-JCR2WRXZ.js} +1227 -657
- package/chunks/{chunk-EDYSNFEM.js → chunk-L5E26RN6.js} +2 -2
- package/chunks/{chunk-CW44BRRA.js → chunk-MAY32HXD.js} +375 -0
- package/chunks/{chunk-7QXHXMC6.js → chunk-N6GSJHZ4.js} +96 -20
- package/chunks/{chunk-FZIUV27X.js → chunk-PVVL5Q3W.js} +31 -0
- package/chunks/{chunk-YHEAJFCI.js → chunk-USE2VQ5P.js} +3 -0
- package/chunks/{chunk-JYQUJ5DS.js → chunk-YJLGXDQJ.js} +1 -1
- package/chunks/{contextCommand-IGBCEXI4.js → contextCommand-XVRGKS3Q.js} +11 -13
- package/chunks/{cron-create-AVI3Q267.js → cron-create-IGYXQVG4.js} +27 -1
- package/chunks/{cron-delete-ZCEGDXXV.js → cron-delete-ETKIZCWT.js} +1 -1
- package/chunks/{cron-list-VN653OK5.js → cron-list-BVCUSWRU.js} +1 -1
- package/chunks/{de-MNR4SMAI.js → de-V4IE2OOZ.js} +3 -3
- package/chunks/{dist-RRYNPBOE.js → dist-4L54HRX2.js} +2 -2
- package/chunks/{dist-WP4AH3VK.js → dist-BXDUQ2QY.js} +1 -1
- package/chunks/{dist-M6GFCZ7S.js → dist-MN2PDDPR.js} +1 -1
- package/chunks/{edit-74Q4AFHQ.js → edit-3MLXHQPW.js} +22 -12
- package/chunks/{en-FIUWJSZR.js → en-HGJ2SPLM.js} +4 -3
- package/chunks/{enter-worktree-H72HXC7D.js → enter-worktree-OCA4SG6D.js} +35 -11
- package/chunks/{exit-worktree-FGIQO3S3.js → exit-worktree-6EDLXVEV.js} +35 -11
- package/chunks/{exitPlanMode-NBR2PK2D.js → exitPlanMode-H75KHRX4.js} +9 -11
- package/chunks/{fr-OFJFHLCR.js → fr-CJULI7ZX.js} +3 -3
- package/chunks/{geminiContentGenerator-33RP4WKD.js → geminiContentGenerator-E7Y6TCPU.js} +1 -1
- package/chunks/{glob-WEE3CJL6.js → glob-JFFSKARO.js} +9 -11
- package/chunks/{grep-DZKSBFZK.js → grep-7TAFR7MX.js} +9 -11
- package/chunks/{ja-V6OQ6VL7.js → ja-L7CHRQEW.js} +3 -3
- package/chunks/{ls-6F3VSP6S.js → ls-7HD6XG3V.js} +1 -1
- package/chunks/{lsp-67Y7DJN5.js → lsp-ZZSFCIWD.js} +1 -1
- package/chunks/{monitor-EDZWEZVS.js → monitor-YX2ABLXH.js} +21 -11
- package/chunks/notebook-edit-EEJEGFZR.js +756 -0
- package/chunks/{openaiContentGenerator-5NQG3W64.js → openaiContentGenerator-BSAWHGQJ.js} +9 -8
- package/chunks/{pt-ZLE6SA4A.js → pt-M6JULLEQ.js} +3 -3
- package/chunks/{qwenContentGenerator-4DPUUS6R.js → qwenContentGenerator-47XRHQXM.js} +11 -13
- package/chunks/{qwenOAuth2-JE7H47TE.js → qwenOAuth2-EEJGROP7.js} +7 -1
- package/chunks/{read-file-CQOF7BQ2.js → read-file-O53WD46Y.js} +4 -5
- package/chunks/{ripGrep-KR5LKGTI.js → ripGrep-OXNZ5Z3T.js} +9 -11
- package/chunks/{ru-A4OHIUNN.js → ru-QILM4HBC.js} +3 -3
- package/chunks/{send-message-GB4AQZNC.js → send-message-ULK4MQXJ.js} +22 -1
- package/chunks/{serve-GAD2PEST.js → serve-H2REZAYD.js} +13728 -3026
- package/chunks/{shell-E2HMCBGR.js → shell-DET66JID.js} +9 -11
- package/chunks/{skill-KDZH6UZ6.js → skill-ZIXPX3L3.js} +19 -6
- package/chunks/{src-LY4RU5AI.js → src-PN3XGQYP.js} +205 -13
- package/chunks/{syntheticOutput-HFL3DE7R.js → syntheticOutput-IS2X5OZ2.js} +2 -2
- package/chunks/{task-stop-ZQF26RXS.js → task-stop-7QSJGSSP.js} +1 -1
- package/chunks/{todoWrite-U4SC643O.js → todoWrite-7CVACFUX.js} +2 -2
- package/chunks/{tool-search-U4XQVLFU.js → tool-search-GTYLSGZ3.js} +4 -5
- package/chunks/{web-fetch-BRWZ4WSE.js → web-fetch-ENQ2I5JA.js} +5 -2
- package/chunks/{write-file-NBLRMNGB.js → write-file-NILNEZCR.js} +19 -12
- package/chunks/{zh-V32QONGV.js → zh-PWL2NKY3.js} +4 -3
- package/chunks/{zh-TW-552S24LR.js → zh-TW-S3YGWICZ.js} +4 -3
- package/cli.js +14832 -49049
- package/locales/ca.js +4 -5
- package/locales/de.js +4 -5
- package/locales/en.js +6 -5
- package/locales/fr.js +4 -5
- package/locales/ja.js +4 -5
- package/locales/pt.js +4 -5
- package/locales/ru.js +4 -5
- package/locales/zh-TW.js +5 -4
- package/locales/zh.js +5 -4
- package/package.json +2 -2
- package/chunks/chunk-3MBY4GKN.js +0 -350
- package/chunks/chunk-5P5XGNYH.js +0 -93
- package/chunks/chunk-JHMX4QTD.js +0 -2306
- package/chunks/chunk-SYCJMSIJ.js +0 -82
- package/chunks/chunk-Y6Z2O3WR.js +0 -33
|
@@ -298,6 +298,8 @@ The first matching rule wins. Rules use the format `"ToolName"` or `"ToolName(sp
|
|
|
298
298
|
| `Read`, `ReadFile` | `read_file` | Meta-category — see below |
|
|
299
299
|
| `Edit`, `EditFile` | `edit` | Meta-category — see below |
|
|
300
300
|
| `Write`, `WriteFile` | `write_file` | |
|
|
301
|
+
| `NotebookEdit` | `notebook_edit` | |
|
|
302
|
+
| `NotebookEditTool` | `notebook_edit` | |
|
|
301
303
|
| `Grep`, `SearchFiles` | `grep_search` | |
|
|
302
304
|
| `Glob`, `FindFiles` | `glob` | |
|
|
303
305
|
| `ListFiles` | `list_directory` | |
|
|
@@ -312,7 +314,7 @@ Some rule names automatically cover multiple tools:
|
|
|
312
314
|
| Rule name | Tools covered |
|
|
313
315
|
| --------- | ---------------------------------------------------- |
|
|
314
316
|
| `Read` | `read_file`, `grep_search`, `glob`, `list_directory` |
|
|
315
|
-
| `Edit` | `edit`, `write_file`
|
|
317
|
+
| `Edit` | `edit`, `write_file`, `notebook_edit` |
|
|
316
318
|
|
|
317
319
|
> [!important]
|
|
318
320
|
> `Read(/path/**)` matches **all four** read tools (file read, grep, glob, and directory listing).
|
|
@@ -603,42 +605,42 @@ For sandbox image selection, precedence is:
|
|
|
603
605
|
|
|
604
606
|
### Command-Line Arguments Table
|
|
605
607
|
|
|
606
|
-
| Argument | Alias | Description | Possible Values | Notes
|
|
607
|
-
| ---------------------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- |
|
|
608
|
-
| `--model` | `-m` | Specifies the Qwen model to use for this session. | Model name | Example: `npm start -- --model qwen3-coder-plus`
|
|
609
|
-
| `--prompt` | `-p` | Used to pass a prompt directly to the command. This invokes Qwen Code in a non-interactive mode. | Your prompt text | For scripting examples, use the `--output-format json` flag to get structured output.
|
|
610
|
-
| `--prompt-interactive` | `-i` | Starts an interactive session with the provided prompt as the initial input. | Your prompt text | The prompt is processed within the interactive session, not before it. Cannot be used when piping input from stdin. Example: `qwen -i "explain this code"`
|
|
611
|
-
| `--system-prompt` | | Overrides the built-in main session system prompt for this run. | Your prompt text | Loaded context files such as `QWEN.md` are still appended after this override. Can be combined with `--append-system-prompt`.
|
|
612
|
-
| `--append-system-prompt` | | Appends extra instructions to the main session system prompt for this run. | Your prompt text | Applied after the built-in prompt and loaded context files. Can be combined with `--system-prompt`. See [Headless Mode](../features/headless) for examples.
|
|
613
|
-
| `--output-format` | `-o` | Specifies the format of the CLI output for non-interactive mode. | `text`, `json`, `stream-json` | `text`: (Default) The standard human-readable output. `json`: A machine-readable JSON output emitted at the end of execution. `stream-json`: Streaming JSON messages emitted as they occur during execution. For structured output and scripting, use the `--output-format json` or `--output-format stream-json` flag. See [Headless Mode](../features/headless) for detailed information.
|
|
614
|
-
| `--input-format` | | Specifies the format consumed from standard input. | `text`, `stream-json` | `text`: (Default) Standard text input from stdin or command-line arguments. `stream-json`: JSON message protocol via stdin for bidirectional communication. Requirement: `--input-format stream-json` requires `--output-format stream-json` to be set. When using `stream-json`, stdin is reserved for protocol messages. See [Headless Mode](../features/headless) for detailed information.
|
|
615
|
-
| `--include-partial-messages` | | Include partial assistant messages when using `stream-json` output format. When enabled, emits stream events (message_start, content_block_delta, etc.) as they occur during streaming. | | Default: `false`. Requirement: Requires `--output-format stream-json` to be set. See [Headless Mode](../features/headless) for detailed information about stream events.
|
|
616
|
-
| `--sandbox` | `-s` | Enables sandbox mode for this session. | |
|
|
617
|
-
| `--sandbox-image` | | Sets the sandbox image URI. | |
|
|
618
|
-
| `--debug` | `-d` | Enables debug mode for this session, providing more verbose output. | |
|
|
619
|
-
| `--all-files` | `-a` | If set, recursively includes all files within the current directory as context for the prompt. | |
|
|
620
|
-
| `--help` | `-h` | Displays help information about command-line arguments. | |
|
|
621
|
-
| `--show-memory-usage` | | Displays the current memory usage. | |
|
|
622
|
-
| `--yolo` | | Enables YOLO mode, which automatically approves all tool calls. | |
|
|
623
|
-
| `--approval-mode` | | Sets the approval mode for tool calls. | `plan`, `default`, `auto-edit`, `yolo` | Supported modes: `plan`: Analyze only—do not modify files or execute commands. `default`: Require approval for file edits or shell commands (default behavior). `auto-edit`: Automatically approve edit tools (edit
|
|
624
|
-
| `--allowed-tools` | | A comma-separated list of tool names that will bypass the confirmation dialog. | Tool names | Example: `qwen --allowed-tools "Shell(git status)"`
|
|
625
|
-
| `--disabled-slash-commands` | | Slash command names to hide/disable (comma-separated or repeated). Unioned with the `slashCommands.disabled` setting and the `QWEN_DISABLED_SLASH_COMMANDS` environment variable. Matched case-insensitively against the final command name. | Command names | Example: `qwen --disabled-slash-commands "auth,mcp,extensions"`
|
|
626
|
-
| `--telemetry` | | Enables [telemetry](/developers/development/telemetry). | |
|
|
627
|
-
| `--telemetry-target` | | Sets the telemetry target. | | See [telemetry](/developers/development/telemetry) for more information.
|
|
628
|
-
| `--telemetry-otlp-endpoint` | | Sets the OTLP endpoint for telemetry. | | See [telemetry](../../developers/development/telemetry) for more information.
|
|
629
|
-
| `--telemetry-otlp-protocol` | | Sets the OTLP protocol for telemetry (`grpc` or `http`). | | Defaults to `grpc`. See [telemetry](../../developers/development/telemetry) for more information.
|
|
630
|
-
| `--telemetry-log-prompts` | | Enables logging of prompts for telemetry. | | See [telemetry](../../developers/development/telemetry) for more information.
|
|
631
|
-
| `--checkpointing` | | Enables [checkpointing](../features/checkpointing). | |
|
|
632
|
-
| `--acp` | | Enables ACP mode (Agent Client Protocol). Useful for IDE/editor integrations like [Zed](../integration-zed). | | Stable. Replaces the deprecated `--experimental-acp` flag.
|
|
633
|
-
| `--experimental-lsp` | | Enables experimental [LSP (Language Server Protocol)](../features/lsp) feature for code intelligence (go-to-definition, find references, diagnostics, etc.). | | Experimental. Requires language servers to be installed.
|
|
634
|
-
| `--extensions` | `-e` | Specifies a list of extensions to use for the session. | Extension names | If not provided, all available extensions are used. Use the special term `qwen -e none` to disable all extensions. Example: `qwen -e my-extension -e my-other-extension`
|
|
635
|
-
| `--list-extensions` | `-l` | Lists all available extensions and exits. | |
|
|
636
|
-
| `--proxy` | | Sets the proxy for the CLI. | Proxy URL | Example: `--proxy http://localhost:7890`.
|
|
637
|
-
| `--include-directories` | | Includes additional directories in the workspace for multi-directory support. | Directory paths | Can be specified multiple times or as comma-separated values. 5 directories can be added at maximum. Example: `--include-directories /path/to/project1,/path/to/project2` or `--include-directories /path/to/project1 --include-directories /path/to/project2`
|
|
638
|
-
| `--screen-reader` | | Enables screen reader mode, which adjusts the TUI for better compatibility with screen readers. | |
|
|
639
|
-
| `--version` | | Displays the version of the CLI. | |
|
|
640
|
-
| `--openai-logging` | | Enables logging of OpenAI API calls for debugging and analysis. | | This flag overrides the `enableOpenAILogging` setting in `settings.json`.
|
|
641
|
-
| `--openai-logging-dir` | | Sets a custom directory path for OpenAI API logs. | Directory path | This flag overrides the `openAILoggingDir` setting in `settings.json`. Supports absolute paths, relative paths, and `~` expansion. Example: `qwen --openai-logging-dir "~/qwen-logs" --openai-logging`
|
|
608
|
+
| Argument | Alias | Description | Possible Values | Notes |
|
|
609
|
+
| ---------------------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
610
|
+
| `--model` | `-m` | Specifies the Qwen model to use for this session. | Model name | Example: `npm start -- --model qwen3-coder-plus` |
|
|
611
|
+
| `--prompt` | `-p` | Used to pass a prompt directly to the command. This invokes Qwen Code in a non-interactive mode. | Your prompt text | For scripting examples, use the `--output-format json` flag to get structured output. |
|
|
612
|
+
| `--prompt-interactive` | `-i` | Starts an interactive session with the provided prompt as the initial input. | Your prompt text | The prompt is processed within the interactive session, not before it. Cannot be used when piping input from stdin. Example: `qwen -i "explain this code"` |
|
|
613
|
+
| `--system-prompt` | | Overrides the built-in main session system prompt for this run. | Your prompt text | Loaded context files such as `QWEN.md` are still appended after this override. Can be combined with `--append-system-prompt`. |
|
|
614
|
+
| `--append-system-prompt` | | Appends extra instructions to the main session system prompt for this run. | Your prompt text | Applied after the built-in prompt and loaded context files. Can be combined with `--system-prompt`. See [Headless Mode](../features/headless) for examples. |
|
|
615
|
+
| `--output-format` | `-o` | Specifies the format of the CLI output for non-interactive mode. | `text`, `json`, `stream-json` | `text`: (Default) The standard human-readable output. `json`: A machine-readable JSON output emitted at the end of execution. `stream-json`: Streaming JSON messages emitted as they occur during execution. For structured output and scripting, use the `--output-format json` or `--output-format stream-json` flag. See [Headless Mode](../features/headless) for detailed information. |
|
|
616
|
+
| `--input-format` | | Specifies the format consumed from standard input. | `text`, `stream-json` | `text`: (Default) Standard text input from stdin or command-line arguments. `stream-json`: JSON message protocol via stdin for bidirectional communication. Requirement: `--input-format stream-json` requires `--output-format stream-json` to be set. When using `stream-json`, stdin is reserved for protocol messages. See [Headless Mode](../features/headless) for detailed information. |
|
|
617
|
+
| `--include-partial-messages` | | Include partial assistant messages when using `stream-json` output format. When enabled, emits stream events (message_start, content_block_delta, etc.) as they occur during streaming. | | Default: `false`. Requirement: Requires `--output-format stream-json` to be set. See [Headless Mode](../features/headless) for detailed information about stream events. |
|
|
618
|
+
| `--sandbox` | `-s` | Enables sandbox mode for this session. | | |
|
|
619
|
+
| `--sandbox-image` | | Sets the sandbox image URI. | | |
|
|
620
|
+
| `--debug` | `-d` | Enables debug mode for this session, providing more verbose output. | | |
|
|
621
|
+
| `--all-files` | `-a` | If set, recursively includes all files within the current directory as context for the prompt. | | |
|
|
622
|
+
| `--help` | `-h` | Displays help information about command-line arguments. | | |
|
|
623
|
+
| `--show-memory-usage` | | Displays the current memory usage. | | |
|
|
624
|
+
| `--yolo` | | Enables YOLO mode, which automatically approves all tool calls. | | |
|
|
625
|
+
| `--approval-mode` | | Sets the approval mode for tool calls. | `plan`, `default`, `auto-edit`, `yolo` | Supported modes: `plan`: Analyze only—do not modify files or execute commands. `default`: Require approval for file edits or shell commands (default behavior). `auto-edit`: Automatically approve edit tools (`edit`, `write_file`, `notebook_edit`) while prompting for others. `yolo`: Automatically approve all tool calls (equivalent to `--yolo`). Cannot be used together with `--yolo`. Use `--approval-mode=yolo` instead of `--yolo` for the new unified approach. Example: `qwen --approval-mode auto-edit`<br>See more about [Approval Mode](../features/approval-mode). |
|
|
626
|
+
| `--allowed-tools` | | A comma-separated list of tool names that will bypass the confirmation dialog. | Tool names | Example: `qwen --allowed-tools "Shell(git status)"` |
|
|
627
|
+
| `--disabled-slash-commands` | | Slash command names to hide/disable (comma-separated or repeated). Unioned with the `slashCommands.disabled` setting and the `QWEN_DISABLED_SLASH_COMMANDS` environment variable. Matched case-insensitively against the final command name. | Command names | Example: `qwen --disabled-slash-commands "auth,mcp,extensions"` |
|
|
628
|
+
| `--telemetry` | | Enables [telemetry](/developers/development/telemetry). | | |
|
|
629
|
+
| `--telemetry-target` | | Sets the telemetry target. | | See [telemetry](/developers/development/telemetry) for more information. |
|
|
630
|
+
| `--telemetry-otlp-endpoint` | | Sets the OTLP endpoint for telemetry. | | See [telemetry](../../developers/development/telemetry) for more information. |
|
|
631
|
+
| `--telemetry-otlp-protocol` | | Sets the OTLP protocol for telemetry (`grpc` or `http`). | | Defaults to `grpc`. See [telemetry](../../developers/development/telemetry) for more information. |
|
|
632
|
+
| `--telemetry-log-prompts` | | Enables logging of prompts for telemetry. | | See [telemetry](../../developers/development/telemetry) for more information. |
|
|
633
|
+
| `--checkpointing` | | Enables [checkpointing](../features/checkpointing). | | |
|
|
634
|
+
| `--acp` | | Enables ACP mode (Agent Client Protocol). Useful for IDE/editor integrations like [Zed](../integration-zed). | | Stable. Replaces the deprecated `--experimental-acp` flag. |
|
|
635
|
+
| `--experimental-lsp` | | Enables experimental [LSP (Language Server Protocol)](../features/lsp) feature for code intelligence (go-to-definition, find references, diagnostics, etc.). | | Experimental. Requires language servers to be installed. |
|
|
636
|
+
| `--extensions` | `-e` | Specifies a list of extensions to use for the session. | Extension names | If not provided, all available extensions are used. Use the special term `qwen -e none` to disable all extensions. Example: `qwen -e my-extension -e my-other-extension` |
|
|
637
|
+
| `--list-extensions` | `-l` | Lists all available extensions and exits. | | |
|
|
638
|
+
| `--proxy` | | Sets the proxy for the CLI. | Proxy URL | Example: `--proxy http://localhost:7890`. |
|
|
639
|
+
| `--include-directories` | | Includes additional directories in the workspace for multi-directory support. | Directory paths | Can be specified multiple times or as comma-separated values. 5 directories can be added at maximum. Example: `--include-directories /path/to/project1,/path/to/project2` or `--include-directories /path/to/project1 --include-directories /path/to/project2` |
|
|
640
|
+
| `--screen-reader` | | Enables screen reader mode, which adjusts the TUI for better compatibility with screen readers. | | |
|
|
641
|
+
| `--version` | | Displays the version of the CLI. | | |
|
|
642
|
+
| `--openai-logging` | | Enables logging of OpenAI API calls for debugging and analysis. | | This flag overrides the `enableOpenAILogging` setting in `settings.json`. |
|
|
643
|
+
| `--openai-logging-dir` | | Sets a custom directory path for OpenAI API logs. | Directory path | This flag overrides the `openAILoggingDir` setting in `settings.json`. Supports absolute paths, relative paths, and `~` expansion. Example: `qwen --openai-logging-dir "~/qwen-logs" --openai-logging` |
|
|
642
644
|
|
|
643
645
|
## Context Files (Hierarchical Instructional Context)
|
|
644
646
|
|
|
@@ -9,11 +9,13 @@ export default {
|
|
|
9
9
|
skills: 'Skills',
|
|
10
10
|
memory: 'Memory',
|
|
11
11
|
headless: 'Headless Mode',
|
|
12
|
+
'structured-output': 'Structured Output',
|
|
12
13
|
'dual-output': 'Dual Output',
|
|
13
14
|
checkpointing: {
|
|
14
15
|
display: 'hidden',
|
|
15
16
|
},
|
|
16
17
|
'approval-mode': 'Approval Mode',
|
|
18
|
+
'auto-mode': 'Auto Mode',
|
|
17
19
|
mcp: 'MCP',
|
|
18
20
|
lsp: 'LSP (Language Server Protocol)',
|
|
19
21
|
'token-caching': 'Token Caching',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Approval Mode
|
|
2
2
|
|
|
3
|
-
Qwen Code offers
|
|
3
|
+
Qwen Code offers five distinct permission modes that allow you to flexibly control how AI interacts with your code and system based on task complexity and risk level.
|
|
4
4
|
|
|
5
5
|
## Permission Modes Comparison
|
|
6
6
|
|
|
@@ -9,6 +9,7 @@ Qwen Code offers four distinct permission modes that allow you to flexibly contr
|
|
|
9
9
|
| **Plan** | ❌ Read-only analysis only | ❌ Not executed | • Code exploration <br>• Planning complex changes <br>• Safe code review | Lowest |
|
|
10
10
|
| **Default** | ✅ Manual approval required | ✅ Manual approval required | • New/unfamiliar codebases <br>• Critical systems <br>• Team collaboration <br>• Learning and teaching | Low |
|
|
11
11
|
| **Auto-Edit** | ✅ Auto-approved | ❌ Manual approval required | • Daily development tasks <br>• Refactoring and code improvements <br>• Safe automation | Medium |
|
|
12
|
+
| **Auto** | ✅ Classifier-evaluated | ✅ Classifier-evaluated | • Long autonomous sessions <br>• When Auto-Edit is too cautious but YOLO is too risky | Medium |
|
|
12
13
|
| **YOLO** | ✅ Auto-approved | ✅ Auto-approved | • Trusted personal projects <br>• Automated scripts/CI/CD <br>• Batch processing tasks | Highest |
|
|
13
14
|
|
|
14
15
|
### Quick Reference Guide
|
|
@@ -16,12 +17,15 @@ Qwen Code offers four distinct permission modes that allow you to flexibly contr
|
|
|
16
17
|
- **Start in Plan Mode**: Great for understanding before making changes
|
|
17
18
|
- **Work in Default Mode**: The balanced choice for most development work
|
|
18
19
|
- **Switch to Auto-Edit**: When you're making lots of safe code changes
|
|
20
|
+
- **Try Auto Mode**: When you want fewer interruptions but still want safety on shell commands and network calls — an LLM classifier evaluates each call
|
|
19
21
|
- **Use YOLO sparingly**: Only for trusted automation in controlled environments
|
|
20
22
|
|
|
21
23
|
> [!tip]
|
|
22
24
|
>
|
|
23
25
|
> You can quickly cycle through modes during a session using **Shift+Tab** (or **Tab** on Windows). The terminal status bar shows your current mode, so you always know what permissions Qwen Code has.
|
|
24
26
|
|
|
27
|
+
> The cycle order is: **plan → default → auto-edit → auto → yolo → plan → ...**
|
|
28
|
+
|
|
25
29
|
## 1. Use Plan Mode for safe code analysis
|
|
26
30
|
|
|
27
31
|
Plan Mode instructs Qwen Code to create a plan by analyzing the codebase with **read-only** operations, perfect for exploring codebases, planning complex changes, or reviewing code safely.
|
|
@@ -159,6 +163,8 @@ You can review each proposed change and approve or reject it individually.
|
|
|
159
163
|
|
|
160
164
|
Auto-Edit Mode instructs Qwen Code to automatically approve file edits while requiring manual approval for shell commands, ideal for accelerating development workflows while maintaining system safety.
|
|
161
165
|
|
|
166
|
+
Auto-approved edit tools include `edit`, `write_file`, and `notebook_edit`.
|
|
167
|
+
|
|
162
168
|
### When to use Auto-Accept Edits Mode
|
|
163
169
|
|
|
164
170
|
- **Daily development**: Ideal for most coding tasks
|
|
@@ -182,7 +188,118 @@ Shift+Tab (or Tab on Windows) # Switch from other modes
|
|
|
182
188
|
3. **Automatically** applies all file changes without confirmation
|
|
183
189
|
4. If tests need to be run, it will **request approval** to execute `npm test`
|
|
184
190
|
|
|
185
|
-
## 4.
|
|
191
|
+
## 4. Auto Mode - Classifier-Driven Approval
|
|
192
|
+
|
|
193
|
+
Auto Mode sits between Auto-Edit and YOLO. An LLM classifier evaluates each
|
|
194
|
+
shell command, network call, and out-of-workspace edit and auto-approves
|
|
195
|
+
the ones it judges safe while blocking risky ones. Most read-only operations
|
|
196
|
+
and in-workspace edits skip the classifier for speed.
|
|
197
|
+
|
|
198
|
+
See [auto-mode.md](./auto-mode.md) for the full reference (hints
|
|
199
|
+
configuration, troubleshooting, FAQ).
|
|
200
|
+
|
|
201
|
+
### When to use Auto Mode
|
|
202
|
+
|
|
203
|
+
- **Long autonomous sessions**: When Default Mode interrupts too often but
|
|
204
|
+
YOLO is too risky.
|
|
205
|
+
- **Trusted projects**: Internal codebases where the agent should keep
|
|
206
|
+
moving but you still want a guardrail on destructive shell commands and
|
|
207
|
+
outbound network calls.
|
|
208
|
+
- **Headless / scheduled runs**: Where Auto-Edit isn't enough (the agent
|
|
209
|
+
needs to run shell commands too) but you want safety on `rm -rf /`,
|
|
210
|
+
`curl ... | sh`, credential exfiltration, etc.
|
|
211
|
+
|
|
212
|
+
### How to use Auto Mode
|
|
213
|
+
|
|
214
|
+
**Turn on Auto Mode during a session**
|
|
215
|
+
|
|
216
|
+
Press **Shift+Tab** (or **Tab** on Windows) to cycle into Auto Mode. The
|
|
217
|
+
status bar shows the active mode.
|
|
218
|
+
|
|
219
|
+
**Use the `/approval-mode` command**
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
/approval-mode auto
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
The first time you enter Auto Mode, an information message explains how it
|
|
226
|
+
works. The notice does not appear again.
|
|
227
|
+
|
|
228
|
+
**Start a new session in Auto Mode**
|
|
229
|
+
|
|
230
|
+
```jsonc
|
|
231
|
+
// .qwen/settings.json
|
|
232
|
+
{
|
|
233
|
+
"tools": {
|
|
234
|
+
"approvalMode": "auto",
|
|
235
|
+
},
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### What Auto Mode auto-approves vs blocks
|
|
240
|
+
|
|
241
|
+
The classifier is biased toward blocking when uncertain. Defaults:
|
|
242
|
+
|
|
243
|
+
- **Auto-approved**: read-only commands (ls, cat, git status, grep, find),
|
|
244
|
+
package install in cwd, build/test commands, file edits inside the
|
|
245
|
+
workspace, local-only operations.
|
|
246
|
+
- **Blocked**: irreversible destruction (rm -rf /, fdisk, mkfs),
|
|
247
|
+
code-from-external execution (curl | sh, eval of remote content),
|
|
248
|
+
credential exfiltration, unauthorized persistence (.bashrc edits,
|
|
249
|
+
crontab), security weakening, force-push to main/master.
|
|
250
|
+
|
|
251
|
+
You can customize the classifier's judgement via natural-language hints in
|
|
252
|
+
settings.json. See [auto-mode.md](./auto-mode.md#configuring-hints).
|
|
253
|
+
|
|
254
|
+
### Safety guardrails
|
|
255
|
+
|
|
256
|
+
- **Hard rules remain in force**: `permissions.deny` rules block actions
|
|
257
|
+
before the classifier ever runs.
|
|
258
|
+
- **Over-broad allow rules are stripped while in Auto Mode**: e.g.
|
|
259
|
+
`permissions.allow: ["Bash"]` (allow every shell command) defeats the
|
|
260
|
+
classifier; entering Auto Mode temporarily disables such rules so the
|
|
261
|
+
classifier can do its job. The rules are restored when you leave Auto
|
|
262
|
+
Mode. Settings on disk are never modified.
|
|
263
|
+
- **Fail-closed**: when the classifier API is unreachable, the action is
|
|
264
|
+
blocked rather than allowed. After two consecutive unavailable calls,
|
|
265
|
+
the next tool call falls back to manual approval.
|
|
266
|
+
- **Loop guard**: after three consecutive policy blocks, the next call
|
|
267
|
+
also falls back to manual approval so the agent isn't stuck cycling on
|
|
268
|
+
a dead-end approach.
|
|
269
|
+
|
|
270
|
+
### Example
|
|
271
|
+
|
|
272
|
+
```
|
|
273
|
+
/approval-mode auto
|
|
274
|
+
Refactor the auth module to use OAuth2. Run the full test suite afterwards.
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Qwen Code makes the file edits (in-workspace edits skip the classifier),
|
|
278
|
+
runs `npm test` (classifier judges safe), and surfaces a block if it ever
|
|
279
|
+
tries something risky like `rm -rf /Users/me/.aws`. You can review the
|
|
280
|
+
reason inline and decide whether to switch to Default Mode for that step.
|
|
281
|
+
|
|
282
|
+
### Configure Auto Mode as default
|
|
283
|
+
|
|
284
|
+
```jsonc
|
|
285
|
+
// .qwen/settings.json
|
|
286
|
+
{
|
|
287
|
+
"tools": {
|
|
288
|
+
"approvalMode": "auto",
|
|
289
|
+
},
|
|
290
|
+
"permissions": {
|
|
291
|
+
"autoMode": {
|
|
292
|
+
"hints": {
|
|
293
|
+
"allow": ["Running pytest, mypy, and ruff on this Python repo"],
|
|
294
|
+
"deny": ["Any network call to intranet.example.com"],
|
|
295
|
+
},
|
|
296
|
+
"environment": ["Open-source monorepo; commits are signed"],
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
}
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
## 5. YOLO Mode - Full Automation
|
|
186
303
|
|
|
187
304
|
YOLO Mode grants Qwen Code the highest permissions, automatically approving all tool calls including file editing and shell commands.
|
|
188
305
|
|