@protolabsai/proto 0.14.0

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.
Files changed (85) hide show
  1. package/LICENSE +203 -0
  2. package/README.md +286 -0
  3. package/dist/bundled/adversarial-verification/SKILL.md +98 -0
  4. package/dist/bundled/brainstorming/SKILL.md +171 -0
  5. package/dist/bundled/coding-agent-standards/SKILL.md +67 -0
  6. package/dist/bundled/dispatching-parallel-agents/SKILL.md +193 -0
  7. package/dist/bundled/executing-plans/SKILL.md +77 -0
  8. package/dist/bundled/finishing-a-development-branch/SKILL.md +213 -0
  9. package/dist/bundled/loop/SKILL.md +61 -0
  10. package/dist/bundled/qc-helper/SKILL.md +151 -0
  11. package/dist/bundled/qc-helper/docs/_meta.ts +30 -0
  12. package/dist/bundled/qc-helper/docs/common-workflow.md +571 -0
  13. package/dist/bundled/qc-helper/docs/configuration/_meta.ts +10 -0
  14. package/dist/bundled/qc-helper/docs/configuration/auth.md +366 -0
  15. package/dist/bundled/qc-helper/docs/configuration/memory.md +0 -0
  16. package/dist/bundled/qc-helper/docs/configuration/model-providers.md +542 -0
  17. package/dist/bundled/qc-helper/docs/configuration/qwen-ignore.md +55 -0
  18. package/dist/bundled/qc-helper/docs/configuration/settings.md +652 -0
  19. package/dist/bundled/qc-helper/docs/configuration/themes.md +160 -0
  20. package/dist/bundled/qc-helper/docs/configuration/trusted-folders.md +61 -0
  21. package/dist/bundled/qc-helper/docs/extension/_meta.ts +9 -0
  22. package/dist/bundled/qc-helper/docs/extension/extension-releasing.md +121 -0
  23. package/dist/bundled/qc-helper/docs/extension/getting-started-extensions.md +299 -0
  24. package/dist/bundled/qc-helper/docs/extension/introduction.md +303 -0
  25. package/dist/bundled/qc-helper/docs/features/_meta.ts +18 -0
  26. package/dist/bundled/qc-helper/docs/features/approval-mode.md +263 -0
  27. package/dist/bundled/qc-helper/docs/features/arena.md +218 -0
  28. package/dist/bundled/qc-helper/docs/features/checkpointing.md +77 -0
  29. package/dist/bundled/qc-helper/docs/features/commands.md +312 -0
  30. package/dist/bundled/qc-helper/docs/features/headless.md +318 -0
  31. package/dist/bundled/qc-helper/docs/features/hooks.md +343 -0
  32. package/dist/bundled/qc-helper/docs/features/language.md +139 -0
  33. package/dist/bundled/qc-helper/docs/features/lsp.md +453 -0
  34. package/dist/bundled/qc-helper/docs/features/mcp.md +281 -0
  35. package/dist/bundled/qc-helper/docs/features/sandbox.md +241 -0
  36. package/dist/bundled/qc-helper/docs/features/scheduled-tasks.md +139 -0
  37. package/dist/bundled/qc-helper/docs/features/skills.md +289 -0
  38. package/dist/bundled/qc-helper/docs/features/sub-agents.md +307 -0
  39. package/dist/bundled/qc-helper/docs/features/token-caching.md +29 -0
  40. package/dist/bundled/qc-helper/docs/ide-integration/_meta.ts +4 -0
  41. package/dist/bundled/qc-helper/docs/ide-integration/ide-companion-spec.md +182 -0
  42. package/dist/bundled/qc-helper/docs/ide-integration/ide-integration.md +144 -0
  43. package/dist/bundled/qc-helper/docs/integration-github-action.md +241 -0
  44. package/dist/bundled/qc-helper/docs/integration-jetbrains.md +81 -0
  45. package/dist/bundled/qc-helper/docs/integration-vscode.md +39 -0
  46. package/dist/bundled/qc-helper/docs/integration-zed.md +72 -0
  47. package/dist/bundled/qc-helper/docs/overview.md +64 -0
  48. package/dist/bundled/qc-helper/docs/quickstart.md +273 -0
  49. package/dist/bundled/qc-helper/docs/reference/_meta.ts +4 -0
  50. package/dist/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +72 -0
  51. package/dist/bundled/qc-helper/docs/reference/sdk-api.md +524 -0
  52. package/dist/bundled/qc-helper/docs/support/Uninstall.md +42 -0
  53. package/dist/bundled/qc-helper/docs/support/_meta.ts +6 -0
  54. package/dist/bundled/qc-helper/docs/support/tos-privacy.md +112 -0
  55. package/dist/bundled/qc-helper/docs/support/troubleshooting.md +123 -0
  56. package/dist/bundled/receiving-code-review/SKILL.md +226 -0
  57. package/dist/bundled/requesting-code-review/SKILL.md +115 -0
  58. package/dist/bundled/review/SKILL.md +123 -0
  59. package/dist/bundled/subagent-driven-development/SKILL.md +292 -0
  60. package/dist/bundled/subagent-driven-development/code-quality-reviewer-prompt.md +27 -0
  61. package/dist/bundled/subagent-driven-development/implementer-prompt.md +113 -0
  62. package/dist/bundled/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  63. package/dist/bundled/systematic-debugging/SKILL.md +305 -0
  64. package/dist/bundled/test-driven-development/SKILL.md +396 -0
  65. package/dist/bundled/using-git-worktrees/SKILL.md +223 -0
  66. package/dist/bundled/using-superpowers/SKILL.md +117 -0
  67. package/dist/bundled/verification-before-completion/SKILL.md +147 -0
  68. package/dist/bundled/writing-plans/SKILL.md +159 -0
  69. package/dist/bundled/writing-skills/SKILL.md +716 -0
  70. package/dist/cli.js +483432 -0
  71. package/dist/sandbox-macos-permissive-closed.sb +32 -0
  72. package/dist/sandbox-macos-permissive-open.sb +27 -0
  73. package/dist/sandbox-macos-permissive-proxied.sb +37 -0
  74. package/dist/sandbox-macos-restrictive-closed.sb +93 -0
  75. package/dist/sandbox-macos-restrictive-open.sb +96 -0
  76. package/dist/sandbox-macos-restrictive-proxied.sb +98 -0
  77. package/dist/vendor/ripgrep/COPYING +3 -0
  78. package/dist/vendor/ripgrep/arm64-darwin/rg +0 -0
  79. package/dist/vendor/ripgrep/arm64-linux/rg +0 -0
  80. package/dist/vendor/ripgrep/x64-darwin/rg +0 -0
  81. package/dist/vendor/ripgrep/x64-linux/rg +0 -0
  82. package/dist/vendor/ripgrep/x64-win32/rg.exe +0 -0
  83. package/dist/vendor/tree-sitter/tree-sitter-bash.wasm +0 -0
  84. package/dist/vendor/tree-sitter/tree-sitter.wasm +0 -0
  85. package/package.json +143 -0
@@ -0,0 +1,303 @@
1
+ # Qwen Code Extensions
2
+
3
+ Qwen Code extensions package prompts, MCP servers, subagents, skills and custom commands into a familiar and user-friendly format. With extensions, you can expand the capabilities of Qwen Code and share those capabilities with others. They are designed to be easily installable and shareable.
4
+
5
+ Extensions and plugins from [Gemini CLI Extensions Gallery](https://geminicli.com/extensions/) and [Claude Code Marketplace](https://claudemarketplaces.com/) can be directly installed into Qwen Code. This cross-platform compatibility gives you access to a rich ecosystem of extensions and plugins, dramatically expanding Qwen Code's capabilities without requiring extension authors to maintain separate versions.
6
+
7
+ ## Extension management
8
+
9
+ We offer a suite of extension management tools using both `qwen extensions` CLI commands and `/extensions` slash commands within the interactive CLI.
10
+
11
+ ### Runtime Extension Management (Slash Commands)
12
+
13
+ You can manage extensions at runtime within the interactive CLI using `/extensions` slash commands. These commands support hot-reloading, meaning changes take effect immediately without restarting the application.
14
+
15
+ | Command | Description |
16
+ | ------------------------------------- | ----------------------------------------------------------------- |
17
+ | `/extensions` or `/extensions manage` | Manage all installed extensions |
18
+ | `/extensions install <source>` | Install an extension from a git URL, local path, or marketplace |
19
+ | `/extensions explore [source]` | Open extensions source page(Gemini or ClaudeCode) in your browser |
20
+
21
+ ### CLI Extension Management
22
+
23
+ You can also manage extensions using `qwen extensions` CLI commands. Note that changes made via CLI commands will be reflected in active CLI sessions on restart.
24
+
25
+ ### Installing an extension
26
+
27
+ You can install an extension using `qwen extensions install` from multiple sources:
28
+
29
+ #### From Claude Code Marketplace
30
+
31
+ Qwen Code also supports plugins from the [Claude Code Marketplace](https://claudemarketplaces.com/). Install from a marketplace and choose a plugin:
32
+
33
+ ```bash
34
+ qwen extensions install <marketplace-name>
35
+ # or
36
+ qwen extensions install <marketplace-github-url>
37
+ ```
38
+
39
+ If you want to install a specific plugin, you can use the format with plugin name:
40
+
41
+ ```bash
42
+ qwen extensions install <marketplace-name>:<plugin-name>
43
+ # or
44
+ qwen extensions install <marketplace-github-url>:<plugin-name>
45
+ ```
46
+
47
+ For example, to install the `prompts.chat` plugin from the [f/awesome-chatgpt-prompts](https://claudemarketplaces.com/plugins/f-awesome-chatgpt-prompts) marketplace:
48
+
49
+ ```bash
50
+ qwen extensions install f/awesome-chatgpt-prompts:prompts.chat
51
+ # or
52
+ qwen extensions install https://github.com/f/awesome-chatgpt-prompts:prompts.chat
53
+ ```
54
+
55
+ Claude plugins are automatically converted to Qwen Code format during installation:
56
+
57
+ - `claude-plugin.json` is converted to `qwen-extension.json`
58
+ - Agent configurations are converted to Qwen subagent format
59
+ - Skill configurations are converted to Qwen skill format
60
+ - Tool mappings are automatically handled
61
+
62
+ You can quickly browse available extensions from different marketplaces using the `/extensions explore` command:
63
+
64
+ ```bash
65
+ # Open Gemini CLI Extensions marketplace
66
+ /extensions explore Gemini
67
+
68
+ # Open Claude Code marketplace
69
+ /extensions explore ClaudeCode
70
+ ```
71
+
72
+ This command opens the respective marketplace in your default browser, allowing you to discover new extensions to enhance your Qwen Code experience.
73
+
74
+ > **Cross-Platform Compatibility**: This allows you to leverage the rich extension ecosystems from both Gemini CLI and Claude Code, dramatically expanding the available functionality for Qwen Code users.
75
+
76
+ #### From Gemini CLI Extensions
77
+
78
+ Qwen Code fully supports extensions from the [Gemini CLI Extensions Gallery](https://geminicli.com/extensions/). Simply install them using the git URL:
79
+
80
+ ```bash
81
+ qwen extensions install <gemini-cli-extension-github-url>
82
+ # or
83
+ qwen extensions install <owner>/<repo>
84
+ ```
85
+
86
+ Gemini extensions are automatically converted to Qwen Code format during installation:
87
+
88
+ - `gemini-extension.json` is converted to `qwen-extension.json`
89
+ - TOML command files are automatically migrated to Markdown format
90
+ - MCP servers, context files, and settings are preserved
91
+
92
+ #### From Git Repository
93
+
94
+ ```bash
95
+ qwen extensions install https://github.com/github/github-mcp-server
96
+ ```
97
+
98
+ This will install the github mcp server extension.
99
+
100
+ #### From Local Path
101
+
102
+ ```bash
103
+ qwen extensions install /path/to/your/extension
104
+ ```
105
+
106
+ Note that we create a copy of the installed extension, so you will need to run `qwen extensions update` to pull in changes from both locally-defined extensions and those on GitHub.
107
+
108
+ ### Uninstalling an extension
109
+
110
+ To uninstall, run `qwen extensions uninstall extension-name`, so, in the case of the install example:
111
+
112
+ ```
113
+ qwen extensions uninstall qwen-cli-security
114
+ ```
115
+
116
+ ### Disabling an extension
117
+
118
+ Extensions are, by default, enabled across all workspaces. You can disable an extension entirely or for specific workspace.
119
+
120
+ For example, `qwen extensions disable extension-name` will disable the extension at the user level, so it will be disabled everywhere. `qwen extensions disable extension-name --scope=workspace` will only disable the extension in the current workspace.
121
+
122
+ ### Enabling an extension
123
+
124
+ You can enable extensions using `qwen extensions enable extension-name`. You can also enable an extension for a specific workspace using `qwen extensions enable extension-name --scope=workspace` from within that workspace.
125
+
126
+ This is useful if you have an extension disabled at the top-level and only enabled in specific places.
127
+
128
+ ### Updating an extension
129
+
130
+ For extensions installed from a local path or a git repository, you can explicitly update to the latest version (as reflected in the `qwen-extension.json` `version` field) with `qwen extensions update extension-name`.
131
+
132
+ You can update all extensions with:
133
+
134
+ ```
135
+ qwen extensions update --all
136
+ ```
137
+
138
+ ## How it works
139
+
140
+ On startup, Qwen Code looks for extensions in `<home>/.qwen/extensions`
141
+
142
+ Extensions exist as a directory that contains a `qwen-extension.json` file. For example:
143
+
144
+ `<home>/.qwen/extensions/my-extension/qwen-extension.json`
145
+
146
+ ### `qwen-extension.json`
147
+
148
+ The `qwen-extension.json` file contains the configuration for the extension. The file has the following structure:
149
+
150
+ ```json
151
+ {
152
+ "name": "my-extension",
153
+ "version": "1.0.0",
154
+ "mcpServers": {
155
+ "my-server": {
156
+ "command": "node my-server.js"
157
+ }
158
+ },
159
+ "contextFileName": "QWEN.md",
160
+ "commands": "commands",
161
+ "skills": "skills",
162
+ "agents": "agents",
163
+ "settings": [
164
+ {
165
+ "name": "API Key",
166
+ "description": "Your API key for the service",
167
+ "envVar": "MY_API_KEY",
168
+ "sensitive": true
169
+ }
170
+ ]
171
+ }
172
+ ```
173
+
174
+ - `name`: The name of the extension. This is used to uniquely identify the extension and for conflict resolution when extension commands have the same name as user or project commands. The name should be lowercase or numbers and use dashes instead of underscores or spaces. This is how users will refer to your extension in the CLI. Note that we expect this name to match the extension directory name.
175
+ - `version`: The version of the extension.
176
+ - `mcpServers`: A map of MCP servers to configure. The key is the name of the server, and the value is the server configuration. These servers will be loaded on startup just like MCP servers configured in a [`settings.json` file](./cli/configuration.md). If both an extension and a `settings.json` file configure an MCP server with the same name, the server defined in the `settings.json` file takes precedence.
177
+ - Note that all MCP server configuration options are supported except for `trust`.
178
+ - `contextFileName`: The name of the file that contains the context for the extension. This will be used to load the context from the extension directory. If this property is not used but a `QWEN.md` file is present in your extension directory, then that file will be loaded.
179
+ - `commands`: The directory containing custom commands (default: `commands`). Commands are `.md` files that define prompts.
180
+ - `skills`: The directory containing custom skills (default: `skills`). Skills are discovered automatically and become available via the `/skills` command.
181
+ - `agents`: The directory containing custom subagents (default: `agents`). Subagents are `.yaml` or `.md` files that define specialized AI assistants.
182
+ - `settings`: An array of settings that the extension requires. When installing, users will be prompted to provide values for these settings. The values are stored securely and passed to MCP servers as environment variables.
183
+ - Each setting has the following properties:
184
+ - `name`: Display name for the setting
185
+ - `description`: A description of what this setting is used for
186
+ - `envVar`: The environment variable name that will be set
187
+ - `sensitive`: Boolean indicating if the value should be hidden (e.g., API keys, passwords)
188
+
189
+ ### Managing Extension Settings
190
+
191
+ Extensions can require configuration through settings (such as API keys or credentials). These settings can be managed using the `qwen extensions settings` CLI command:
192
+
193
+ **Set a setting value:**
194
+
195
+ ```bash
196
+ qwen extensions settings set <extension-name> <setting-name> [--scope user|workspace]
197
+ ```
198
+
199
+ **List all settings for an extension:**
200
+
201
+ ```bash
202
+ qwen extensions settings list <extension-name>
203
+ ```
204
+
205
+ **View current values (user and workspace):**
206
+
207
+ ```bash
208
+ qwen extensions settings show <extension-name> <setting-name>
209
+ ```
210
+
211
+ **Remove a setting value:**
212
+
213
+ ```bash
214
+ qwen extensions settings unset <extension-name> <setting-name> [--scope user|workspace]
215
+ ```
216
+
217
+ Settings can be configured at two levels:
218
+
219
+ - **User level** (default): Settings apply across all projects (`~/.qwen/.env`)
220
+ - **Workspace level**: Settings apply only to the current project (`.qwen/.env`)
221
+
222
+ Workspace settings take precedence over user settings. Sensitive settings are stored securely and never displayed in plain text.
223
+
224
+ When Qwen Code starts, it loads all the extensions and merges their configurations. If there are any conflicts, the workspace configuration takes precedence.
225
+
226
+ ### Custom commands
227
+
228
+ Extensions can provide [custom commands](./cli/commands.md#custom-commands) by placing Markdown files in a `commands/` subdirectory within the extension directory. These commands follow the same format as user and project custom commands and use standard naming conventions.
229
+
230
+ > **Note:** The command format has been updated from TOML to Markdown. TOML files are deprecated but still supported. You can migrate existing TOML commands using the automatic migration prompt that appears when TOML files are detected.
231
+
232
+ **Example**
233
+
234
+ An extension named `gcp` with the following structure:
235
+
236
+ ```
237
+ .qwen/extensions/gcp/
238
+ ├── qwen-extension.json
239
+ └── commands/
240
+ ├── deploy.md
241
+ └── gcs/
242
+ └── sync.md
243
+ ```
244
+
245
+ Would provide these commands:
246
+
247
+ - `/deploy` - Shows as `[gcp] Custom command from deploy.md` in help
248
+ - `/gcs:sync` - Shows as `[gcp] Custom command from sync.md` in help
249
+
250
+ ### Custom skills
251
+
252
+ Extensions can provide custom skills by placing skill files in a `skills/` subdirectory within the extension directory. Each skill should have a `SKILL.md` file with YAML frontmatter defining the skill's name and description.
253
+
254
+ **Example**
255
+
256
+ ```
257
+ .qwen/extensions/my-extension/
258
+ ├── qwen-extension.json
259
+ └── skills/
260
+ └── pdf-processor/
261
+ └── SKILL.md
262
+ ```
263
+
264
+ The skill will be available via the `/skills` command when the extension is active.
265
+
266
+ ### Custom subagents
267
+
268
+ Extensions can provide custom subagents by placing agent configuration files in an `agents/` subdirectory within the extension directory. Agents are defined using YAML or Markdown files.
269
+
270
+ **Example**
271
+
272
+ ```
273
+ .qwen/extensions/my-extension/
274
+ ├── qwen-extension.json
275
+ └── agents/
276
+ └── testing-expert.yaml
277
+ ```
278
+
279
+ Extension subagents appear in the subagent manager dialog under "Extension Agents" section.
280
+
281
+ ### Conflict resolution
282
+
283
+ Extension commands have the lowest precedence. When a conflict occurs with user or project commands:
284
+
285
+ 1. **No conflict**: Extension command uses its natural name (e.g., `/deploy`)
286
+ 2. **With conflict**: Extension command is renamed with the extension prefix (e.g., `/gcp.deploy`)
287
+
288
+ For example, if both a user and the `gcp` extension define a `deploy` command:
289
+
290
+ - `/deploy` - Executes the user's deploy command
291
+ - `/gcp.deploy` - Executes the extension's deploy command (marked with `[gcp]` tag)
292
+
293
+ ## Variables
294
+
295
+ Qwen Code extensions allow variable substitution in `qwen-extension.json`. This can be useful if e.g., you need the current directory to run an MCP server using `"cwd": "${extensionPath}${/}run.ts"`.
296
+
297
+ **Supported variables:**
298
+
299
+ | variable | description |
300
+ | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
301
+ | `${extensionPath}` | The fully-qualified path of the extension in the user's filesystem e.g., '/Users/username/.qwen/extensions/example-extension'. This will not unwrap symlinks. |
302
+ | `${workspacePath}` | The fully-qualified path of the current workspace. |
303
+ | `${/} or ${pathSeparator}` | The path separator (differs per OS). |
@@ -0,0 +1,18 @@
1
+ export default {
2
+ commands: 'Commands',
3
+ 'sub-agents': 'SubAgents',
4
+ arena: 'Agent Arena',
5
+ skills: 'Skills',
6
+ headless: 'Headless Mode',
7
+ checkpointing: {
8
+ display: 'hidden',
9
+ },
10
+ 'approval-mode': 'Approval Mode',
11
+ mcp: 'MCP',
12
+ lsp: 'LSP (Language Server Protocol)',
13
+ 'token-caching': 'Token Caching',
14
+ sandbox: 'Sandboxing',
15
+ language: 'i18n',
16
+ hooks: 'Hooks',
17
+ 'scheduled-tasks': 'Scheduled Tasks',
18
+ };
@@ -0,0 +1,263 @@
1
+ # Approval Mode
2
+
3
+ Qwen Code offers three 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
+
5
+ ## Permission Modes Comparison
6
+
7
+ | Mode | File Editing | Shell Commands | Best For | Risk Level |
8
+ | -------------- | --------------------------- | --------------------------- | ------------------------------------------------------------------------------------------------------ | ---------- |
9
+ | **Plan**​ | ❌ Read-only analysis only | ❌ Not executed | • Code exploration <br>• Planning complex changes <br>• Safe code review | Lowest |
10
+ | **Default**​ | ✅ Manual approval required | ✅ Manual approval required | • New/unfamiliar codebases <br>• Critical systems <br>• Team collaboration <br>• Learning and teaching | Low |
11
+ | **Auto-Edit**​ | ✅ Auto-approved | ❌ Manual approval required | • Daily development tasks <br>• Refactoring and code improvements <br>• Safe automation | Medium |
12
+ | **YOLO**​ | ✅ Auto-approved | ✅ Auto-approved | • Trusted personal projects <br>• Automated scripts/CI/CD <br>• Batch processing tasks | Highest |
13
+
14
+ ### Quick Reference Guide
15
+
16
+ - **Start in Plan Mode**: Great for understanding before making changes
17
+ - **Work in Default Mode**: The balanced choice for most development work
18
+ - **Switch to Auto-Edit**: When you're making lots of safe code changes
19
+ - **Use YOLO sparingly**: Only for trusted automation in controlled environments
20
+
21
+ > [!tip]
22
+ >
23
+ > 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
+
25
+ ## 1. Use Plan Mode for safe code analysis
26
+
27
+ 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.
28
+
29
+ ### When to use Plan Mode
30
+
31
+ - **Multi-step implementation**: When your feature requires making edits to many files
32
+ - **Code exploration**: When you want to research the codebase thoroughly before changing anything
33
+ - **Interactive development**: When you want to iterate on the direction with Qwen Code
34
+
35
+ ### How to use Plan Mode
36
+
37
+ **Turn on Plan Mode during a session**
38
+
39
+ You can switch into Plan Mode during a session using **Shift+Tab** (or **Tab** on Windows) to cycle through permission modes.
40
+
41
+ If you are in Normal Mode, **Shift+Tab** (or **Tab** on Windows) first switches into `auto-edits` Mode, indicated by `⏵⏵ accept edits on` at the bottom of the terminal. A subsequent **Shift+Tab** (or **Tab** on Windows) will switch into Plan Mode, indicated by `⏸ plan mode`.
42
+
43
+ **Start a new session in Plan Mode**
44
+
45
+ To start a new session in Plan Mode, use the `/approval-mode` then select `plan`
46
+
47
+ ```bash
48
+ /approval-mode
49
+ ```
50
+
51
+ **Run "headless" queries in Plan Mode**
52
+
53
+ You can also run a query in Plan Mode directly with `-p` or `prompt`:
54
+
55
+ ```bash
56
+ qwen --prompt "What is machine learning?"
57
+ ```
58
+
59
+ ### Example: Planning a complex refactor
60
+
61
+ ```bash
62
+ /approval-mode plan
63
+ ```
64
+
65
+ ```
66
+ I need to refactor our authentication system to use OAuth2. Create a detailed migration plan.
67
+ ```
68
+
69
+ Qwen Code analyzes the current implementation and create a comprehensive plan. Refine with follow-ups:
70
+
71
+ ```
72
+ What about backward compatibility?
73
+ How should we handle database migration?
74
+ ```
75
+
76
+ ### Configure Plan Mode as default
77
+
78
+ ```json
79
+ // .qwen/settings.json
80
+ {
81
+ "permissions": {
82
+ "defaultMode": "plan"
83
+ }
84
+ }
85
+ ```
86
+
87
+ ## 2. Use Default Mode for Controlled Interaction
88
+
89
+ Default Mode is the standard way to work with Qwen Code. In this mode, you maintain full control over all potentially risky operations - Qwen Code will ask for your approval before making any file changes or executing shell commands.
90
+
91
+ ### When to use Default Mode
92
+
93
+ - **New to a codebase**: When you're exploring an unfamiliar project and want to be extra cautious
94
+ - **Critical systems**: When working on production code, infrastructure, or sensitive data
95
+ - **Learning and teaching**: When you want to understand each step Qwen Code is taking
96
+ - **Team collaboration**: When multiple people are working on the same codebase
97
+ - **Complex operations**: When the changes involve multiple files or complex logic
98
+
99
+ ### How to use Default Mode
100
+
101
+ **Turn on Default Mode during a session**
102
+
103
+ You can switch into Default Mode during a session using **Shift+Tab**​ (or **Tab** on Windows) to cycle through permission modes. If you're in any other mode, pressing **Shift+Tab** (or **Tab** on Windows) will eventually cycle back to Default Mode, indicated by the absence of any mode indicator at the bottom of the terminal.
104
+
105
+ **Start a new session in Default Mode**
106
+
107
+ Default Mode is the initial mode when you start Qwen Code. If you've changed modes and want to return to Default Mode, use:
108
+
109
+ ```
110
+ /approval-mode default
111
+ ```
112
+
113
+ **Run "headless" queries in Default Mode**
114
+
115
+ When running headless commands, Default Mode is the default behavior. You can explicitly specify it with:
116
+
117
+ ```
118
+ qwen --prompt "Analyze this code for potential bugs"
119
+ ```
120
+
121
+ ### Example: Safely implementing a feature
122
+
123
+ ```
124
+ /approval-mode default
125
+ ```
126
+
127
+ ```
128
+ I need to add user profile pictures to our application. The pictures should be stored in an S3 bucket and the URLs saved in the database.
129
+ ```
130
+
131
+ Qwen Code will analyze your codebase and propose a plan. It will then ask for approval before:
132
+
133
+ 1. Creating new files (controllers, models, migrations)
134
+ 2. Modifying existing files (adding new columns, updating APIs)
135
+ 3. Running any shell commands (database migrations, dependency installation)
136
+
137
+ You can review each proposed change and approve or reject it individually.
138
+
139
+ ### Configure Default Mode as default
140
+
141
+ ```bash
142
+ // .qwen/settings.json
143
+ {
144
+ "permissions": {
145
+ "defaultMode": "default"
146
+ }
147
+ }
148
+ ```
149
+
150
+ ## 3. Auto Edits Mode
151
+
152
+ 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.
153
+
154
+ ### When to use Auto-Accept Edits Mode
155
+
156
+ - **Daily development**: Ideal for most coding tasks
157
+ - **Safe automation**: Allows AI to modify code while preventing accidental execution of dangerous commands
158
+ - **Team collaboration**: Use in shared projects to avoid unintended impacts on others
159
+
160
+ ### How to switch to this mode
161
+
162
+ ```
163
+ # Switch via command
164
+ /approval-mode auto-edit
165
+
166
+ # Or use keyboard shortcut
167
+ Shift+Tab (or Tab on Windows) # Switch from other modes
168
+ ```
169
+
170
+ ### Workflow Example
171
+
172
+ 1. You ask Qwen Code to refactor a function
173
+ 2. AI analyzes the code and proposes changes
174
+ 3. **Automatically**​ applies all file changes without confirmation
175
+ 4. If tests need to be run, it will **request approval**​ to execute `npm test`
176
+
177
+ ## 4. YOLO Mode - Full Automation
178
+
179
+ YOLO Mode grants Qwen Code the highest permissions, automatically approving all tool calls including file editing and shell commands.
180
+
181
+ ### When to use YOLO Mode
182
+
183
+ - **Automated scripts**: Running predefined automated tasks
184
+ - **CI/CD pipelines**: Automated execution in controlled environments
185
+ - **Personal projects**: Rapid iteration in fully trusted environments
186
+ - **Batch processing**: Tasks requiring multi-step command chains
187
+
188
+ > [!warning]
189
+ >
190
+ > **Use YOLO Mode with caution**: AI can execute any command with your terminal permissions. Ensure:
191
+ >
192
+ > 1. You trust the current codebase
193
+ > 2. You understand all actions AI will perform
194
+ > 3. Important files are backed up or committed to version control
195
+
196
+ ### How to enable YOLO Mode
197
+
198
+ ```
199
+ # Temporarily enable (current session only)
200
+ /approval-mode yolo
201
+
202
+ # Set as project default
203
+ /approval-mode yolo --project
204
+
205
+ # Set as user global default
206
+ /approval-mode yolo --user
207
+ ```
208
+
209
+ ### Configuration Example
210
+
211
+ ```bash
212
+ // .qwen/settings.json
213
+ {
214
+ "permissions": {
215
+ "defaultMode": "yolo",
216
+ "confirmShellCommands": false,
217
+ "confirmFileEdits": false
218
+ }
219
+ }
220
+ ```
221
+
222
+ ### Automated Workflow Example
223
+
224
+ ```bash
225
+ # Fully automated refactoring task
226
+ qwen --prompt "Run the test suite, fix all failing tests, then commit changes"
227
+
228
+ # Without human intervention, AI will:
229
+ # 1. Run test commands (auto-approved)
230
+ # 2. Fix failed test cases (auto-edit files)
231
+ # 3. Execute git commit (auto-approved)
232
+ ```
233
+
234
+ ## Mode Switching & Configuration
235
+
236
+ ### Keyboard Shortcut Switching
237
+
238
+ During a Qwen Code session, use **Shift+Tab**​ (or **Tab** on Windows) to quickly cycle through the three modes:
239
+
240
+ ```
241
+ Default Mode → Auto-Edit Mode → YOLO Mode → Plan Mode → Default Mode
242
+ ```
243
+
244
+ ### Persistent Configuration
245
+
246
+ ```
247
+ // Project-level: ./.qwen/settings.json
248
+ // User-level: ~/.qwen/settings.json
249
+ {
250
+ "permissions": {
251
+ "defaultMode": "auto-edit", // or "plan" or "yolo"
252
+ "confirmShellCommands": true,
253
+ "confirmFileEdits": true
254
+ }
255
+ }
256
+ ```
257
+
258
+ ### Mode Usage Recommendations
259
+
260
+ 1. **New to codebase**: Start with **Plan Mode**​ for safe exploration
261
+ 2. **Daily development tasks**: Use **Auto-Accept Edits**​ (default mode), efficient and safe
262
+ 3. **Automated scripts**: Use **YOLO Mode**​ in controlled environments for full automation
263
+ 4. **Complex refactoring**: Use **Plan Mode**​ first for detailed planning, then switch to appropriate mode for execution