Skip to main content
Reference

CLI Commands and Flags

All startup flags for the qodercn command, with defaults and usage examples

This page lists all startup flags of the qodercn command. Use qodercn --help to see the full list in your terminal. Basic invocation:
qodercn [options] [prompt text]
With no arguments, an interactive session starts. Passing prompt text or --print enters non-interactive mode.

General flags

FlagShortTypeDescription
--version-vbooleanPrint the version number and exit.
--help-hbooleanShow help and exit.
--debug-dbooleanEnable debug log output.
--cwd-wstringSpecify the working directory (defaults to the current directory).
--config-dirstringOverride the user config directory (default ~/.qoder-cn).
--add-dirstring[]Add extra trusted directories for the current session (repeatable).
--attachmentstringAttach a file to the initial prompt (repeatable).
--worktree[name]Run isolated in a new Git worktree, with results merged back to the main branch; the name is optional and auto-generated when omitted.

Model and reasoning

FlagShortTypeDescription
--model-mstringSpecify the model identifier (such as auto, or a model name from the New tab like Qwen3.8-Max; use the modelID for BYOK).
--reasoning-effortstringOverride the reasoning effort for this session (such as high).
--context-windownumberOverride the context window size for this session (in tokens).
--list-modelsbooleanList available models and exit.
--output-stylestringThe name of the active output style.

Session management

FlagShortTypeDescription
--continue-cbooleanContinue the most recent session.
--resume-r[id]Resume a previous session by identifier; without an id, pick from a list.
--session-idstringContinue the session with the given ID.
--fork-sessionbooleanFork a new session from a resumed one (with --resume/--session-id).
--name-nstringSet or override the current session name.
--list-sessionsbooleanList all historical sessions and exit.
--delete-session<index>Delete a session by its index number.
Conflict rule: --continue, --resume, --remote, --remote-session, --teleport, and --remote-control cannot be used together.

Output and scripting modes

FlagShortTypeDescription
--print-pbooleanNon-interactive mode: print one response and exit (for CI/scripts).
--output-format-oenumOutput format: text (default), json, stream-json.
--input-formatenumInput format: text (default), stream-json.
--max-turnsnumberLimit the maximum conversation turns per query (prevents infinite loops in automation).
--max-output-tokensnumberSet the model's maximum tokens per output.
--prompt-interactive-istringExecute the given prompt first, then enter interactive mode.
--no-session-persistencebooleanDo not write the session to disk; it cannot be resumed (only works with --print).

Permission control

FlagShortTypeDescription
--permission-modeenumSet the permission mode: default / plan / auto / bypass_permissions / accept_edits / dont_ask.
--yolobooleanEquivalent to --permission-mode bypass_permissions (dangerous: skips all permission confirmations).
--dangerously-skip-permissionsbooleanSame as --permission-mode bypass_permissions (dangerous: skips all permission confirmations).

Tools and MCP

FlagShortTypeDescription
--toolsstring[]Restrict available built-in tools; space- or comma-separated ("" disables all, default enables all; use -p or -- to separate from the query).
--allowed-toolsstring[]Allowlist of tools that may be used.
--disallowed-toolsstring[]Denylist of tools that may not be used.
--mcp-configstringPath to an MCP configuration file (JSON).
--strict-mcp-configbooleanStrict mode: load only the MCP servers specified by --mcp-config.
--allowed-mcp-server-namesstring[]Allowlist of MCP server names.
--max-model-request-retriesnumberMaximum retries for Qoder and external-provider model requests.

Sandbox

FlagShortTypeDescription
--sandbox-sbooleanEnable the sandbox (a boolean switch; does not accept a backend name). The backend is decided by QODERCN_SANDBOX or tools.sandbox.

Agent and system prompt

FlagShortTypeDescription
--agentstringSpecify the Agent used by the main thread.
--agentsjsonDefine custom Agents as a JSON object.
--system-promptstringOverride the system prompt.
--append-system-promptstringAppend content after the default system prompt.

Configuration overrides

FlagShortTypeDescription
--settingsstringA JSON file path or inline JSON object (parsed inline when starting with {), applied as the highest-precedence configuration.
--setting-sourcesstring[]Specify the list of setting sources to load.
--plugin-dirstringAdditional plugin search directory.

Remote and collaboration

FlagShortTypeDescription
--remote[task]Create a cloud remote session and print its access URL (optionally with an initial task).
--remote-session<id>Cold-load and attach to an existing remote session.
--teleport<id>Load and attach to a remote session.
--remote-control<id>Run as a headless remote-control worker.

Editor integration

FlagShortTypeDescription
--acpbooleanStart as an ACP server for clients implementing the ACP protocol (such as Zed) to integrate over standard input/output.

Subcommands

Beyond the startup flags, qodercn also provides several subcommands of the form qodercn <subcommand>:
SubcommandDescription
mcpConfigure and manage MCP servers.
plugins (alias plugin)Manage plugins.
skills (alias skill)Manage Agent Skills.
hooks (alias hook)Manage Hooks.
agents (alias agent)Manage Agents.
loginSign in to your account.
commitGenerate a commit message and commit changes.
rollbackRoll back to a previous version.
updateUpdate to the latest version.
remote-controlStart the remote-control daemon.
statusShow session status.
securityScan source code for security issues (see Security Scanning).
feedbackSubmit feedback.
configView and modify CLI configuration (CN-exclusive, includes the vpc_endpoint setting).

Usage examples

# Start interactively
qodercn

# Specify a model
qodercn -m auto

# Non-interactive one-shot execution
qodercn -p "Explain what this code does"

# JSON output for script consumption
qodercn -p -o json "List the project dependencies"

# Continue the last session
qodercn -c

# Run in an isolated worktree
qodercn --worktree "Refactor the database layer"

# Fully automated mode + sandbox
qodercn --permission-mode auto -s docker "Run the tests and fix the failures"

Next steps