> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qoder.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI Commands and Parameters

> Complete reference for all qoder command-line startup parameters, flags, default values, and usage examples.

This page lists all startup parameters and flags for the `qoder` command. Use `qoder --help` in the terminal to view the complete list.

Basic invocation:

```bash
qoder [options] [prompt text]
```

When no arguments are passed, it enters an interactive session. Passing a text prompt or `--print` switches to Non-Interactive Mode.

## General Flags

| Flag           | Short | Type      | Description                                                                                                                                  |
| -------------- | ----- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `--version`    | `-v`  | boolean   | Print the version number and exit.                                                                                                           |
| `--help`       | `-h`  | boolean   | Display help information and exit.                                                                                                           |
| `--debug`      | `-d`  | boolean   | Enable debug log output.                                                                                                                     |
| `--cwd`        | `-w`  | string    | Specify the Working Directory (defaults to the current directory).                                                                           |
| `--config-dir` |       | string    | Override the User Configuration Directory (default `~/.qoder`).                                                                              |
| `--add-dir`    |       | string\[] | Add Additional trusted directories for the current session (can be used multiple times).                                                     |
| `--attachment` |       | string    | Attach files to the initial prompt (can be used multiple times).                                                                             |
| `--worktree`   |       | `[name]`  | Execute in isolation within a new Git Worktree, merging results back to the main branch; the name is optional and auto-generated if omitted. |

## Models and Reasoning

| Flag                 | Short | Type    | Description                                                                        |
| -------------------- | ----- | ------- | ---------------------------------------------------------------------------------- |
| `--model`            | `-m`  | string  | Specify the Model Identifier (e.g., `auto`, `lite`, `performance`, or a BYOK key). |
| `--reasoning-effort` |       | string  | Override the reasoning effort for this session (e.g., `high`).                     |
| `--context-window`   |       | number  | Override the Context Window size (in tokens) for this session.                     |
| `--list-models`      |       | boolean | List available models and exit.                                                    |
| `--output-style`     |       | string  | Name of the active Output Style.                                                   |

## Session Management

| Flag               | Short | Type      | Description                                                                           |
| ------------------ | ----- | --------- | ------------------------------------------------------------------------------------- |
| `--continue`       | `-c`  | boolean   | Resume the most recent session.                                                       |
| `--resume`         | `-r`  | `[id]`    | Restore a Historical session by identifier; if no ID is provided, select from a list. |
| `--session-id`     |       | string    | Resume the session with the specified ID.                                             |
| `--fork-session`   |       | boolean   | Fork a new session from a restored session (use with `--resume`/`--session-id`).      |
| `--name`           | `-n`  | string    | Set or override the current session name.                                             |
| `--list-sessions`  |       | boolean   | List all historical sessions and exit.                                                |
| `--delete-session` |       | `<index>` | Delete a specific session by its index number.                                        |

> **Conflict Rules**: `--continue`, `--resume`, `--remote`, `--remote-session`, `--teleport`, and `--remote-control` cannot be used simultaneously.

## Output and Script Mode

| Flag                       | Short | Type    | Description                                                                                              |
| -------------------------- | ----- | ------- | -------------------------------------------------------------------------------------------------------- |
| `--print`                  | `-p`  | boolean | Non-Interactive Mode: output a single response and exit (ideal for CI/scripts).                          |
| `--output-format`          | `-o`  | enum    | Output format: `text` (default), `json`, `stream-json`.                                                  |
| `--input-format`           |       | enum    | Input format: `text` (default), `stream-json`.                                                           |
| `--max-turns`              |       | number  | Limit the maximum Conversation Turns per query (used in automation scenarios to prevent infinite loops). |
| `--max-output-tokens`      |       | number  | Set the maximum number of tokens for a single model output.                                              |
| `--prompt-interactive`     | `-i`  | string  | Execute the given prompt first, then enter interactive mode.                                             |
| `--no-session-persistence` |       | boolean | Do not write the session to disk; it cannot be restored (only valid under `--print`).                    |

## Permission Control

| Flag                             | Short | Type    | Description                                                                                                |
| -------------------------------- | ----- | ------- | ---------------------------------------------------------------------------------------------------------- |
| `--permission-mode`              |       | enum    | Set the Permission Mode: `default` / `plan` / `auto` / `bypass_permissions` / `accept_edits` / `dont_ask`. |
| `--yolo`                         |       | boolean | Equivalent to `--permission-mode bypass_permissions` (dangerous: skips all permission confirmations).      |
| `--dangerously-skip-permissions` |       | boolean | Same as `--permission-mode bypass_permissions` (dangerous: skips all permission confirmations).            |

## Tools and MCP

| Flag                          | Short | Type      | Description                                                                                                                                               |
| ----------------------------- | ----- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--tools`                     |       | string\[] | Restrict available Built-in tools, separated by spaces or commas (`""` disables all, `default` enables all; use `-p` or `--` to separate from the query). |
| `--allowed-tools`             |       | string\[] | Allowlist of tools permitted for use.                                                                                                                     |
| `--disallowed-tools`          |       | string\[] | Blocklist of tools prohibited from use.                                                                                                                   |
| `--mcp-config`                |       | string    | Path to the MCP configuration file (JSON).                                                                                                                |
| `--strict-mcp-config`         |       | boolean   | Strict mode: skip MCP servers from settings and `.mcp.json`, and disable plugin MCP servers by default.                                                   |
| `--allowed-mcp-server-names`  |       | string\[] | Allowlist of permitted MCP server names.                                                                                                                  |
| `--max-model-request-retries` |       | number    | Maximum number of retries for Qoder and custom provider model requests.                                                                                   |

## Agent and System Prompt

| Flag                     | Short | Type   | Description                                     |
| ------------------------ | ----- | ------ | ----------------------------------------------- |
| `--agent`                |       | string | Specify the Agent name used by the main thread. |
| `--agents`               |       | json   | Define a custom Agent using a JSON object.      |
| `--system-prompt`        |       | string | Override the System Prompt.                     |
| `--append-system-prompt` |       | string | Append content after the default System Prompt. |

## Configuration Overrides

| Flag                | Short | Type      | Description                                                                                                                           |
| ------------------- | ----- | --------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `--settings`        |       | string    | Path to a JSON file or an inline JSON object (parsed as inline if it starts with `{`), serving as the highest priority configuration. |
| `--setting-sources` |       | string\[] | Specify the list of configuration sources to load.                                                                                    |
| `--plugin-dir`      |       | string    | Additional plugin search directory.                                                                                                   |

## Remote and Collaboration

| Flag               | Short | Type     | Description                                                                               |
| ------------------ | ----- | -------- | ----------------------------------------------------------------------------------------- |
| `--remote`         |       | `[task]` | Create a cloud remote session and print the access URL (optionally with an initial task). |
| `--remote-session` |       | `<id>`   | Cold load and connect to an existing remote session.                                      |
| `--teleport`       |       | `<id>`   | Load and connect to a remote session.                                                     |
| `--remote-control` |       | `<id>`   | Run as a headless remote-control worker.                                                  |

## Editor Integration

| Flag    | Short | Type    | Description                                                                                                             |
| ------- | ----- | ------- | ----------------------------------------------------------------------------------------------------------------------- |
| `--acp` |       | boolean | Start as an ACP server for integration via standard input/output by clients implementing the ACP protocol, such as Zed. |

## Subcommands

In addition to startup parameters, `qoder` also provides several subcommands in the form of `qoder <subcommand>`:

| Subcommand                 | Description                                                       |
| -------------------------- | ----------------------------------------------------------------- |
| `mcp`                      | Configure 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.                                                    |
| `login`                    | Sign in to your account.                                          |
| `commit`                   | Generate a commit message and commit changes.                     |
| `rollback`                 | Roll back to a previous version.                                  |
| `update`                   | Update to the latest version.                                     |
| `remote-control`           | Start the remote-control daemon.                                  |
| `status`                   | Display session status.                                           |
| `sites`                    | Build, publish, and manage Qoder Sites (see [Sites](/cli/sites)). |
| `feedback`                 | Submit feedback.                                                  |
| `wiki`                     | Generate Wiki documentation for the project.                      |

## Usage Examples

```bash
# Start in interactive mode
qoder

# Specify model
qoder -m performance

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

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

# Resume last session
qoder -c

# Execute in an isolated worktree
qoder --worktree "Refactor the database layer"

qoder --permission-mode auto "Run tests and fix failures"
```

## Next Steps

- Slash commands in interactive mode: [Slash Commands](/cli/slash-reference).
- Configuration files and environment variables: [Configurations, environment variables, and file paths](/cli/settings-reference).
- Detailed guide for non-interactive execution: [Run in Scripts](/cli/run-in-scripts).
