Skip to Content
User GuideCLI reference

CLI command reference

Use qwen --help in your shell and /help inside an interactive session. They are different interfaces. This reference covers root options visible in help, user slash commands, and extension subcommands. Hidden host protocols and developer diagnostics are not a stable public API.

qwen qwen "Explain this project" qwen -p "Summarize the README" qwen --help qwen --version

The positional argument is the initial prompt; -p selects print mode. Separate a prompt from variadic options with -- so it is not consumed as another option value. Examples require a configured model.

Root options

SyntaxPurpose
-d, --debugRun in debug mode
-m, --model <model>Model for the current session. Default and New Models use model name; Custom uses modelID
--reasoning-effort <level>Set reasoning effort level
--thinking <mode>Set thinking mode (auto, adaptive, enabled, or disabled)
--thinking-budget <tokens>Set a fixed thinking token budget (implies —thinking enabled)
--context-window <size>Explicit context window for supported models
--list-modelsList available models for the current user
-i, --prompt-interactive <text>Execute prompt and continue in interactive mode
-w, --cwd <dir>Change working directory before startup
--config-dir <dir>Use a custom user-level config root for this run
--worktree [name]Start in a new git worktree
--permission-mode <mode>Permission mode: default, accept_edits, bypass_permissions, dont_ask, auto (subject to policy).
--dangerously-skip-permissionsSkip ordinary approval requests; non-skippable checks and policies still apply
--allowed-mcp-server-names <name>Allowed MCP server names
--tools <tools...>Restrict available built-in tools ("" to disable all, “default” for all; use -p or — to separate from query)
--allowed-tools <tool>Tools to allow
--disallowed-tools <tool>Tools to deny
--attachment <file>Attach files to the initial prompt
--plugin-dir <dir>Plugin directories to load
-c, --continueContinue the most recent session
--fork-sessionCreate a new session from a resumed conversation
-r, --resume [id]Resume a previous session by identifier
-n, --name <name>Set a display name for this session
--session-id <id>Use a specific session ID
--list-sessionsList available sessions and exit
--delete-session <index>Delete a session by index number
--add-dir <dir>Additional directories to include in the workspace
-o, --output-format <format>The format of the CLI output
--input-format <format>The format of the CLI input
--max-output-tokens <size>Set maximum model output tokens
-p, --printPrint response and exit (non-interactive)
--no-session-persistenceDisable session persistence - sessions will not be saved to disk and cannot be resumed (only works with —print)
--agent <name>Agent for the current session
--agents <json>JSON object defining custom agents
--append-system-prompt <text>Append to the default system prompt
--system-prompt <text>System prompt for the session
--output-style <style>Output style for this session
--max-model-request-retries <count>Maximum retries for Provider model requests
--mcp-config <config>Load MCP servers from JSON file(s) or inline JSON
--strict-mcp-configOnly use MCP servers from —mcp-config
--setting-sources <source>Setting sources to load (user, project, local)
--settings <json>Load additional settings from a JSON file path or inline JSON string

The command framework also provides --help and --version. Tool allow rules do not replace project trust or organizational restrictions. Non-skippable checks still apply when bypassing approvals. Read permissions before using --dangerously-skip-permissions. Thinking and context-window options depend on model support.

Interactive slash commands

CommandPurpose
/aboutShow version info
/add-dirAdd a directory to the workspace context
/agentsManage agents
/branchCreate a new session branch from the current conversation
/btwAsk a quick side question without interrupting the main conversation
/clearClear the screen and start a new conversation
/commandsReload and list all available slash commands
/compactCompresses the context by replacing it with a summary
/contextVisualize current context window usage
/context-windowSet context window for the current model
/continueContinue the most recent session for the current project
/copyCopy the last assistant response to clipboard, or /copy N for the Nth-latest
/crontabManage scheduled loops and cron jobs
/diffShow uncommitted git changes
/editorSet external editor preference
/effortSet reasoning effort for the current model
/exportExport the current conversation to a file or clipboard
/goalSet or manage a persistent goal for the current session
/helpShow application help and keyboard shortcuts
/hooksOpen hooks management panel
/initAnalyzes the project and creates a tailored context file
/insightsGenerate a report analyzing your sessions
/mcpManage configured Model Context Protocol (MCP) servers
/memoryCommands for interacting with memory
/modelSet or manage model configuration
/newStart a new conversation
/output-styleConfigure the output style for the next conversation
/peersList peer sessions and review held cross-session messages
/permissionsManage permissions
/planToggle Plan Mode (enter when off, exit when on)
/pluginsManage plugins
/profileInspect or control runtime profiling (diagnostics)
/quitExit the application
/release-notesShow recent release notes
/renameRename the current conversation
/resumeResume a session by identifier, or open the session browser
/reviewReview code changes and find actionable issues
/rewindOpen rewind selector
/settingsView and edit application settings
/shortcutsToggle the shortcuts panel above the input
/skillsManage agent skills
/statusShow session status
/statuslineSet up a custom status line. Uses a sub-agent to read your shell config and create a statusline script that’s updated after each response.
/subtaskSend a subagent off with your full context; its result comes back here
/tasksShow background tasks panel
/themeChange the theme
/toolsList available tools
/usageShow usage statistics for the current session
/vimToggle vim mode on/off for this session
/workflowsBrowse workflow tasks in the session rail
/authConnect or switch an account/provider; aliases /connect, /login
/logoutSign out of the selected account; alias /signout
/terminal-setupConfigure terminal integration in supported interactive terminals

Common aliases include /summarize and /compress for /compact, /checkpoint for /rewind, /bg and /background for /tasks, /config for /settings, and /exit for /quit.

This list does not imply every command is enabled in every environment: planning and agents can be disabled; /subtask requires an initial turn and does not allow a nested fork; /terminal-setup is not for ACP sessions. Plugin marketplaces are managed from /plugins or qwen plugins marketplace. Skills, plugins, and workflows can register more commands; inspect them with /commands.

Shell subcommands

The following groups expose these actions. Read their --help output for arguments and scopes, then follow the linked guide.

GroupActionsGuide
qwen mcpadd, add-json, remove, get, list, enable, disable, reset-project-choicesMCP
qwen pluginslist, validate, install, uninstall, enable, disable, update, marketplacePlugins
qwen skillslist, enable, disable, install, link, uninstallSkills
qwen agentslistAgents
qwen hooksmigrateHooks
qwen update--checkInstallation
qwen rollback--toInstallation

Update and rollback depend on installation state and an available release source. See installation and updates for installation instructions. See headless mode for scripted input and output.

Last updated on