DGC v0.47.2 is out
Navigate
Install DGC
DGC v0.47.2Edit on GitHub ↗
Getting started/Command line

flags, subcommands, and one-shot runs

Command line

#

dgc help prints a short version of this page in the terminal.

Starting a session

#
  • dgc — the full-screen app, rooted at the current directory.
  • dgc --classic — the classic inline REPL instead of the full-screen app.
  • dgc -p "fix the failing test" — run one prompt non-interactively and exit. Add --mode auto for a hands-off run.
  • dgc -c (--continue) — resume the most recent session in this directory.
  • dgc --resume <id> — resume a past session by id; dgc --resume with no id opens a picker.

Per-session flags

#
  • --mode MODE — permission mode for this session: default, acceptEdits, plan, or auto. See Permission modes.
  • --think LEVEL — thinking level for this session: off, low, medium, high, or xhigh. With dgc -p --engine, it applies only to that delegated turn and does not change the native fallback. See Thinking & reasoning.
  • --output-format json — with -p: instead of text, the NDJSON event stream that dgc serve speaks (turn_start, text_delta, tool_call, tool_result, turn_end…), ending in one result object with ok, text, session_id and usage.
  • --output FILE — with -p: also write the final answer to FILE.
  • --print-session-id — with -p: print the session id on stderr, for --resume ID.
  • Piped input: git diff | dgc -p "review this" appends stdin to the prompt (2 MB cap); dgc -p - reads the whole prompt from stdin.

What a one-shot run cannot do. -p has nobody at the keyboard, so everything that waits for a person is unavailable and the model is told so rather than left hanging: no plan-approval card (plan mode still applies — the model writes the plan into its reply instead of calling present_plan), no options picker, no background monitors, and @path in the prompt text is ordinary text, not an attachment — the composer is what turns @ into a bounded file, so pass the file another way. Permission prompts do not appear either: a tool that would ask is denied, with the --allow-tool rule that would have permitted it. A background sub-task started here is waited for only if the model calls wait_tasks; one still running when the turn ends is stopped, and the work in its own checkout is kept for /tasks. An artifact or document server started here dies when the command exits, so its URL is only good while the run lasts. Only a pipe or a redirected file is read — a terminal, /dev/null, and an fd inherited from a launcher (a supervisor, an editor) are left alone, so -p never waits on input nobody is going to send. A -p run never waits on a menu: a tool that would ask is denied with the rule to pre-approve, a plan is reported, not executed.

  • --add-dir PATH — let this run read and edit files under PATH too (repeatable).
  • --allow-tool RULE — pre-approve a tool for this run, e.g. "Bash(npm test)" or Edit (repeatable; never saved).
  • --sandbox on|off|read-only — confine shell commands for this run; read-only mounts the project read-only inside the sandbox and denies every file edit, for review runs. Any setting but off also denies the python tool: the persistent interpreter runs outside the OS sandbox, so leaving it available would keep exactly one tool that can write anywhere the sandbox just masked. /sandbox does the same thing inside a session.
  • --trust — persist the canonical workspace in trusted_dirs (covering its subdirectories) before a non-interactive acceptEdits/auto run. Without it, an unattended run in an untrusted directory will not edit. dgc trust lists every grant and dgc trust revoke N|PATH|here (or /trust inside DGC) forgets one; the gate then asks again on the next launch there. The gate warns when the folder is your home directory or the filesystem root, because a grant covers everything under it — including every future clone.
  • --engine NAME — with dgc -p, delegate that one-shot turn to a subscription CLI instead of the configured endpoint. See Subscriptions.
  • --ultra / --no-ultra — turn the Ultra execution profile on or off for this session (extended reasoning plus bounded parallel agents). See Thinking & reasoning.

Model and endpoint

#

The model and base URL persist to config.json, so you only pass them once. The API-key environment reference is process-only:

  • --model NAME — the model to use. It persists for native runs; with dgc -p --engine, it is a one-turn vendor override and leaves the native model unchanged.
  • --base-url URL — an OpenAI-compatible endpoint.
  • --api-key-env NAME — read the endpoint key from environment variable NAME without persisting it. Prefer this to pasting a key anywhere.

Native-route unattended runs

#
  • --autonomous-gate "CMD" — on a native local/API route, a check command that must exit 0 before the agent is allowed to stop a turn. A failing check is fed back and the agent keeps going. Delegated subscription turns do not execute this gate.
  • --autonomous-max-turns N — bound on failed gate retries before the turn stops anyway (default 30).

Subcommands

#
  • dgc setup — configure provider / model / context.
  • dgc doctor — check that the endpoint and model are reachable, and show the installation.
  • dgc update — install the latest DGC beside the current version; --rollback, --version X and --list switch between the versions kept on disk.
  • dgc export-training — export sessions as scrubbed fine-tuning JSONL.
  • dgc usage [--range today|7d|30d|month|all] [--json] — tokens and requests counted on this machine (~/.dgc/usage.sqlite), by model and by day, from what each provider reported. The same report is /usage inside DGC and Settings → Token Usage in the editor; nothing in it is sent anywhere.
  • dgc protocol describe — print the installed headless/editor contract as JSON.
  • dgc serve — the headless JSON backend the VS Code extension drives. Stdout is protocol-only.
  • dgc acp — Agent Client Protocol JSON-RPC over stdio (Zed, Neovim, and other ACP clients). Prompt blocks, text and images are bounded; embedded resources are untrusted data.
  • dgc mcp ... — the same MCP catalog as /mcp, outside a chat. See MCP servers.
  • dgc skills ... — list, create, install, enable, disable, or show a skill package. See Skills.
  • dgc plugin list|search TEXT|install NAME|sign-in NAME|uninstall NAME|installed — the plugin directory without the editor; dgc plugin marketplace list|add SOURCE|remove NAME|refresh NAME manages catalogs. See Plugins, apps and MCP.
  • dgc notes [QUERY] — search this project's context notes. See Context notes.
  • dgc trust — list workspace-trust grants; dgc trust revoke N|PATH|here forgets one.
  • dgc export [ID] [FILE] — save a session as Markdown (default: most recent, to ~/.dgc/exports).
  • dgc bug — print the issue tracker URL.
  • dgc help, dgc --version.

dgc export-training

#
  • --out PATH — output path (default ./dgc-training.jsonl).
  • --all — every project, not just the current one.
  • --session ID — a single session; a unique id prefix is accepted.
  • --successful-only — apply DGC's outcome heuristic: keep a session when an edit landed with no edit-tool failure, or its goal was marked complete. This is a curation aid, not proof that tests passed or the result is correct.
  • --min-turns N — drop sessions with fewer than N user turns (default 1).

Secrets are scrubbed on the way out. See Training export.

Documentation