Qwen Code is an open-source AI coding agent that can inspect repositories, edit files, run shell commands, and connect to external tools through MCP.
This cheat sheet is a lookup reference for its CLI syntax, slash commands, keyboard shortcuts, configuration files, headless flags, permissions, and sandbox controls.
You can also run qwen --help for the CLI commands and flags in your installed build and /help inside Qwen Code for the slash commands available in that session.
Last updated: September 25, 2026.
Qwen Code Commands Cheat Sheet
Quick Reference
| Command | Purpose |
|---|---|
npm install -g @qwen-code/qwen-code@latest | Install or update with npm. Requires Node.js 22+. |
brew install qwen-code | Install with Homebrew. |
qwen --version | Print the installed version. |
qwen update / /update | Check for and install an update. |
qwen | Start an interactive session. |
qwen "prompt" | Run a one-shot positional prompt. |
qwen -i "prompt" | Run an opening prompt and continue interactively. |
qwen -p "prompt" | Run a headless prompt. |
qwen --continue | Resume the latest saved session for the current project. |
qwen --resume <id> | Resume a specific saved session. |
/auth | Configure authentication. Aliases: /connect, /login. |
/model | Select the active model. /model <model-id> switches directly. |
/clear | Clear conversation history. Aliases: /reset, /new. |
/compress | Compress older conversation history. Alias: /summarize. |
/context | Show context use. /context detail shows individual items. |
/diff | Review current and per-turn file changes. |
/plan | Enter Plan Mode. /plan exit leaves it. |
/approval-mode | Set plan, default, auto-edit, auto, or yolo. |
/permissions | Inspect and edit permission rules. |
/settings | Open the settings editor. |
/config <key> | Read a scalar setting. /config <key>=<value> saves it. |
/mcp | Inspect MCP servers and tools loaded in the session. |
/skills | Browse and run Agent Skills. |
/memory | Inspect QWEN.md and managed memory. |
/tasks | Show background agents, shells, monitors, workflows, and memory jobs. |
/doctor | Diagnose installation, authentication, environment, CPU, or memory problems. |
/help | Show registered slash commands. Alias: /?. |
/quit | Exit Qwen Code. Alias: /exit. |
Input Syntax
| Syntax | Purpose |
|---|---|
/command | Run an interactive Qwen Code command. |
@path | Add a file or directory to prompt context. |
!command | Run one shell command. |
! | Enter or leave shell mode. |
? | Show keyboard shortcuts when the prompt is empty. |
?btw <question> | Ask a side question outside the main conversation history. |
Slash Commands
| Command | Description |
|---|---|
/advisor [focus] | Run a read-only second opinion on the visible conversation. Blocks input until the review returns. |
/agents | Manage named subagents. Common actions: /agents manage, /agents create. |
/approval-mode [mode] | View or change tool-approval behavior. Modes: plan, default, auto-edit, auto, yolo. |
/arena | Manage Arena sessions. |
/auth | Change provider or authentication method. Aliases: /connect, /login. |
/branch | Fork the current conversation into a new session. |
/btw <question> | Ask a side question outside the main conversation history. Alternative syntax: ?btw <question>. |
/bug <description> | Open the configured bug-report flow. Review attached diagnostics before sharing. |
/cd <path> | Change the active working directory. |
/clear | Clear conversation history and release context. Aliases: /reset, /new. |
/compress | Replace older chat history with a compact summary. Alias: /summarize. |
/compress-fast | Remove old tool output and thinking content without a model call. Faster and less semantic than /compress. |
/config | List or change scalar settings by dot-path key. /config <key>. /config <key>=<value>. |
/context | Show context-window usage. /context detail shows individual context items. |
/coordinate <task> | Coordinate read-only workers and an optional worktree writer. Bundled Skill. |
/copy [selector] | Copy a recent reply or selected content. Can select code, LaTeX, or Mermaid content. |
/curator | Inspect and maintain inactive project auto-Skills. |
/delete | Delete a saved conversation. Use carefully. This is not /clear. |
/diff | Open the interactive working-change and per-turn diff viewer. Headless mode prints a text summary. |
/directory | Manage additional workspace directories. Alias: /dir. |
/docs | Open the official Qwen Code documentation. |
/doctor | Diagnose installation and environment problems. /doctor memory, /doctor cpu-profile, /doctor rollback add diagnostics. |
/dream | Run automatic-memory consolidation immediately. Appears only when managed auto-memory is available. |
/editor | Select the external editor. |
/effort <level> | Set reasoning effort. low, medium, high, xhigh, max. Provider support varies. |
/export <format> | Export the session. html, md, json, jsonl. |
/extensions | Manage installed extensions. Common actions: list, manage, explore, install. |
/forget <query> | Remove matching automatic-memory entries. Appears only when managed auto-memory is available. |
/fork <directive> | Start a background child agent with the full conversation context. Different from /branch. |
/goal <objective> | Keep working toward a verifier-checked objective. edit, pause, resume, clear manage the active goal. |
/goal-draft <idea> | Turn an imprecise task into a verifiable goal. |
/help | Show commands available in the current installation. Alias: /?. This is the live source of truth. |
/history <mode> | Control history display after resume. Supports collapse/expand behavior. |
/hooks | Inspect and manage hooks. Extensions can ship hooks. |
/ide <action> | Manage IDE integration. status, install, enable, disable. |
/import-config <source> | Import supported MCP definitions from Claude configurations. Sources: all, claude-code, claude-desktop. Supports --scope. |
/init | Analyze the project and create or improve QWEN.md. Keeps an existing file and proposes additions. |
/insight | Generate programming insights from chat history. Uses recorded conversation activity. |
/language | View or change UI/output language. /language ui <code>. /language output <language>. |
/learn <source> [focus] | Create a reusable project Skill from supplied material. Accepts file, directory, URL, video, or text sources. |
/log | Open the workspace commit-history viewer. Web Shell only. |
/loop <interval> <prompt> | Repeat a prompt at the requested interval. Runs while the session remains active. |
/lsp | Show Language Server Protocol status. Requires --experimental-lsp. |
/mcp | List configured MCP servers and tools. desc, nodesc, schema change detail level. |
/memory | Open instruction-file and automatic-memory controls. Works with QWEN.md and managed memory. |
/model | Open the model picker or switch the current model. Supports --fast, --voice, --vision, --compaction, --image. |
/output-style | Select a built-in or custom response style. default removes the override. |
/peers | Review peer messages and trusted controllers. Cross-session control feature. |
/permissions | Inspect and edit tool permission rules. Permission rules do not enable sandboxing. |
/plan [task] | Enter Plan Mode, supply a task, or exit Plan Mode. Use /plan exit to leave. |
/qc-helper <question> | Ask the bundled Qwen Code help Skill. |
/quit | Exit Qwen Code immediately. Alias: /exit. |
/recap | Generate a one-line recap of the current session. Does not change history or project files. |
/reload-plugins | Reload commands, Skills, agents, workflows, hooks, MCP, and LSP definitions. Useful after extension/config changes. |
/remember <text> | Save a durable managed-memory entry. |
/rename <name> | Name or tag the current session. Alias: /tag. |
/restore [ID] | List checkpoints or restore project files to a checkpoint. Changes files, not conversation position. |
/resume | Open a previous conversation. Alias: /continue. |
/review [target] | Run bundled multi-agent code review. Supports PR number, --comment, and --effort. |
/rewind | Return the conversation to an earlier turn. Alias: /rollback. Different from /restore. |
/settings | Open the settings editor. Use /config for direct scalar changes. |
/setup-github | Create the Qwen Code GitHub Actions setup. |
/simplify [focus] | Review recent changes and apply safe cleanup edits. |
/skills | Browse, search, toggle, and run Agent Skills. Enabled Skills can be invoked as /<skill-name>. |
/stats | Open usage statistics. Alias: /usage. Supports model, tools, skills, daily, monthly, export. |
/status | Show version and session information. Alias: /about. /status paths shows local paths. |
/statusline [request] | Select or generate a status-line configuration. Request form asks the agent to build one. |
/summary [path] | Write a project summary file. Default: .qwen/PROJECT_SUMMARY.md. Does not compress chat. |
/tasks | List background agents, shells, monitors, workflows, and memory jobs. Controls depend on task type. |
/terminal-setup | Configure terminal keybindings for multiline input. Terminal-specific. |
/tools [desc] | List tools currently available to the model. desc includes descriptions. |
/trust | Manage folder-trust settings. Appears when security.folderTrust.enabled is active. |
/update | Run the Qwen Code update flow. Shell equivalent: qwen update. |
/vim | Toggle Vim input mode. Affects prompt editing. |
/voice [mode] | Control voice dictation. Supports hold, tap, off, status. |
/workflows [runId] | Inspect or pause/resume workflow runs. Requires workflows to be enabled at user/system scope. |
CLI Commands and Flags
CLI Commands
| Command | Description |
|---|---|
qwen | Start the interactive CLI. Uses the current working directory as the project workspace. |
qwen [query] | Run a positional one-shot prompt. Exits after the result. |
qwen -i "prompt" | Run an initial prompt and continue interactively. Keeps the TUI open after the first response. |
qwen -p "prompt" | Run a headless task. Accepts piped standard input. |
qwen auth | Removed legacy command. Use /auth inside an interactive session. |
qwen sessions list | List saved sessions. --Json emits JSON Lines. --Limit N changes the result count. |
qwen sessions ps | List running interactive sessions. Add --json for scripts. |
qwen sessions controllers | Manage trusted controller tokens. Advanced cross-session control. |
qwen mcp <command> | Manage persistent MCP server definitions. Common commands: add, remove, list, reconnect, approve, reject. |
qwen extensions <command> | Install and manage extensions. Install, uninstall, list, update, enable, disable, link, new. |
qwen sandbox [cmd...] | Inspect the sandbox backend or run a command inside it. Useful for sandbox diagnostics. |
qwen review <command> | Run non-interactive review helpers. |
qwen board <command> | Work with the agent board. |
qwen channel <command> | Manage configured messaging channels. Channel integrations only. |
qwen hooks | Open hook management in the interactive interface. |
qwen serve | Start the experimental local HTTP daemon and Web Shell. |
qwen update | Check for and install an update. Installation-aware. |
qwen --version | Print the installed version. Useful for version-specific troubleshooting. |
Global Flags
| Flag | Description |
|---|---|
--acp | Start Agent Client Protocol mode. Integration use. |
--allowed-mcp-server-names <names> | Restrict which MCP servers can load. Session-level MCP gate. |
--allowed-tools <rules> | Pre-approve matching tool rules. Approval control, not a registry allowlist. |
--append-system-prompt <text> | Append instructions to the system prompt. Keeps the default prompt. |
--approval-mode <mode> | Set approval behavior. plan, default, auto-edit, auto, yolo. |
--bare | Skip implicit startup discovery. Uses only explicit CLI inputs. |
--channel <name> | Identify the host channel. Examples: VSCode, ACP, SDK, CI, desktop, daemon. |
--chat-recording | Enable or disable saved conversation history. Resume depends on recorded sessions. |
--continue, -c | Resume the newest session for the current project. Requires chat recording. |
--core-tools <tools> | Restrict registered core tools with the legacy allowlist. Legacy behavior. Migrate new configs away from tools.core. |
--debug, -d | Enable debug logging. Review logs for secrets before sharing. |
--disabled-slash-commands <names> | Hide and block specified slash commands. Repeat or pass comma-separated names. |
--exclude-tools <rules> | Deny matching tools or tool patterns. Higher-priority restriction. |
--experimental-lsp | Enable LSP support and /lsp. Experimental. |
--extensions, -e <names> | Load only selected extensions. -E none disables all extensions. |
--fallback-model <id> | Add fallback models for capacity errors. Repeat or use a comma-separated list. Up to three. |
--fork-session | Fork the session selected by --continue or --resume. Creates a new session ID and history. |
--include-directories <paths> | Add directories to the workspace. Repeat or pass comma-separated paths. |
--include-partial-messages | Include partial assistant messages. Use with stream-json. |
--input-file <path> | Watch a JSONL file for remote input commands. Advanced integration. |
--input-format <format> | Select text or stream-json input. Stream-json supports programmatic multi-message input. |
--insecure | Disable TLS certificate verification. Controlled lab environments only. |
--json-fd <N> | Write structured events to a parent-supplied file descriptor. Advanced integration. |
--json-file <path> | Write structured events to a file/FIFO while TUI output stays on stdout. Advanced automation. |
--json-schema <JSON or @path> | Require the final result to match a JSON Schema. Registers the structured_output terminal tool. |
--list-extensions, -l | List available extensions and exit. No session starts. |
--max-session-turns <N> | Limit session turns. Default: unlimited. |
--max-subagent-depth <N> | Limit nested subagent depth. Default: 5. |
--max-tool-calls <N> | Limit cumulative tool calls. Default: unlimited. |
--max-wall-time <duration> | Limit total run time. Examples: 30s, 5m, 1.5h. Default unlimited. |
--mcp-config <JSON or path> | Load MCP definitions from inline JSON or a file. One-run MCP configuration. |
--model, -m <id> | Select the main model for this invocation. One-run override. |
--output-format, -o <format> | Select text, json, or stream-json output. Headless/automation use. |
--output-style <name> | Select a response style. Built-in/custom style or default. |
--prompt, -p <text> | Run a headless prompt. Can be combined with piped input. |
--prompt-interactive, -i <text> | Run an opening prompt and keep the TUI open. Interactive after the first response. |
--proxy <URL> | Set a proxy for this run. Example: http://localhost:7890. |
--resume, -r [id] | Resume a session or open the picker. Requires chat recording. |
--safe-mode | Disable project customizations for troubleshooting. Disables context files, hooks, extensions, Skills, MCP, agents, memory, and settings-sourced overrides. |
--sandbox, -s | Enable the configured sandbox provider. Sandbox and approvals are separate controls. |
--sandbox-image <image> | Select the container image for this run. Overrides environment/settings image selection. |
--screen-reader | Enable screen-reader behavior. Accessibility option. |
--session-id <UUID> | Assign a specific session ID. Automation/integration use. |
--system-prompt <text> | Replace the main system prompt for this run. One-run override. |
--telemetry | Enable or disable telemetry for this run. Advanced. |
--telemetry-log-prompts | Control prompt inclusion in telemetry. Review privacy implications first. |
--telemetry-otlp-endpoint <URL> | Set the OTLP endpoint. Advanced. |
--telemetry-otlp-protocol <grpc/http> | Select the OTLP transport. |
--telemetry-outfile <path> | Write telemetry to a file. Advanced. |
--telemetry-target <local/gcp> | Select the telemetry target. |
--worktree [slug or PR] | Start in an isolated Git worktree. Accepts a name, PR reference/URL, or no value. |
--yolo, -y | Auto-approve every tool call. Does not enable sandboxing. |
Headless Examples
| Task | Example |
|---|---|
| One-shot | qwen -p "review the current branch for correctness" |
| Piped input | git diff --cached | qwen -p "write a concise commit message" |
| JSON output | qwen -p "summarize the API routes" --output-format json |
| Stream JSON | qwen -p "inspect src for unsafe SQL" --output-format stream-json --include-partial-messages |
| JSON Schema | qwen -p "classify the failures" --json-schema @schemas/test-report.json --output-format json |
| Read-only audit | qwen -p "review the repository" --approval-mode plan --output-format json |
Bounded CI Run
qwen -p "run tests, fix failures, and report changed files" \
--approval-mode auto-edit \
--sandbox \
--max-session-turns 30 \
--max-tool-calls 60 \
--max-wall-time 10m \
--output-format jsonKeyboard Shortcuts
| Shortcut | Action |
|---|---|
/ | Open slash-command completion. Session input. |
@ | Open file/directory/context completion. Session input. |
! | Enter or leave shell mode when input is empty. !Command runs one command. |
? | Show keyboard shortcuts. Empty prompt only. |
Enter | Submit input. During a response, can steer the active turn. |
Ctrl+Enter / Cmd+Enter / Shift+Enter / Ctrl+J | Insert a newline. Terminal handling varies. |
Esc | Close a dialog/completion or cancel an active request with empty input. Press twice while idle to open rewind outside IDE mode. |
Ctrl+C | Cancel the request and clear input. Press twice to exit. |
Ctrl+D | Exit when input is empty. Press twice to confirm. |
Ctrl+L | Clear the visible terminal. Does not clear conversation context. |
Ctrl+O / Alt+T | Expand or collapse thinking/tool details. MacOS uses Option for Alt. |
Ctrl+S | Stash non-empty project input for the next launch. With empty input, disables output truncation for a long response. |
Ctrl+T | Show or hide tool descriptions. Display control. |
Alt+M | Toggle Markdown rendered/source view. Option+M on macOS. |
Shift+Tab | Cycle approval modes. Windows uses Tab. |
Ctrl+G | Inspect context received from an IDE connection. IDE integration only. |
Ctrl+Q | Queue the current input for the next turn. Useful during an active response. |
Tab | Accept the current suggestion. Windows also uses it to cycle approval modes. |
Up / Down | Navigate lines, history, or suggestions. Behavior follows current focus. |
Ctrl+R | Search prompt or shell history. Context-sensitive. |
Ctrl+Y | Retry the latest failed request. Request retry. |
Ctrl+X | Edit the prompt in the configured external editor. Requires an editor configuration. |
Ctrl+Z | Undo the latest input edit. Composer edit history. |
Ctrl+Shift+Z | Redo the latest undone edit. Composer edit history. |
Ctrl+A / Home | Move to the start of the line. Prompt editing. |
Ctrl+E / End | Move to the end of the line. Prompt editing. |
Ctrl+K | Delete from the cursor to the end. Prompt editing. |
Ctrl+U | Delete from the cursor to the start. Prompt editing. |
Ctrl+W / Ctrl+Backspace | Delete the word to the left. Prompt editing. |
Ctrl+V | Paste text or attach a clipboard image. Uses the platform equivalent where required. |
Ctrl+F | Move focus between a foreground shell and the prompt. Foreground shell only. |
Ctrl+B | Promote a foreground shell to a background task. Foreground shell only. |
Ctrl+Shift+Up / Ctrl+Shift+Down | Scroll the focused foreground shell. Foreground shell only. |
Shift+Up / Shift+Down | Scroll conversation history one line. Virtualized history. |
PgUp / PgDn | Scroll conversation history one page. Virtualized history. |
Ctrl+Home / Ctrl+End | Jump to the top or bottom of conversation history. Virtualized history. |
Configuration
Settings Files and Precedence
| File / Source | Purpose |
|---|---|
| Built-in defaults | Qwen Code defaults. Lowest precedence. |
/etc/qwen-code/system-defaults.json | Linux system defaults. Can be overridden by later layers. |
C:\ProgramData\qwen-code\system-defaults.json | Windows system defaults. System-wide. |
/Library/Application Support/QwenCode/system-defaults.json | macOS system defaults. System-wide. |
~/.qwen/settings.json | Personal defaults across projects. Main user settings file. |
<project>/.qwen/settings.json | Repository-specific settings. Project scope. |
/etc/qwen-code/settings.json | Linux enforced system settings. Higher precedence than user/project settings. |
C:\ProgramData\qwen-code\settings.json | Windows enforced system settings. Higher precedence than user/project settings. |
/Library/Application Support/QwenCode/settings.json | macOS enforced system settings. Higher precedence than user/project settings. |
| Environment variables | Runtime/provider values. Override settings files. |
| CLI flags | One-run overrides. Highest normal precedence. |
Settings and Environment Variables
Settings
| Setting | Purpose |
|---|---|
general.chatRecording | Saved conversation history. Required for resume/continue. |
general.enableAutoUpdate | Startup update behavior. Installation-dependent. |
general.language | UI language. Locale/code. |
general.outputLanguage | Model output language. Language name. |
general.outputStyle | Persistent response style. Built-in or custom style. |
general.preferredEditor | External editor. Used by /editor and prompt editing. |
general.vimMode | Vim input mode. Boolean. |
ide.enabled | IDE integration. Boolean. |
memory.enableManagedAutoMemory | Automatic memory extraction. Default: true. |
model.fallbackModels | Capacity-error fallbacks. Used for retryable provider failures. |
model.maxSessionTurns | Session-turn budget. -1 Means unlimited. |
model.maxSubagentDepth | Nested subagent depth. Default: 5. |
model.maxToolCalls | Cumulative tool-call budget. -1 Means unlimited. |
model.maxWallTimeSeconds | Run wall-time budget. -1 Means unlimited. |
model.name | Default main model. Uses the active provider configuration. |
model.reasoningEffort | Default reasoning effort. Unsupported values are provider-dependent. |
output.format | Persistent output format. text, json, stream-json. |
permissions.allow | Tool rules that skip approval. Auto-approval only. |
permissions.ask | Tool rules that always require confirmation. Explicit review gate. |
permissions.deny | Tool rules that are blocked. Stronger restriction than allow/ask. |
privacy.usageStatisticsEnabled | Usage-statistics collection. Privacy preference. |
security.folderTrust.enabled | Folder-trust controls. Enables /trust. |
slashCommands.disabled | Slash commands to hide/block. Merged with startup deny configuration. |
tools.approvalMode | Default approval mode. plan, default, auto-edit, auto, yolo. |
tools.core | Legacy core-tool allowlist. Deprecated. Do not use for new configurations. |
tools.disabled | Tools removed from the registry entirely. Hidden from /tools and unavailable to the model. |
tools.eager | Built-in tool schemas loaded eagerly at startup. Unlisted eligible tools can remain discoverable on demand. |
tools.sandbox | Sandbox enablement/provider setting. Environment variables and CLI flags can override it. |
tools.sandboxImage | Sandbox container image. Container sandboxes. |
tools.workflowsEnabled | Workflow support. User/system scope activates /workflows. |
Environment Variables
| Variable | Purpose |
|---|---|
ANTHROPIC_API_KEY | Anthropic provider authentication. Provider-dependent. |
DASHSCOPE_API_KEY | DashScope/ModelStudio authentication. Use with a matching provider entry. |
GEMINI_API_KEY | Gemini provider authentication. Provider-dependent. |
NO_COLOR | Disable terminal colors. Standard CLI convention. |
OPENAI_API_KEY | OpenAI-compatible provider authentication. Provider-dependent. |
OPENAI_BASE_URL | OpenAI-compatible endpoint override. Provider-dependent. |
OPENAI_MODEL | OpenAI-compatible model selection. Provider-dependent. |
QWEN_CODE_ENABLE_WORKFLOWS | Enable workflow support. User/system setting alternative. |
QWEN_CODE_MAX_OUTPUT_TOKENS | Fixed output-token cap. Runtime limit. |
QWEN_CODE_SAFE_MODE | Start with customizations disabled. Troubleshooting. |
QWEN_CODE_UNATTENDED_RETRY | Retry HTTP 429/529 errors in unattended runs. Pair with --max-wall-time. |
QWEN_DISABLE_HYPERLINKS | Disable OSC 8 terminal links. Useful in incompatible terminals/logs. |
QWEN_DISABLED_SLASH_COMMANDS | Additional slash-command denylist. Session startup. |
QWEN_SANDBOX | Sandbox enablement/provider selection. Can select Docker, Podman, or macOS Seatbelt. |
QWEN_SANDBOX_IMAGE | Sandbox image. Lower precedence than --sandbox-image. |
QWEN_TLS_INSECURE | Disable API TLS verification. Controlled lab environments only. |
QWEN.md, Memory, and Custom Commands
| Path / Command | Purpose |
|---|---|
~/.qwen/QWEN.md | Personal instructions across projects. Loads as persistent context. |
<project>/QWEN.md | Shared repository instructions. Suitable for version control. |
<project>/.qwen/QWEN.local.md | Personal instructions for one project. Add it to .gitignore yourself. |
<project>/AGENTS.md | Existing agent instructions. Qwen Code can read it as context. Do not duplicate it into QWEN.md unnecessarily. |
~/.qwen/projects/<project>/memory/ | Managed automatic-memory storage. Separate from QWEN.md. |
~/.qwen/commands/<name>.md | Create a user-level custom slash command. |
<project>/.qwen/commands/<name>.md | Create a project-level custom slash command. |
<project>/.qwen/commands/git/commit.md | Registers the namespaced command /git:commit. |
Custom Command Example
---
description: Review a target for correctness and missing tests
---
Review {{args}}.
Read @{QWEN.md} before making changes.
!{git diff --stat}Permissions and Sandbox
| Command / Setting | Purpose |
|---|---|
/approval-mode plan | Read-only planning. No edits or shell execution. |
/approval-mode default | Ask before file edits and shell commands. |
/approval-mode auto-edit | Auto-approve file edits. Ask before shell commands. |
/approval-mode auto | Use Qwen Code’s classifier for lower-risk actions. |
/approval-mode yolo | Auto-approve every tool call. This does not enable sandboxing. Use only in isolated or disposable environments. |
/permissions | Inspect and edit permission rules. |
qwen --sandbox | Enable the selected sandbox provider. One-run flag. |
QWEN_SANDBOX=true | Enable sandboxing through the environment. Overrides tools.sandbox. |
QWEN_SANDBOX=docker | Force Docker sandboxing. Linux/Windows container option. |
QWEN_SANDBOX=podman | Force Podman sandboxing. Container option. |
QWEN_SANDBOX=sandbox-exec | Force macOS Seatbelt. macOS only. |
--sandbox-image <image> | Select a container image. Beats QWEN_SANDBOX_IMAGE and tools.sandboxImage. |
.qwen/sandbox.Dockerfile | Extend the default container environment. Add project runtimes/dependencies here. |
MCP, Extensions, Skills, and Agents
| Command / Path | Purpose |
|---|---|
qwen mcp list | List persistent MCP server definitions. Shell command. |
qwen mcp add <name> <commandOrUrl> [args...] | Add an MCP server. Supports stdio, HTTP, and SSE. |
qwen mcp remove <name> | Remove an MCP server. Persistent configuration change. |
qwen mcp reconnect [name] | Reconnect one server or all servers. Runtime recovery. |
qwen mcp approve [name] | Approve a pending project server. Project trust flow. |
qwen mcp reject [name] | Reject a pending project server. Project trust flow. |
/mcp | Inspect MCP servers and tools loaded in the current session. /mcp desc, /mcp nodesc, /mcp schema change detail. |
--mcp-config <JSON or path> | Load one-run MCP definitions. Does not replace persistent management. |
qwen extensions install <source> | Install an extension. Source can be a supported Git/path/archive/npm source. |
qwen extensions list | List installed extensions. Shell command. |
qwen extensions update [name] | Update one extension or all eligible extensions. Shell command. |
qwen extensions disable <name> | Disable an extension without uninstalling it. Re-enable with enable. |
qwen extensions uninstall <name> | Remove an extension. Shell command. |
qwen extensions link <path> | Link a local extension for development. Development use. |
qwen extensions new <path> | Create an extension scaffold. Development use. |
~/.qwen/skills/<name>/SKILL.md | Personal Skill definition. Available across projects. |
.qwen/skills/<name>/SKILL.md | Project Skill definition. Repository scope. |
~/.qwen/agents/ | Personal named subagents. Managed with /agents. |
.qwen/agents/ | Project named subagents. Repository scope. |
/reload-plugins | Reload extension-provided commands and definitions. Useful after local changes. |
Troubleshooting
| Problem | Check / Command |
|---|---|
qwen is not found | Restart the terminal, verify PATH, then run qwen --version. |
| Authentication fails | Run /doctor and /auth. Check the provider, credential variable, endpoint, and region. |
| A configured model is missing | Check /model, the provider model ID, and modelProviders. |
| A slash command is missing | Run /help. Check feature gates, slashCommands.disabled, and QWEN_DISABLED_SLASH_COMMANDS. |
| Project settings do not apply | Check <project>/.qwen/settings.json, /config, folder trust, and higher-precedence settings. |
/resume finds nothing | Check general.chatRecording and qwen sessions list. |
| MCP is disconnected | Run qwen mcp list and qwen mcp reconnect. Check the server URL/command, credentials, and timeout. |
| IDE integration fails | Run /ide status and /ide install. |
| A customization breaks startup | Start with qwen --safe-mode, then re-enable customizations selectively. |
| Sandbox lacks a runtime | Check --sandbox-image or .qwen/sandbox.Dockerfile. |
| Output stops early | Check /context, QWEN_CODE_MAX_OUTPUT_TOKENS, and the max-run flags. |
| Need file/session locations | Run /status paths. |
Related Resources
- Claude Code Commands Cheat Sheet
- OpenAI Codex Commands Cheat Sheet
- Qwen Timeline: Model & Product Release History
- Qwen API Pricing
- 10 Best CLI AI Coding Agents
- Qwen 3D Camera Control: Generate New Image Perspectives Free










