Skip to main content
Deep Agents Code (dcode) accepts command-line flags at launch and exposes management subcommands for agents, sessions, skills, credentials, and configuration. Use this page as a reference when you need to override defaults from the shell, run non-interactive tasks in scripts, or automate administration without opening a session. For installation and daily interactive use, see Quickstart. For how CLI flags fit into the broader configuration model, see Configuration.

Example usage

Choose a model

Launch with --model (-M) 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:
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).
Other providers (for example, Groq or Fireworks) are still available via --model or saved defaults even though they are not part of the startup auto-detection list. See Model providers for the full provider list and credential setup.

Set or clear a default model

Persist a default model for all future launches:
You can also pin a default from the interactive /model switcher (Ctrl+S) or set [models].default in config.toml. See Set a default model.

Model parameters and profile overrides

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:
Override model profile fields (for example, max_input_tokens) with --profile-override. Values merge on top of config file overrides and persist across mid-session /model hot-swaps:
For retry counts on transient errors, use --max-retries or the [retries] section in config.toml. See Model parameters and Profile overrides.

Install provider extras

Optional provider and sandbox packages ship as extras. Install from the shell without launching a session:
Add --package to install an arbitrary provider package via uv --with (see Arbitrary providers), 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").

Agents and sessions

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:
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:
List and delete sessions with dcode threads list and dcode threads delete. See Memory and skills for how per-agent memory works.

Non-interactive mode and piping

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:
When stdin is piped, Deep Agents Code runs non-interactively automatically:
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.

Output, limits, and shell access

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:
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:
Shell execution is disabled by default in non-interactive mode. Enable it with -S/--shell-allow-list:
-S all lets the agent execute arbitrary shell commands with no human confirmation.
For more examples and tracing setup, see Non-interactive mode and piping.

Skills at launch

The --skill flag invokes a skill immediately on launch in interactive or non-interactive mode:
--skill with --quiet or --no-stream requires -n. Manage skills with dcode skills list, create, info, and delete. See Memory and skills.

Rubrics in scripts

Non-interactive runs cannot pause for interactive goal review. Pass acceptance criteria with --rubric when criteria are already known:
Set the grader model and iteration limit separately:
All rubric flags require -n or piped stdin. See Goals and rubrics.

Human-in-the-loop and shell access

Potentially destructive tool calls require approval by default. Skip prompts for a session with -y/--auto-approve, or toggle auto-approve with Shift+Tab during an interactive session:
The -S/--shell-allow-list flag applies in both interactive and non-interactive modes. Pass a comma-separated list of command names, recommended for safe read-only defaults, or all to permit any command. You can also set DEEPAGENTS_CODE_SHELL_ALLOW_LIST in the environment.

Startup commands and initial prompts

Use -m/--message to auto-submit an initial prompt when an interactive session starts. Combine with --startup-cmd to run a shell command first:
--startup-cmd output is rendered in the transcript for your 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.

Remote sandboxes

Route code execution to a remote sandbox with --sandbox. Built-in providers include langsmith, agentcore, daytona, modal, runloop, and vercel. Third-party and config-declared providers are also accepted. Pass --sandbox with no value to use [sandboxes].default from config.toml:
Because --sandbox accepts an optional value, keep the bare form last on the command line. Otherwise a following argument (for example, dcode --sandbox agents) is consumed as the flag’s value.
Install sandbox extras with dcode --install (for example, dcode --install daytona or dcode --install all-sandboxes). See Remote sandboxes for provider setup, working directories, and third-party providers.

MCP flags

Control MCP server loading at launch: --mcp-config and --no-mcp are mutually exclusive. In non-interactive mode, project-level stdio servers are silently skipped unless --trust-project-mcp is passed:
Run OAuth login for MCP servers marked auth: "oauth" with dcode mcp login <server>. See MCP tools.

Command-line options

Manage credentials (dcode auth)

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:
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. See Provider credentials.

Inspect configuration (dcode config)

The dcode config command group reports effective configuration without starting a session. Use it to confirm that an environment variable or config.toml setting is picked up, or to share a redacted snapshot in a bug report:
Provider credentials are reported as configured or not configured only; values are not printed. All four commands accept --json. See Inspect configuration.

Run diagnostics (dcode doctor)

Use dcode doctor when Deep Agents Code is not starting correctly, a provider or MCP server does not connect, tracing is misconfigured, or an install or update looks wrong. It summarizes install method, dependency versions, update status, tracing configuration, and data directory health without launching a session. Pair dcode doctor with dcode config show when you need both a high-level health check and the exact source of a specific setting. See Run diagnostics with dcode doctor.

CLI commands

All management subcommands support --json for machine-readable output. See command-line options for more information. 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.

See also