CLI Flags Reference
Complete reference for all global flags and command-specific flags. Global flags can be used with any command. Flags are set on the command line and take precedence over environment variables and configuration files.
✓Tip
Flags can also be set in
codecli.json under the flags key. Command-line flags always override config file values.Global Flags
Available on every command.
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
| --help | -h | boolean | false | Show help for the current command and exit |
| --version | -v | boolean | false | Print the codecli version and exit |
| --print-logs | boolean | false | Print internal logs to stderr during execution | |
| --log-level | -l | string | warn | Log level: trace, debug, info, warn, error, off |
Model Flags
Control which AI model is used and how it generates responses.
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
| --model | -m | string | auto | AI model to use. Supports provider/model syntax: "anthropic/claude-sonnet-4-20250514", "openai/gpt-4o", or shorthand: "sonnet", "opus", "gpt-4o" |
| --agent | -a | string | --- | Named agent configuration to load (from codecli.json agents section) |
| --variant | string | --- | Model variant preset: fast (Haiku/GPT-4o-mini), smart (Sonnet/GPT-4o), reasoning (Opus/o1) | |
| --thinking | boolean | false | Enable extended thinking / chain-of-thought mode for supported models |
Session Flags
Control session selection and continuation.
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
| --continue | -c | boolean | false | Resume the most recent session |
| --session | -s | string | --- | Resume a specific session by its UUID |
| --resume | boolean | false | Alias for --continue | |
| --title | -t | string | --- | Set a human-readable title for the new session |
Output Flags
Control the format and delivery of output.
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
| --raw | -r | boolean | false | Output raw text without any formatting or color codes |
| --stream / --no-stream | boolean | varies | Enable or disable streaming response tokens. Default is true for chat/tui, false for run. | |
| --format | -f | string | text | Output format: text, json, markdown |
Permission Flags
Control tool execution permissions.
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
| --dangerously-skip-permissions | boolean | false | Skip all permission prompts. Tools execute without confirmation. Requires CODECLI_DANGEROUSLY_SKIP_PERMISSIONS or explicit consent. | |
| --allow-dangerously-skip-permissions | boolean | false | Allow the --dangerously-skip-permissions flag to be used. Must be set in the global config, not on the command line. |
✖Danger
The
--dangerously-skip-permissions flag should only be used in trusted automated environments such as CI/CD pipelines. Never use it interactively on a developer workstation.Context Flags
Control the working context, including directories, system prompts, and project configuration.
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
| --add-dir | string | --- | Add a directory to the workspace. Can be repeated to add multiple directories. | |
| --append-system-prompt | string | --- | Append text to the end of the system prompt | |
| --bare | boolean | false | Skip loading project config, CLAUDE.md files, and default plugins |
Server Flags
Control network server behavior (for serve, mcp-server, and acp commands).
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
| --remote | boolean | false | Connect to a remote codecli server instead of running locally | |
| --port | -p | number | varies | Port number. Default: 8090 (serve), 4097 (mcp-server), 4517 (acp) |
| --hostname | -H | string | localhost | Hostname to bind the server to. Use 0.0.0.0 for all interfaces. |
| --mdns | boolean | false | Advertise the server via mDNS/Bonjour for local network discovery |
Other Flags
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
| --enable-auto-mode | boolean | false | Enable automatic tool execution. The agent will execute tools without asking for confirmation. | |
| --mainframe | boolean | false | Launch in mainframe mode with multiple agent panes in a split terminal layout | |
| --background | boolean | false | Run codecli as a background daemon process. Attach later with codecli attach. | |
| --compact-threshold | number | auto | Token count threshold at which auto-compaction triggers. Set to 0 to disable. | |
| --preset | string | --- | Load a named preset from the config file. Presets bundle model, flags, and system prompt overrides. |