Cap agent runs with --max-turns and --timeout
Cap agent runs in CI with `--max-turns` or `--timeout`. Both exit with code 124 when the budget is exceeded. Requires `-n` or piped stdin. Examples: `dcode -n "fix the failing tests" --max-turns 10`, `dcode -n "run the test suite and summarise failures" --timeout 120`.
CLI flag to choose and pin model
Use the `--model` (`-M`) flag to pin a model for one session. Use the `provider:model` format (for example, `openai:gpt-5.5`) or pass a bare model name when the provider is unambiguous. Examples: `dcode --model anthropic:claude-opus-4-8`, `dcode --model openai:gpt-5.5`, `dcode --model fireworks:accounts/fireworks/models/deepseek-v4-pro`.
Model resolution order when no --model flag provided
When Deep Agents Code starts without `--model`, it resolves the model in this order: 1. `--model` flag when provided. 2. `[models].default` in `~/.deepagents/config.toml`. 3. `[models].recent` in `~/.deepagents/config.toml` (written automatically when you switch models in a session). 4. Environment auto-detection: the first available credential among `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GOOGLE_API_KEY`, and `GOOGLE_CLOUD_PROJECT` (Vertex AI).
Set, view, or clear default model
Persist a default model for all future launches: `dcode --default-model anthropic:claude-opus-4-8` to set, `dcode --default-model` to view, and `dcode --clear-default-model` to clear.
Pass extra model parameters with --model-params
Pass extra constructor kwargs to the model with `--model-params` as a JSON string. These apply for the current session only and override `config.toml` provider params. Examples: `dcode --model openai:gpt-5.5 --model-params '{"reasoning": {"effort": "high"}}'`, `dcode --model anthropic:claude-opus-4-8 --model-params '{"thinking": {"type": "enabled", "budget_tokens": 10000}, "max_tokens": 16000}'`.
Override model profile fields with --profile-override
Override model profile fields (for example, `max_input_tokens`) with `--profile-override` as a JSON string. Values merge on top of config file overrides and persist across mid-session `/model` hot-swaps. Examples: `dcode --profile-override '{"max_input_tokens": 4096}'`, `dcode --model google_genai:gemini-3.6-flash --profile-override '{"max_input_tokens": 4096}'`.
Install optional provider extras from shell
Install optional provider and sandbox packages without launching a session: `dcode --install groq`, `dcode --install fireworks`, `dcode --install ollama`. Add `--package` to install an arbitrary provider package via `uv --with`, and `--yes` to skip confirmation prompts. To preinstall extras during the initial CLI install, set `DEEPAGENTS_CODE_EXTRAS` (for example, `DEEPAGENTS_CODE_EXTRAS="groq,fireworks"`).
Launch with named agent using -a/--agent flag
Use `-a`/`--agent` to launch with a named agent that has its own memory, skills, and `AGENTS.md` under `~/.deepagents/<agent_name>/`. The flag overrides both `[agents].default` and `[agents].recent` in `config.toml`. Example: `dcode --agent backend-dev`.
Resume previous conversation with -r/--resume
Resume a previous conversation with `-r`/`--resume`. Pass no ID to open the most recent thread, or pass a thread ID to resume a specific session. Resuming bypasses agent selection flags and restores the thread's original agent. Examples: `dcode -r`, `dcode -r abc123-thread-id`.
Non-interactive mode with -n/--non-interactive
Use `-n`/`--non-interactive` to run a single task without the interactive UI. Each non-interactive run starts a fresh thread; file-based state (memory, skills, configuration) persists across invocations. Example: `dcode -n "Write a Python script that prints hello world"`. When stdin is piped, Deep Agents Code runs non-interactively automatically.
Piped input behavior and size limits
When you combine piped input with `-n` or `-m`, the piped content appears first, followed by the flag text. The maximum piped input size is 10 MiB. Use `--stdin` to read from stdin explicitly instead of auto-detection.
Quiet output with -q/--quiet for piping
Use `-q`/`--quiet` to emit only the agent's response on stdout (for piping into other commands). Add `--no-stream` to buffer the full response before writing. Examples: `dcode -n "Generate a .gitignore for Python" -q > .gitignore`, `dcode -n "List dependencies" -q --no-stream | sort`.
Enable shell execution in non-interactive mode with -S/--shell-allow-list
Shell execution is disabled by default in non-interactive mode. Enable it with `-S`/`--shell-allow-list`. Pass a comma-separated list of command names, `recommended` for safe read-only defaults, or `all` to permit any command. Examples: `dcode -n "Run the tests and fix failures" -S "pytest,git,make"`, `dcode -n "Build the project" -S recommended`, `dcode -n "Fix the build" -S all`. Warning: `-S all` lets the agent execute arbitrary shell commands with no human confirmation.
Invoke skill at launch with --skill
The `--skill` flag invokes a skill immediately on launch in interactive or non-interactive mode. Examples: `dcode --skill code-review`, `dcode --skill code-review -m 'review the auth module'`, `cat diff.txt | dcode --skill code-review -n 'review this patch'`, `dcode --skill code-review -n 'review this patch' -q`. `--skill` with `--quiet` or `--no-stream` requires `-n`.
Pass rubric acceptance criteria with --rubric in non-interactive mode
Non-interactive runs cannot pause for interactive goal review. Pass acceptance criteria with `--rubric` when criteria are already known. Examples: `dcode -n "implement OAuth refresh handling" --rubric "tests pass; no unrelated files changed"`, `dcode -n "implement OAuth refresh handling" --rubric @acceptance.md`. Set the grader model and iteration limit separately with `--rubric-model` and `--rubric-max-iterations`. All rubric flags require `-n` or piped stdin.
Inspect active tool set with /tools command
Run `/tools` in a session to inspect the active tool set. From the shell, place tool-shaping flags before the subcommand. Examples: `dcode tools list`, `dcode --allow-fs-tools ls,read_file tools list`, `dcode --allow-fs-tools ls,read_file tools list --json`.
Use -m/--message for initial prompt and --startup-cmd for shell command
Use `-m`/`--message` to auto-submit an initial prompt when an interactive session starts. Combine with `--startup-cmd` to run a shell command first. Example: `dcode --startup-cmd "git diff --stat" -m "Summarize these changes"`. `--startup-cmd` output is rendered in the transcript for reference but is not added to the agent's message history. To hand command output to the agent, pipe it via stdin instead. Non-zero exits and timeouts from `--startup-cmd` warn but do not abort the session. Non-interactive mode applies a 60-second timeout to the startup command.
MCP flag control at launch
Control MCP server loading at launch with flags: `--mcp-config PATH` adds an explicit config as the highest-precedence source (merged on top of auto-discovered configs); `--no-mcp` disables MCP entirely; `--trust-project-mcp` trusts project-level servers without prompting for the current run (servers denied by user policy remain disabled). `--mcp-config` and `--no-mcp` are mutually exclusive. In non-interactive mode, project servers without a matching saved or environment approval are silently skipped unless `--trust-project-mcp` is passed. Examples: `dcode --trust-project-mcp`, `dcode -n "run tests" --trust-project-mcp`.
Run OAuth login for MCP servers with dcode mcp login
Run OAuth login for MCP servers marked `auth: "oauth"` with `dcode mcp login <server>`.
Command-line options reference table
| Option | Description |
|--------|-------------|
| `-a`, `--agent NAME` | Use named agent with separate memory. Overrides `[agents].recent` and `[agents].default` in `config.toml`. Default: `agent` (or the most recently used agent if `[agents].recent` is set) |
| `-M`, `--model MODEL` | Use a specific model (`provider:model`) |
| `--model-params JSON` | Extra kwargs to pass to the model as a JSON string (e.g., `'{"temperature": 0.7}'`) |
| `--max-retries N` | Override the max retries for transient model errors |
| `--default-model [MODEL]` | Set the default model (omit `MODEL` to view the current default) |
| `--clear-default-model` | Clear the default model |
| `-r`, `--resume [ID]` | Resume a session: `-r` for most recent, `-r <ID>` for a specific thread |
| `-m`, `--message TEXT` | Initial prompt to auto-submit when the session starts (interactive mode) |
| `--skill NAME` | Invoke a skill at startup |
| `--startup-cmd CMD` | Shell command to run at startup, before the first prompt. Output is rendered in the transcript but is not added to the agent's message history. Non-zero exits and timeouts warn but do not abort; non-interactive mode applies a 60s timeout. |
| `--rubric TEXT\|@PATH` | Acceptance criteria for rubric grading. Accepts literal text or `@path` to read a file. Requires `-n` or piped stdin |
| `--rubric-model MODEL` | Model the rubric grader uses. Defaults to the main agent model. Requires `-n` or piped stdin |
| `--rubric-max-iterations N` | Grader iterations per rubric attempt before stopping. Requires `-n` or piped stdin |
| `-n`, `--non-interactive TEXT` | Run a single task non-interactively and exit. Shell is disabled unless `--shell-allow-list` is set |
| `--recursion-limit N` | LangGraph graph step budget (max node invocations per turn). Valid range: 25–100000. Out-of-range or non-integer values log a warning and fall back to the default (2000). Overrides `DEEPAGENTS_CODE_RECURSION_LIMIT` and `[runtime].recursion_limit` in `config.toml` |
| `--max-turns N` | Cap agentic turns in non-interactive mode. Exits with code 124 when exceeded. Requires `-n` or piped stdin. |
| `--timeout SECONDS` | Hard wall-clock timeout for non-interactive mode. Exits with code 124 when exceeded. Requires `-n` or piped stdin. |
| `-q`, `--quiet` | Clean output for piping—only the agent's response goes to stdout. Requires `-n` or piped stdin |
| `--no-stream` | Buffer the full response and write to stdout at once instead of streaming. Requires `-n` or piped stdin |
| `--stdin` | Read input from stdin explicitly instead of auto-detection. Errors clearly when stdin is unavailable or is a TTY |
| `-y`, `--auto-approve` | Enable classifier-backed Auto mode. Requires an interactive local session; toggle with `Shift+Tab` during an interactive session |
| `--auto-classifier-model MODEL` | Model used by the Auto classifier to review gated tool calls (`provider:model` format). Overrides `DEEPAGENTS_CODE_AUTO_CLASSIFIER_MODEL` and `[models].auto_classifier` in `config.toml`. Interactive TUI sessions only |
| `--yolo` | Run gated actions without review after the one-time local risk acknowledgement. Interactive mode only |
| `-S`, `--shell-allow-list LIST` | Comma-separated shell commands to auto-approve, `'recommended'` for safe defaults, or `'all'` to allow any command. Applies to both `-n` and interactive modes |
| `--allow-fs-tools LIST` | Filesystem tools to expose. Defaults to `all`. |
| `--json` | Emit machine-readable JSON from supported management subcommands. Output envelope: `{"schema_version": 1, "command": "...", "data": ...}` |
| `--sandbox TYPE` | Remote sandbox for code execution: `none` (default), `langsmith`, `agentcore`, `daytona`, `modal`, `runloop`, `vercel`, and third-party providers. |
| `--sandbox-id ID` | Reuse an existing sandbox (skips creation and cleanup) |
| `--sandbox-snapshot-name NAME` | Sandbox snapshot name to use or create (`langsmith`, `runloop`, and providers that advertise snapshot support) |
| `--sandbox-setup PATH` | Path to setup script to run in sandbox after creation |
| `--mcp-config PATH` | Add an explicit MCP config as the highest-precedence source (merged with auto-discovered configs) |
| `--no-mcp` | Disable all MCP tool loading |
| `--trust-project-mcp` | Trust project-level MCP servers without prompting for the current run. Explicit denies still apply. |
| `--interpreter` | Enable the JS interpreter (`js_eval`) middleware on the main agent when it has been disabled in config. `js_eval` is enabled by default. |
| `--interpreter-tools VALUE` | PTC allowlist for `js_eval`: `safe`, `all`, or a comma-separated list of tool names. Default: no PTC (pure REPL) |
| `--profile-override JSON` | Override model profile fields as a JSON string (e.g., `'{"max_input_tokens": 4096}'`). Merged on top of config file profile overrides |
| `--acp` | Run as an ACP server over stdio instead of launching the interactive UI |
| `--update` | Check for and install updates, then exit |
| `--auto-update` | Toggle automatic updates on or off, then exit |
| `--install NAME` | Install an optional extra (e.g., `quickjs`, `daytona`, `fireworks`), then exit. Add `--package` to treat `NAME` as a custom provider package via `uv --with`, and `--yes` to skip confirmation prompts |
| `-v`, `--version` | Display version |
| `-h`, `--help` | Show help |
Manage credentials with dcode auth command group
The `dcode auth` command group is the scriptable equivalent of the `/auth` credential manager. It reads and writes the same `auth.json` store without launching the TUI. Examples: `echo "$ANTHROPIC_API_KEY" | dcode auth set anthropic` (pipe the key in—never lands in shell history), `dcode auth set openai --from-env OPENAI_API_KEY` (copy from environment variable), `dcode auth list`, `dcode auth status openai`, `dcode auth remove anthropic`, `dcode auth path`. `set` refuses to run in an interactive terminal unless you pipe the key via stdin or use `--from-env`. `dcode auth set` manages API keys only; the `openai_codex` provider uses ChatGPT browser sign-in via `/auth` instead.
Inspect configuration without starting session with dcode config
The `dcode config` command group reports effective configuration without starting a session. Examples: `dcode config show` (show every config option's effective value and source), `dcode config get interpreter.memory_limit_mb` (show effective value and source for one option), `dcode config list` (list all available config options with type, default, and where each can be set), `dcode config path` (show config file locations and whether each exists). Provider credentials are reported as configured or not configured only; values are not printed. All four commands accept `--json`.
CLI management subcommands reference
| Command | Description |
|---------|-------------|
| `dcode help` | Show help |
| `dcode tools list [--json]` | List the tools available to the configured agent. Place top-level tool-shaping flags, such as `--allow-fs-tools`, `--no-mcp`, `--mcp-config`, and `--trust-project-mcp`, before `tools list` |
| `dcode agents list` | List all agents (alias: `ls`) |
| `dcode agents reset --agent NAME` | Clear agent memory and reset to default. Supports `--dry-run` |
| `dcode agents reset --agent NAME --target SOURCE` | Copy memory from another agent |
| `dcode update` | Check for and install Deep Agents Code updates |
| `dcode doctor` | Run diagnostics without launching a session |
| `dcode skills list [--project]` | List all skills (alias: `ls`) |
| `dcode skills create NAME [--project]` | Create a new skill with template `SKILL.md`. Idempotent—re-creating an existing skill prints an informational message instead of an error |
| `dcode skills info NAME [--project]` | Show detailed information about a skill |
| `dcode skills delete NAME [--project] [-f]` | Delete a skill and its contents. Supports `--dry-run` |
| `dcode threads list [--agent NAME] [--limit N]` | List sessions (alias: `ls`). Default limit: 20. `-n` is a short flag for `--limit`. Additional flags: `--sort {created,updated}`, `--branch TEXT` (filter by git branch), `--cwd [PATH]` (filter by working directory; bare flag uses current directory), `-v`/`--verbose` (show all columns), `-r`/`--relative` (relative timestamps) |
| `dcode threads delete ID` | Delete a session. Supports `--dry-run` |
| `dcode mcp login NAME [--mcp-config PATH]` | Run the OAuth login flow for an MCP server marked `auth: "oauth"` |
| `dcode mcp config` | Show MCP config discovery paths |
| `dcode config show` | Show every config option's effective value and the source it resolves from |
| `dcode config list` | List all available config options with their type, default, and where each can be set (alias: `ls`) |
| `dcode config get KEY` | Show the effective value and source for one option (e.g. `interpreter.memory_limit_mb`) |
| `dcode config path` | Show config file locations and whether each exists |
| `dcode auth list` | List known providers and where each credential resolves from |
| `dcode auth status <provider>` | Show the credential source for one provider |
| `dcode auth set <provider>` | Store a provider credential from stdin or `--from-env` |
| `dcode auth remove <provider>` | Remove a stored provider credential |
| `dcode auth path` | Show the credential store path |
Destructive commands support --dry-run
Destructive commands (`agents reset`, `skills delete`, `threads delete`) support `--dry-run` to preview what would happen without making changes. In JSON mode, `--dry-run` returns the same envelope with a `dry_run: true` field.
Environment variable reference DEEPAGENTS_CODE_AUTO_UPDATE
`DEEPAGENTS_CODE_AUTO_UPDATE` (optional, string): Toggle automatic Deep Agents Code updates. Enabled by default; set to `0`, `false`, `no`, or `off` to opt out.
Environment variable reference DEEPAGENTS_CODE_AUTO_CLASSIFIER_TIMEOUT
`DEEPAGENTS_CODE_AUTO_CLASSIFIER_TIMEOUT` (optional, integer): Time budget in seconds for the Auto mode classifier to review each batch of gated actions. Valid range: `1`–`300`. Out-of-range or non-integer values fall back to default (`20`). Consider selecting a faster classifier model before raising this value. Overrides `[models].auto_classifier_timeout` in `config.toml`.
Environment variable reference DEEPAGENTS_CODE_DEBUG
`DEEPAGENTS_CODE_DEBUG` (optional, string): Enable verbose debug logging to file. Accepts `1`, `true`, `yes`, `on` (case-insensitive) as enabled; `0`, `false`, `no`, `off`, empty string, or unset disables it. When enabled, per-session server log file is preserved on shutdown and its path is printed to stderr for triage.
Environment variable reference DEEPAGENTS_CODE_EXPERIMENTAL
`DEEPAGENTS_CODE_EXPERIMENTAL` (optional, string): Opt into experimental, unstable Deep Agents Code behavior. Set to `1` (or any truthy value) to enable experimental features.
Environment variable reference DEEPAGENTS_CODE_DEBUG_FILE
`DEEPAGENTS_CODE_DEBUG_FILE` (optional, string, default `/tmp/deepagents_debug.log`): Path for the debug log file.
Environment variable reference project MCP trust variables
Project MCP trust variables require `deepagents-code>=0.1.40`. This version ignores the former `DEEPAGENTS_CODE_ENABLED_PROJECT_MCP_SERVERS` variable; use `DEEPAGENTS_CODE_DANGEROUSLY_ENABLE_PROJECT_MCP_SERVERS` for the same name-based behavior.
Environment variable reference DEEPAGENTS_CODE_DISABLED_PROJECT_MCP_SERVERS
`DEEPAGENTS_CODE_DISABLED_PROJECT_MCP_SERVERS` (optional, string): Comma-separated project MCP server names to always reject by name. Deep Agents Code combines these names with `[mcp].disabled_project_servers`; denies win over saved approvals and the `--trust-project-mcp` flag.
Environment variable reference DEEPAGENTS_CODE_DANGEROUSLY_ENABLE_PROJECT_MCP_SERVERS
`DEEPAGENTS_CODE_DANGEROUSLY_ENABLE_PROJECT_MCP_SERVERS` (optional, string): Comma-separated project MCP server names to pre-approve by name for any project. This is a process-wide escape hatch: A different project, command change, or URL change under the same server name still matches. When set, this variable replaces saved approvals for the process. Prefer saved approvals from the project MCP prompt when possible.
Environment variable reference DEEPAGENTS_CODE_EXTRA_SKILLS_DIRS
`DEEPAGENTS_CODE_EXTRA_SKILLS_DIRS` (optional, string): Colon-separated paths added to the skill containment allowlist.
Environment variable reference DEEPAGENTS_CODE_LANGSMITH_PROJECT
`DEEPAGENTS_CODE_LANGSMITH_PROJECT` (optional, string): Override the LangSmith project name for Deep Agents Code's own agent traces. Shell commands still run with the user's original `LANGSMITH_PROJECT`, so app, test, or script traces can appear in a separate project.
Environment variable reference DEEPAGENTS_CODE_LANGSMITH_REDACT
`DEEPAGENTS_CODE_LANGSMITH_REDACT` (optional, string, default `false`): Toggle client-side secret redaction for Deep Agents Code's LangSmith agent-trace inputs and outputs. Accepts `1`, `true`, `yes`, or `on` to enable redaction and `0`, `false`, `no`, or `off` to disable it, case-insensitively. When redaction is enabled, tracing is disabled for that run if redaction cannot be configured.
Environment variable reference DEEPAGENTS_CODE_LANGSMITH_REPLICA_PROJECTS
`DEEPAGENTS_CODE_LANGSMITH_REPLICA_PROJECTS` (optional, string): A second LangSmith project to *also* write agent traces to. When set and tracing is active, each agent run is dual-written to the primary project (from `DEEPAGENTS_CODE_LANGSMITH_PROJECT`, or `deepagents-code` by default) and this project. Off by default.
Environment variable reference DEEPAGENTS_CODE_NO_UPDATE_CHECK
`DEEPAGENTS_CODE_NO_UPDATE_CHECK` (optional, string): Disable automatic update checking when set. This also prevents automatic update installs at startup.
Environment variable reference DEEPAGENTS_CODE_ONBOARDING
`DEEPAGENTS_CODE_ONBOARDING` (optional, string): Override the first-run onboarding flow. Set to a truthy value to force it open on every startup; set to a falsy value to suppress it entirely (useful for CI and provisioned machines). Leave unset for the default first-run behavior.
Environment variable reference DEEPAGENTS_CODE_RECURSION_LIMIT
`DEEPAGENTS_CODE_RECURSION_LIMIT` (optional, integer): LangGraph graph step budget, which is the maximum number of node invocations the `dcode` agent graph may execute per turn. Valid range: `25`–`100000`. Out-of-range or non-integer values log a warning and fall back to default (`2000`). Overridden by `--recursion-limit` at CLI.
Environment variable reference DEEPAGENTS_CODE_SHELL_ALLOW_LIST
`DEEPAGENTS_CODE_SHELL_ALLOW_LIST` (optional, string): Comma-separated shell commands to allow (or `recommended` / `all`).
Environment variable reference DEEPAGENTS_CODE_USER_ID
`DEEPAGENTS_CODE_USER_ID` (optional, string): Attach a user identifier to LangSmith trace metadata.
CLI flag: --rubric for non-interactive mode
In non-interactive mode (dcode -n), use `--rubric` for tasks where criteria are already known. The rubric can be specified as a string or referenced from a file using @. Example: `dcode -n "implement OAuth refresh handling" --rubric "tests pass; no unrelated files changed"` or `dcode -n "implement OAuth refresh handling" --rubric @acceptance.md`
CLI flags: --rubric-model and --rubric-max-iterations
In non-interactive mode, use `--rubric-model <provider:model>` to set the model that grades rubric results and `--rubric-max-iterations <N>` to set the maximum grading iterations for the rubric. Example: `dcode -n "implement OAuth refresh handling" --rubric "tests pass; no unrelated files changed" --rubric-model openai:gpt-5.5 --rubric-max-iterations 3`
MCP configuration flags for discovery and disabling
Two command-line flags control MCP configuration discovery: `--mcp-config PATH` adds an explicit config as the highest-precedence source (merged on top of auto-discovered configs), and `--no-mcp` disables MCP entirely so no servers are loaded. These flags are mutually exclusive.
MCP project trust flag: --trust-project-mcp
The `--trust-project-mcp` flag trusts project-level servers without prompting for the current run. Servers denied by user policy remain disabled. Example: `dcode --trust-project-mcp` skips the approval prompt, or `dcode -n "run tests" --trust-project-mcp` for non-interactive explicit trust of project servers.
Sandbox flags reference
--sandbox TYPE: Sandbox provider to use. Built-ins: langsmith, agentcore, daytona, modal, runloop, vercel (default: none). Third-party and config-declared providers are also accepted. Pass --sandbox with no value to use [sandboxes].default from config.
--sandbox-id ID: Reuse an existing sandbox by ID instead of creating a new one. Skips creation and cleanup. Only for providers that support reattaching by ID.
--sandbox-snapshot-name NAME: Use or create a sandbox snapshot. Supported by langsmith and runloop (and any third-party provider that advertises snapshot support). Cannot be combined with --sandbox-id.
--sandbox-setup PATH: Path to a setup script to run inside the sandbox upon creation.
Sandbox flag ordering on command line
Because --sandbox accepts an optional value, keep the bare form (--sandbox with no provider name) last on the command line. Otherwise a following argument (e.g., dcode --sandbox agents) is consumed as the flag's value. Pass an explicit provider name to avoid ambiguity.
Example shell allow-list with specific commands
dcode -n "Run the tests and fix failures" -S "pytest,git,make"
Example shell allow-list with recommended
dcode -n "Build the project" -S recommended
Example shell allow-list with all commands
dcode -n "Fix the build" -S all
Non-interactive mode uses -n flag
Use dcode -n "<task>" to run a single task without launching the interactive UI. Each non-interactive run starts a fresh thread and conversation history does not carry between invocations, but file-based state persists.
Piping input to dcode automatically runs non-interactively
When input is piped to dcode via stdin, Deep Agents Code automatically runs in non-interactive mode. Examples include: echo "Explain this code" | dcode, cat error.log | dcode -n "What's causing this error?", git diff | dcode -n "Review these changes".
Shell execution disabled by default in non-interactive mode
Shell execution is disabled by default in non-interactive mode. Use -S/--shell-allow-list to enable specific commands.
Shell allow-list flag options
The -S/--shell-allow-list flag accepts specific commands (e.g., -S "pytest,git,make"), the value "recommended" for safe defaults, or the value "all" to permit any command.
Max turns limit with --max-turns flag
Use --max-turns N to give agents a hard upper bound on turns, preventing indefinite looping. N must be a positive integer. When exceeded, the process exits with code 124 (matching GNU timeout). Requires -n or piped stdin.
Timeout limit with --timeout flag
Use --timeout SECONDS to enforce a hard wall-clock limit on non-interactive runs. When expired, the agent is cancelled and the process exits with code 124. Can be combined with --max-turns; whichever limit is hit first stops the agent. Requires -n or piped stdin.
Clean output flag -q
Use -q for clean output suitable for piping into other commands in non-interactive mode.
No stream flag --no-stream buffers response
Use --no-stream to buffer the full response before writing to stdout instead of streaming.
Non-interactive mode favors autonomous behavior
In non-interactive mode, the agent is instructed to make reasonable assumptions and proceed autonomously rather than ask clarifying questions. It also favors non-interactive command variants (e.g., npm init -y, apt-get install -y).
Example piping input with skill
git diff | dcode --skill code-review -n 'summarize changes'