Skip to content

CLI Reference ​

The dagu binary runs workflows, inspects their runs, serves the Web UI, and manages an installation. Each entry below gives the purpose, usage, flags, and an example. dagu <command> --help prints the flags of the installed version.

Command Index ​

Run workflows

CommandWhat it doesRemote
startRun a DAG now and wait for it to finishyes
enqueuePut a run in its queue for the scheduler to startyes
execRun one command as a DAG run, without a YAML file
dryPlan a run without executing any step
stopStop a running or waiting runyes
restartStop a run and start it again with a new run IDyes
retryRun a finished run again under the same run IDyes
dequeueRemove a queued runyes
backfillRun a scheduled DAG for past schedule slots
human-task completeComplete a step that waits for a person
human-task push-backSend a waiting task back with feedback

Inspect runs and DAGs

CommandWhat it doesRemote
statusShow a run's steps, logs, and resultyes
historyList past runs with filtersyes
psList runs in progress on this host
lsList DAG definitions, next runs, and last results
validateCheck DAG files without running them
testRun workflow tests with mocked steps
calendarCheck business calendars and preview schedule fires

Run the server

CommandWhat it doesRemote
start-allWeb UI, scheduler, and coordinator in one process
serverWeb UI and REST API only
schedulerScheduler only
coordinatorCoordinator for distributed workers
workerWorker that takes runs from coordinators
worker inviteCreate an invite for a worker on another host
peer initCreate a shared peer CA and token

Manage an installation

CommandWhat it doesRemote
contextAdd and select remote servers for the CLI
configShow resolved paths and settings
profileManage runtime profiles
secretPrint a secret's value
nodesManage SSH node inventories and worker nodesyes
syncPull and publish Git Sync items
rmDelete run history or a DAG definition
prune-artifactsDelete artifact directories no run uses
cleanupDeprecated form of rm --history
licenseConnect to Dagu Console and manage the license
upgradeReplace the binary with a newer release
version, schema, example, completionVersion, field reference, example DAGs, shell completion

Browser, desktop, and spreadsheet tools

CommandWhat it doesRemote
browser sessionWork a site step by step, then export a browser step
browser writesReview and approve what browser steps may submit
browser cache clearForget recorded browser actions
computer checkCheck that computer steps can drive this desktop
computer elementsList the UI elements of the front window
computer cache clear, computer cache showForget or show recorded desktop actions
xlsx inspect, xlsx readLook at a workbook before writing xlsx steps
xlsx cache clearForget cached xlsx extractions

Remote marks commands that can target another server through a remote context. Every other command works on this host's installation and refuses a remote context.

Global Flags ​

FlagDescription
--context <name>CLI context to use (default: the current context, or local)
-c, --config <file>Configuration file (default: ~/.config/dagu/config.yaml)
--dagu-home <dir>Use this directory as DAGU_HOME for this command
-q, --quietSuppress output
--cpu-profileWrite a CPU profile to cpu.pprof
-h, --helpShow help

version, schema, completion, peer init, xlsx inspect, and xlsx read do not take --config, --dagu-home, --quiet, or --cpu-profile. example takes no --quiet.

A DAG argument is a DAG name, resolved in the DAGs directory, or a path to a YAML file. restart and human-task take the DAG name only.

Remote Contexts ​

A context points the CLI at another server's REST API. The built-in local context, always present, works on this host.

bash
# Add a server and make it current
dagu context add staging \
  --server https://staging.example.com/api/v1 \
  --api-key dagu_xxxxxxxxxxxxxxxxxxxx
dagu context use staging

# Or pick a context for one command
dagu --context staging status nightly-backup
  • --server is the API base URL, not the Web UI URL. With base_path: /dagu on the server, use https://example.com/dagu/api/v1.
  • Remote commands act on DAGs that exist on that server. Pass the DAG's file name or unique name; a local path such as ./job.yaml is rejected.
  • --profile on start and enqueue, and --recursive-output on start, work only in the local context. To pick a profile on a remote server, use the Web UI or the REST API profile field.
  • Contexts are stored under paths.contexts_dir, with API keys encrypted at rest. Manage them with context.

Run Workflows ​

start ​

Run a DAG and wait for it to finish. The command prints the run's step tree and exits non-zero when the run fails.

bash
dagu start [flags] <DAG> [-- PARAMS...]
FlagDescription
-p, --paramsParameters: KEY=value pairs, positional values, or a JSON object. Values after -- do the same
--params-stdinRead parameters from piped stdin, up to 1 MiB. -- and --params take precedence
-r, --run-idRun ID for the new run
-N, --nameOverride the DAG name
--profileRuntime profile for the run
--labelsExtra labels, comma-separated key=value or key (--tags is a deprecated alias)
--scheduled-atRun for a schedule slot: latest, a date, a time in the schedule's zone, or RFC 3339. See Running a Past Slot
--from-run-idRun again with the definition and parameters of a past run, for its slot unless --scheduled-at names another
--onlyRun only this step, by name or ID; repeatable. Other steps are recorded as skipped
--outputs-fromWith --only: a finished run whose work directory and upstream outputs feed the selected steps
--output-fromWith --only: take one skipped step's outputs from a run, as <step>=<run-id>; repeatable
--allow-changedReuse outputs of skipped steps even when they changed since that run
--reuse-fromA finished run whose unchanged steps are reused; only changed steps and those after them run. See Rerunning Changed Steps
--no-reuseRecompute build steps instead of reusing earlier results
--nodeNarrow the run to this node; repeatable. See Narrow a Run to Listed Nodes
--worker-labelWorker label (key=value) the run requires, replacing worker_selector; repeatable
--default-working-dirWorking directory for a DAG without working_dir
--recursive-outputExpand sub-DAG runs in the final tree, as status --recursive-output does

--trigger-type and --worker-id are set by Dagu when it launches a run itself. --output <step>.<name>=<value> is deprecated; use --output-from.

bash
dagu start etl.yaml -- DATE=2026-01-01 ENV=prod
dagu start --run-id batch-001 --profile prod etl
echo 'DATE=2026-01-01' | dagu start --params-stdin etl
dagu start --scheduled-at 2026-11-09 etl

Run one step with the outputs of an earlier run, or rerun only what changed after an edit:

bash
dagu start --only report --outputs-from 0358hGcngBQM7KuBv8W6h3 etl
dagu start --reuse-from 0358hGcngBQM7KuBv8W6h3 etl

A DAG with restart_policy: always or unless-stopped has one run at a time, so start fails while one is active. See Services.

Rules for --only and --reuse-from
  • --only starts a new run of the current definition under the DAG's own name. Preconditions and handler_on.init apply. The success, failure, abort, wait, and exit handlers run only when a selected step is an end step, one no other step depends on.
  • Only skipped steps that a selected step depends on, directly or through others, carry outputs. Without --outputs-from or --output-from, a ${steps.<id>.outputs.<name>} reference to a skipped step stays unresolved.
  • --outputs-from copies that run's work directory and the outputs of steps that succeeded in it. --output-from names the run of one step, which must have succeeded there; it wins over --outputs-from for that step, and the step cannot also be in --only.
  • A skipped step that changed since its source run (the step, a step it depends on, the parameters, the profile, the base config, or top-level settings) is refused with what changed. --allow-changed reuses it anyway and records the change.
  • --only does not combine with --from-run-id and is not supported for agent DAGs. Retrying a failed --only run follows normal retry rules; use dagu retry --step to rerun one step. See Running One Step.
  • --reuse-from reuses a step when its definition, the rest of the DAG, the base config, the parameters, the profile, and its upstream steps match that run, and it succeeded there or carried outputs into it. Every other step runs, with the steps after it and the steps that share its browser. It does not combine with --only, --outputs-from, --output-from, --output, or --from-run-id.
  • --node does not combine with --only or --from-run-id. A node: required DAG takes exactly one --node.

enqueue ​

Add a run to its queue. The scheduler starts it when the queue has room.

bash
dagu enqueue [flags] <DAG> [-- PARAMS...]
FlagDescription
-u, --queueQueue to use instead of the DAG's queue
-p, --params, --params-stdinParameters, as for start
-r, --run-idRun ID for the queued run
-N, --nameOverride the DAG name
--profileRuntime profile applied when the run starts
--scheduled-atSchedule slot, as for start
--labelsExtra labels (--tags is a deprecated alias)
--no-reuseRecompute build steps when the run starts
--nodeNarrow the run to this node; repeatable
--worker-labelWorker label the run requires; repeatable
--default-working-dirWorking directory for a DAG without working_dir
bash
dagu enqueue --run-id batch-001 etl.yaml -- TYPE=daily
dagu enqueue --queue high-priority etl

Like start, it fails for a service DAG that has an active run.

exec ​

Run a single command as a DAG run, with logs and history, without writing a YAML file.

bash
dagu exec [flags] -- <command> [args...]
FlagDescription
-N, --nameDAG name (default: exec-<command>)
-r, --run-idRun ID
-E, --envEnvironment variable KEY=VALUE; repeatable
--dotenvDotenv file to load; repeatable
--workdirWorking directory (default: the current directory)
--shellShell binary for the command
--baseBase DAG YAML whose defaults apply first
--worker-labelWorker label (key=value) for distributed execution; repeatable
bash
dagu exec --env DB_HOST=localhost -- python etl.py

dry ​

Plan a run and print what would happen, without executing any step.

bash
dagu dry [flags] <DAG> [-- PARAMS...]
FlagDescription
-p, --paramsParameters, as for start
-N, --nameOverride the DAG name
--profileRuntime profile to plan with
--scheduled-atPlan the run of a schedule slot, including a future one, and print the slot and its window
--no-reusePlan a build run with reuse turned off
-f, --formattext (default) or json
bash
dagu dry etl.yaml -- DATE=2026-01-01
dagu dry --scheduled-at 2026-11-30 etl

For a DAG with dates, the text output also lists the dates the slot's run loads.

stop ​

Stop the active runs of a DAG, or one run by ID.

bash
dagu stop [-r <run-id>] <DAG>
FlagDescription
-r, --run-idRun to stop. Without it, every active run of the DAG stops
bash
dagu stop etl
dagu stop --run-id 0358hGcngBQM7KuBv8W6h3 etl

With --run-id, it also cancels a pending automatic retry of that run. A root run that waits for an approval or a human task ends as aborted, and its unstarted steps do not run. A retry of it opens its human tasks again.

restart ​

Stop a running run and start it again with a new run ID.

bash
dagu restart [flags] <DAG name>
FlagDescription
-r, --run-idRun to restart (default: the DAG's running run)
--scheduled-atSlot for the new run (default: the slot of the restarted run)
bash
dagu restart --run-id 0358hGcngBQM7KuBv8W6h3 etl

A DAG with restart_policy: always or unless-stopped is refused, because the scheduler starts its runs. Stop the active run instead. See Services.

retry ​

Run a finished run again under the same run ID. Steps that failed, were aborted, or were rejected run again with every step after them; succeeded steps keep their results.

bash
dagu retry --run-id <run-id> [flags] <DAG>
FlagDescription
-r, --run-idRun to retry (required)
--stepRetry only this step
--downstreamWith --step: also retry the steps after it
-s, --sub-run-idWith --step: the child run that holds the step, to retry a step inside a sub-DAG
--bypass-preconditionsWith --step: skip step preconditions for the retried steps. Local context only
--default-working-dirWorking directory for a DAG without working_dir
bash
dagu retry --run-id 0358hGcngBQM7KuBv8W6h3 etl
dagu retry --run-id 0358hGcngBQM7KuBv8W6h3 --step upload --downstream etl
  • A retry keeps the original run's profile and takes no --profile.
  • --bypass-preconditions applies to this retry only. DAG-level preconditions, handlers, and the steps inside child DAGs keep their checks. Use it when a step's precondition, such as a time window, no longer holds.
  • A retried step with nodes runs again only on the nodes that did not succeed. See Retry Failed Nodes.
  • For a service DAG, it fails while another run is active.

dequeue ​

Remove a queued run, or the oldest item of a queue.

bash
dagu dequeue [--dag-run <dag>:<run-id>] <queue>
FlagDescription
-d, --dag-runThe run to remove, as <dag-name>:<run-id>. Without it, the oldest queued item is removed
bash
dagu dequeue default --dag-run etl:batch-001

The removed run is recorded as aborted.

backfill ​

Run a scheduled DAG once for each past slot that needs a run, oldest first. The scheduler starts the runs through the DAG's queue. See Backfill.

bash
dagu backfill start <DAG> --from <time> [--to <time>] [--by <entry>]
dagu backfill start <DAG> --slot <time> [--slot <time>...]
dagu backfill ls [<DAG>]
dagu backfill status <id> [--watch] [--format text|json]
dagu backfill cancel <id> [--stop-running]
dagu backfill resume <id> [flags]
SubcommandWhat it does
startPlan the backfill, print the plan, and start it once confirmed
lsList backfills, oldest first, with their status and slot count
statusShow each slot's state and run, and why an open backfill makes no progress. --watch follows it and exits 0 only when it succeeds
cancelWithdraw queued runs and cancel unreached slots. --stop-running also stops running ones
resumePlan the slots that have not succeeded again, with the current definition, and run them

start flags:

FlagDefaultDescription
--fromrequired without --slotFirst slot, inclusive: a date, a time (2006-01-02T15:04), or RFC 3339
--tonowLast slot, inclusive
--byA dates entry; --from and --to then name its dates instead of fire times
--slotOne slot to run; repeatable. Excludes --from, --to, and --rerun
--rerunnoneSlots that already have a run to run again: none, failed, or all
--max-concurrency1Runs of the backfill at once
--on-failurestopstop or continue after a slot fails
--params, --profilethe DAG'sParams and runtime profile for every run
--dry-runPrint the plan and start nothing
--formattexttext or json
-y, --yesStart without asking. Required without a terminal

resume takes --max-concurrency, --on-failure, --dry-run, --format, and --yes; omitted values keep the backfill's.

bash
dagu backfill start etl --from 2026-10-02 --to 2026-11-01
dagu backfill start etl --from 2026-10-02 --rerun failed --dry-run
dagu backfill start etl --slot 2026-10-05T02:00 --slot 2026-10-09T02:00 --yes

human-task complete ​

Complete a waiting human.task step. The run is queued to resume when the completion unblocks a step or no other manual steps wait.

bash
dagu human-task complete --run-id <run-id> --step <step-id> [flags] <DAG name>
FlagDescription
-r, --run-idRoot run that holds the task (required)
--stepStep id of the task (required)
--inputInput as key=value, coerced by the form schema; repeatable
--inputs-jsonInputs as one JSON object with typed values
bash
dagu human-task complete --run-id release-42 --step release_review \
  --input environment=production --input replicas=3 release
  • --input and --inputs-json exclude each other. Without either, an empty object is submitted.
  • The run is always queued, never started at once, so keep the scheduler running. The run itself may have executed on a distributed worker.
  • Human tasks are not supported in sub-DAGs. See Completing a Task for validation and recovery.

human-task push-back ​

Send a waiting task that declares with.push_back back to its rewind target with feedback. The target and every step after it run again, then the task opens again. See Requesting Changes.

bash
dagu human-task push-back --run-id <run-id> --step <step-id> [flags] <DAG name>
FlagDescription
-r, --run-idRoot run that holds the task (required)
--stepStep id of the task (required)
--input, --inputs-jsonFeedback, validated against with.push_back.form, up to 16 KiB as JSON
--expected-iterationFail unless the task is at this push-back iteration (0 before the first)
bash
dagu human-task push-back --run-id review-42 --step review \
  --input feedback="Add a case for empty input" --expected-iteration 0 review-loop

The command prints Pushed back human task <step> to <target>; and whether the run was queued. The push-back is saved before the run is queued, so if queueing fails, run the same command again.

Inspect Runs and DAGs ​

status ​

Show a run's status, steps, log paths, and the tail of each step's output.

bash
dagu status [flags] <DAG>
FlagDescription
-r, --run-idRun to show (default: the latest)
-s, --sub-run-idA sub-DAG run of --run-id
--recursive-outputExpand each sub-DAG run with its steps and output
bash
dagu status hello
text
Succeeded - 2026-12-04T15:15:04.416+09:00

dag: hello (151ms)
├─log: ~/.dagu/logs/hello/dag-run_.../dag-run_....log
│
├─hello (60ms) [succeeded]
│ ├─echo "Hello from Dagu!"
│ │
│ └─stdout: ~/.dagu/logs/hello/dag-run_.../hello....out
│     Hello from Dagu!
│
└─step_2 (29ms) [succeeded]
  ├─echo "Running step 2"
  │
  └─stdout: ~/.dagu/logs/hello/dag-run_.../step_2....out
      Running step 2

Result: Succeeded

A step that calls a sub-DAG lists each child run as subdag: <run-id>. --recursive-output expands up to 5 levels, 20 failed children, and 30 others, failed first; a notice after the tree counts the rest and prints the --sub-run-id command that shows one.

history ​

List past runs, newest first, with filters and export formats.

bash
dagu history [flags] [DAG name]
FlagDescription
--lastRelative period such as 24h, 7d, or 1w (default: the last 30 days)
--from, --toUTC range, as 2006-01-02 or 2006-01-02T15:04:05Z. Not with --last
--statusOne status or a comma-separated list: running, succeeded, failed, aborted, queued, waiting, rejected, not_started, partially_succeeded. Aliases: success, failure, canceled
--run-idRun ID, partial match
--labelsLabel filter, comma-separated with AND logic: key, key=value, globs, and ! to negate. See Label Filters
-f, --formattable (default), json, or csv
-l, --limitMost results (default 100, max 1000)
bash
dagu history etl --status failed,aborted --last 7d
dagu history --labels 'critical,!env=dev' --format csv --limit 500 > runs.csv
text
DAG NAME       RUN ID                  STATUS     STARTED (UTC)        DURATION  PARAMS
report-weekly  0358hGcngBQM7KuBv8W6h3  Failed     2026-12-04 06:23:30  < 1s      ARCHIVE=no
hello          0358h3mwbnYllsoYTjgbkm  Succeeded  2026-12-04 06:15:04  < 1s      -

Run IDs are never truncated. JSON output has name, dagRunId, status, startedAt, finishedAt, duration, and workerId, plus params, labels, and error when set. CSV follows RFC 4180.

ps ​

List runs on this host whose process has a fresh heartbeat.

bash
dagu ps [flags]
FlagDescription
-d, --dagExact DAG name
-r, --run-idRun ID, partial match
-f, --formattable (default) or json
bash
dagu ps --dag etl

The table has DAG, RUN_ID, ATTEMPT, STARTED (UTC), GROUP, and FRESH. The group is the DAG's queue, or the DAG name when it has none.

ls ​

List the DAG definitions in the DAGs directory. A pattern filters by a substring of the name or file name.

bash
dagu ls [flags] [pattern]
FlagDescription
-n, --nextShow the next scheduled run, and sort by it
--local-timeShow the next run in the configured time zone instead of UTC
-l, --lastShow the latest run's status and start time
-H, --historyShow the five most recent statuses
-t, --sort-lastSort by latest run, newest first
-r, --reverseReverse the sort
bash
dagu ls -n -l nightly

NEXT_RUN shows the scheduler's projection. It is - for a suspended DAG, a schedule inactive for the DAG's default profile, and every DAG while the scheduler is paused.

validate ​

Check DAG files for structure and reference errors without running them or evaluating variables.

bash
dagu validate [flags] <file, DAG name, or directory>...
FlagDescription
-v, --verboseAlso print notes, such as dependencies inferred from output references
--show-unresolvedAlso report references whose value exists only during a run
-q, --quietPrint errors only
bash
dagu validate workflows/
text
ERROR  workflows/cleanup.yaml: Step "prune": unknown field "depnds". Did you mean "depends"?
WARN   workflows/legacy.yaml: Step "fetch": command is deprecated. Use run.

DAGs: 2 valid, 1 invalid, 1 with warnings
  • A valid file with nothing to report prints nothing. Output goes to stderr.
  • A directory validates the DAG files the server loads from it, following dag_discovery, and the child DAGs they call by name. Test files are skipped.
  • Exit code: 0 when every file is valid, 1 when one is invalid, 2 for invalid arguments.

test ​

Run workflow tests: each case runs the DAG through the same runner as start, with step actions replaced by mocks, in a temporary directory.

bash
dagu test [flags] [<test file, DAG file, DAG name, or directory>...]
FlagDescription
--runRun only cases whose name matches this RE2 expression
--timeoutLongest a case may run (default 5m)
-f, --formattext (default), json, or junit
--keepKeep each case directory and print its path
-v, --verboseAlso print default mocks, automatic approvals, and notifications
--initWrite a test file for the one DAG file given, instead of running tests. See Generate a Test File
--updateRerun the cases and rewrite their expected results. See Update Expectations
bash
dagu test workflows/
dagu test --init workflows/release.yaml
dagu test --format junit workflows/ > dagu-test.xml
  • A DAG file or name runs the .test.yaml or .test.yml file beside it. A directory runs every test file under it and also loads each DAG without tests, so a DAG that fails to load fails the command. Without arguments, the DAGs directory is used.
  • Exit code: 0 when every case passed, 1 when a case failed, 2 when a test file, case, DAG without tests, or argument is invalid. With --update, a test file edited during the run is left unwritten and the command exits 1.
  • See Running Tests in CI.

calendar ​

Check business calendars in paths.calendars_dir and preview the runs they allow.

bash
dagu calendar check [calendar files...]
dagu calendar fires [--from <RFC 3339 time>] [--count <n>] <DAG>

check validates every <name>.yaml calendar, or the files given, and exits non-zero when one is invalid:

text
ok   jp-banking: 2 holidays, through 2027-12-31
FAIL ops: [1:17] field 'weekdays[1]': unknown day FUN; use MON, TUE, WED, THU, FRI, SAT, or SUN
Error: 1 of 2 calendars are invalid

fires lists the next fires of a DAG's start schedules (default 10), with the business day each matched and the holidays it skipped. For a DAG with dates, a DATES column shows each run's dates. --from sets where the list starts and may be in the past.

bash
dagu calendar fires payroll --from 2027-01-01T00:00:00+09:00 --count 20

To check that the DAGs naming a calendar find it, run dagu validate on them.

Run the Server ​

start-all ​

Run the Web UI, the scheduler, and the coordinator in one process. This is how the installers and the container image run Dagu.

bash
dagu start-all [flags]
FlagDescription
-s, --hostWeb UI bind address (default 127.0.0.1)
-p, --portWeb UI port (default 8080)
-d, --dagsDAGs directory
--coordinator.hostCoordinator bind address (default 127.0.0.1)
--coordinator.portCoordinator gRPC port (default 50055)
--coordinator.advertiseAddress workers use to reach the coordinator (default: the host name)
--peer.*Peer TLS settings, as for coordinator
bash
dagu start-all --host 0.0.0.0 --port 8080 --dags ./workflows
DAGU_COORDINATOR_ENABLED=false dagu start-all   # without the coordinator

The coordinator listens on 127.0.0.1 by default. Bind it with --coordinator.host 0.0.0.0 for workers on other hosts. Set coordinator.enabled: false to run without it.

server ​

Run the Web UI and REST API without the scheduler. Scheduled runs need a separate scheduler.

bash
dagu server [flags]
FlagDescription
-s, --hostBind address (default 127.0.0.1)
-p, --portPort (default 8080)
-d, --dagsDAGs directory
-t, --tunnelTurn on tunnel mode for remote access
--tunnel-tokenTailscale auth key for headless sign-in
--tunnel-httpsUse HTTPS on Tailscale (HTTPS must be enabled in the Tailscale admin console)
--tunnel-funnelExpose the server to the internet with Tailscale Funnel
bash
dagu server --host 0.0.0.0 --port 9000

scheduler ​

Run the scheduler in the foreground. It starts runs on their schedules and drains the queues.

bash
dagu scheduler [-d <dags-dir>]
FlagDescription
-d, --dagsDAGs directory

coordinator ​

Run the coordinator gRPC server that hands runs to distributed workers.

bash
dagu coordinator [flags]
FlagDescription
--coordinator.hostBind address (default 127.0.0.1)
--coordinator.portgRPC port (default 50055)
--coordinator.advertiseAddress to register for workers (default: the host name)
--coordinator.health-portHTTP port for GET /health (default 8091; 0 turns it off)
--peer.cert-file, --peer.key-fileTLS certificate and key
--peer.client-ca-fileCA that verifies worker certificates (mutual TLS)
--peer.ca-cert-file, --peer.ca-key-filePeer CA for built-in TLS, from peer init
--peer.insecureHow this process calls a coordinator: true h2c only, false TLS only. Unset tries built-in TLS when its CA is known, else h2c
--peer.skip-tls-verifySkip certificate verification
bash
dagu coordinator --coordinator.host 0.0.0.0 --coordinator.advertise dagu-server
dagu coordinator --peer.cert-file server.pem --peer.key-file server-key.pem --peer.client-ca-file ca.pem

Workers poll the coordinator for runs that match their labels, send heartbeats, and report status, logs, and artifacts over gRPC. Coordinators that workers fail over between must share server state. --peer.insecure does not change what the coordinator serves; set coordinator.require_tls: true to refuse h2c. See Distributed Transport Security. start-all has no separate coordinator health port.

worker ​

Run a worker that takes runs from coordinators.

bash
dagu worker [flags]
FlagDescription
--worker.coordinatorsCoordinator addresses, host1:port1,host2:port2
--worker.inviteInvite from Add worker or worker invite, to join over built-in TLS
-l, --worker.labelsLabels for matching, key=value,.... Lowercased; an invalid label stops the worker
--worker.idWorker ID (default hostname@PID)
--worker.max-active-runsMost runs at once (default 100)
--worker.health-portHTTP port for GET /health and GET /ready (default 8092; 0 turns it off)
--worker.shutdown-timeoutHow long a stopping worker lets runs finish before canceling them (default 60s; 0 waits)
--checkCheck the connection to each coordinator and exit
--peer.*TLS settings, as for coordinator, without --peer.ca-key-file
bash
dagu worker --worker.coordinators 192.168.1.20:50055 --worker.invite 'dagu1.<pin>.<secret>'
dagu worker --worker.coordinators coordinator-1:50055 --worker.labels gpu=true,region=us-east-1

GET /ready answers 503 until the first heartbeat succeeds. --check registers nothing and exits 0 when every coordinator passes; see Check Worker Connections.

worker invite ​

Create an invite for a worker on another host and print the command to run there.

bash
dagu worker invite --address <host:port> [--reusable] [--expires <duration>]
FlagDescription
--addressThe host:port workers dial (required). See The Address Rule
--reusableLet any number of workers join with the invite (default: single use)
--expiresLifetime such as 72h (default: 24h for single use, none for reusable)
text
$ dagu worker invite --address 192.168.1.20:50055
Invite (single use, expires 2026-11-29T07:48:19Z):
  dagu1.<pin>.<secret>
Run on the worker host:
  dagu worker --worker.coordinators=192.168.1.20:50055 --worker.invite=dagu1.<pin>.<secret>

The invite is printed only once. The command calls the coordinators with the peer token, so run it on a host that has the coordinator's peer.token. When a coordinator cannot yet accept workers from other hosts, it prints the change to make and exits 1. See Add Workers With Invites.

peer init ​

Create a peer CA and a peer token for coordinators that share one CA, such as replicas in Kubernetes.

bash
dagu peer init --out <dir>

It writes ca.crt, ca.key, and token, and prints their paths. Set peer.ca_cert_file, peer.ca_key_file, and peer.token on the coordinators, and peer.ca_cert_file and peer.token on other peer processes. It needs no configuration or running server, and writes nothing when one of the files exists. See Processes on Another Host.

Manage an Installation ​

context ​

Manage the remote contexts the CLI can target.

bash
dagu context list
dagu context add <name> --server <url> [flags]
dagu context update <name> [flags]
dagu context use <name|local>
dagu context test <name|local>
dagu context remove <name>
Flag (add, update)Description
--serverAPI base URL, such as https://dagu.example.com/api/v1
--api-keyAPI key. In a terminal, add asks for it when omitted
--descriptionText shown by context list
--timeoutHTTP timeout in seconds
--skip-tls-verifySkip certificate verification
bash
dagu context add prod --server https://dagu.example.com/api/v1 --timeout 60
dagu context test prod

add and use change only local settings; test checks the URL, the key, and the network.

config ​

Print the paths Dagu resolves, or every setting with its value and source.

bash
dagu config [--values [--format table|json]]
FlagDescription
--valuesPrint each setting that has an environment variable, with its value and source: default, file, or env:<NAME>. Secrets are masked
-f, --formatWith --values: table (default) or json
text
$ dagu config --dagu-home ~/.dagu
Base config:              ~/.dagu/base.yaml
DAGs directory:           ~/.dagu/dags
Wiki directory:           ~/.dagu/dags/wiki
DAG runs:                 ~/.dagu/data/dag-runs
DAG-run work directory:   ~/.dagu/data/dag-run-work
Data directory:           ~/.dagu/data
...

Values are shown before Dagu derives its own, so a derived setting can be empty. See Check Effective Settings.

profile ​

Manage runtime profiles in this host's data directory. For a remote server, use Profiles in the Web UI or the REST API.

SubcommandWhat it does
listList profiles
show <profile>Show a profile and its entries, with secrets masked
create <profile>Create a profile. --description sets its text; --protected marks it protected
enable <profile>, disable <profile>Allow or block new runs with the profile
delete <profile>Delete a profile
set-var <profile> <key> <value>Set a plain variable
set-secret <profile> <key>Set or rotate a secret. --value-stdin reads the value from stdin
delete-key <profile> <key>Delete one entry
bash
dagu profile create prod --description "Production settings" --protected
printf '%s\n' "$PROD_API_TOKEN" | dagu profile set-secret prod API_TOKEN --value-stdin

secret ​

Print the value of a secret ref from this host's data directory.

bash
dagu secret resolve <ref> [--workspace <name>]
FlagDescription
--workspaceLook in this workspace first, then Global, as a run does (default: Global)
bash
export OPENAI_API_KEY="$(dagu secret resolve prod/openai-api-key)"

The value is printed without a trailing newline. The command fails for an unknown workspace and for a disabled, missing, or empty secret. With audit logging on, each read is recorded, and the value is not printed if the entry cannot be written. The Web UI and REST API never return secret values.

nodes ​

Manage node inventories and see the workers that set worker.id.

SubcommandWhat it does
list [--labels <sel>] [--inventory <name>]Nodes in name order, with inventory defaults applied. Columns NAME, INVENTORY, KIND, HOST, LABELS, STATUS
show <name>One node with its inventory, labels, and connection settings
add <name> --host <host>Add a node. It tests the connection first and asks before trusting an unknown host key
remove <name>Remove a node and forget its trusted host key
forget <name>Forget an offline worker node until it connects again
test [<name>...] [--labels <sel>]Test host key, authentication, and true on each node; exits non-zero when one fails
import <file> [--replace] [--dry-run]Import a JSON array of inventories. --replace replaces those with the same name, keeping their IDs
export [--inventory <name>]Print inventories as a JSON array, without IDs
Flag (add)Description
--hostHost name or IP address (required)
--inventoryInventory name or ID; optional when there is one
--port, --userSSH port and user (default: the inventory's, port 22)
--key or --key-secretPrivate key path, or the secret ref of the key
--password-secret, --passphrase-secretSecret refs of the password and the key passphrase
--bastionNode of the same inventory to connect through
--labels, --descriptionLabels (key or key=value, comma-separated) and description
--no-testAdd without testing the connection

list and show take -f, --format table|json. A --labels selector is comma-separated with AND logic, such as site=tokyo,web,!canary.

bash
dagu nodes import inventories.json --dry-run
dagu nodes add tokyo-web03 --inventory "Tokyo production" --host 10.0.1.13 --labels web
dagu nodes test --labels web

With a remote context, add and test connect from the server, and add --key needs a path the server can read. Forgetting a worker node there needs the admin role.

sync ​

Pull and publish DAGs, Wiki pages, calendars, and other files tracked by Git Sync. Requires git_sync.enabled: true.

SubcommandWhat it does
statusRepository, branch, last sync, counts per state, and the items not in sync
pullPull from the remote. Unchanged local items deleted remotely are removed; locally edited ones become conflicts
publish <item> | --allCommit and push an item, or every modified and untracked item. -m sets the message; -f, --force publishes over a conflict
discard <item>Throw away local changes to an item
forget <item>...Drop state entries of missing, untracked, or conflicting items. Files are not touched
cleanupDrop every missing entry from the state. Files are not touched
delete <item> | --all-missingDelete items from the remote, the disk, and the state. Untracked items cannot be deleted; use forget
mv <old> <new>Rename an item locally and in the remote. Both must be the same kind

discard, forget, cleanup, delete, and mv take -y, --yes to skip confirmation. cleanup, delete, and mv take --dry-run; delete and mv take -m and --force.

bash
dagu sync status
dagu sync publish wiki/operations/runbook -m "Update runbook"
dagu sync publish --all -m "Batch update"
dagu sync mv scripts/report.py scripts/render.py -m "Rename report script"

rm ​

Delete a DAG's run history, its YAML definition, or both. Pass at least one of --history and --definition.

bash
dagu rm [flags] <DAG>
FlagDescription
-H, --historyDelete run history, with each run's logs and artifacts
-d, --definitionDelete the YAML definition, by file name, stem, or path
-t, --older-thanWith --history: only runs older than 10d, 24h, 1w, and so on (default: all)
--dry-runList what would be deleted
-f, --forceSkip the confirmation prompt. --quiet does not skip it
bash
dagu rm --history --older-than 30d --dry-run etl
dagu rm -H -d etl.yaml

Active runs are kept. Deleting a definition is refused while the DAG has an active run. Deleting all history, without --older-than, also clears the DAG's browser, computer, and xlsx replay caches on this host.

prune-artifacts ​

Delete artifact directories and index records that no remaining run points to, such as those left after run records were deleted another way.

bash
dagu prune-artifacts [flags]
FlagDescription
-t, --older-thanOnly entries older than this (default 24h; at least 1h is enforced)
--rootArtifact root to prune (default paths.artifact_dir), such as an old <data_dir>/artifacts or a DAG's artifacts.dir. Roots that hold run history or logs are refused
--dry-runList what would be removed
-y, --yesSkip the confirmation prompt
bash
dagu prune-artifacts -t 7d --dry-run

cleanup ​

Deprecated alias for rm --history. It does not clear the replay caches that rm clears.

bash
dagu cleanup [--retention-days <n>] [--dry-run] [-y] <DAG name>
cleanuprm equivalent
dagu cleanup etldagu rm --history etl
dagu cleanup --retention-days 30 etldagu rm -H --older-than 30d etl
dagu cleanup --dry-run etldagu rm -H --dry-run etl
dagu cleanup -y etldagu rm -H --force etl

license ​

Connect this server to Dagu Console, and activate, check, or remove its license.

bash
dagu license activate [key] [--report <level>] [--remote-access <role>]
dagu license check
dagu license deactivate
Flag (activate)Description
--reportWhat the server reports to Dagu Console: runs, errors, health, or off. Asked when omitted
--remote-accessHighest role MCP clients get through the Dagu Cloud MCP endpoint: off, viewer, operator, or developer. Unchanged when omitted
  • activate without a key prints a Console URL and a code, and waits up to an hour for a workspace owner to approve. Without a terminal, a key is required. See Connect a Server.
  • activate <key> exchanges a server key or license key from Dagu Console.
  • check prints the plan, features, expiry, workspace, server, and last check-in.
  • deactivate frees the server's slot and returns to community mode. When Console cannot be reached, it deactivates locally and prints the page to disconnect it.

activate and deactivate write to the data directory. Restart a running server to load the change, or use Plan & features in the Web UI, which applies it at once.

upgrade ​

Replace the dagu binary with the latest release, or a given version, after verifying its checksum.

bash
dagu upgrade [flags]
FlagDescription
--checkOnly report whether an update is available
-v, --versionVersion to install, such as v2.28.1
--dry-runShow what would happen
--backupKeep a copy of the current binary
--pre-releaseInclude pre-releases
-f, --forceAllow a downgrade
-y, --yesSkip prompts
bash
dagu upgrade --check
dagu upgrade

It refuses Homebrew, Snap, go install, and container installs and prints their upgrade command instead. When Dagu runs as the service an installer set up, it offers to restart the service; with --yes it prints the commands. See Restarting After an Upgrade.

version ​

Print the version.

text
$ dagu version
2.28.1

schema ​

Print the field reference for DAG files, the server configuration, calendar files, or workflow test files. A dotted path narrows it to one field.

bash
dagu schema <dag|config|calendar|test> [path]
bash
dagu schema dag steps.retry_policy
dagu schema config server
dagu schema test > workflow-test.schema.json

example ​

List the bundled example DAGs, or print one by number or name. Names stay stable; numbers can shift between releases.

bash
dagu example [number|name]
bash
dagu example
dagu example parallel-steps

completion ​

Print a shell completion script for bash, zsh, fish, or powershell. dagu completion <shell> --help shows how to load it.

bash
source <(dagu completion zsh)

Browser, Desktop, and Spreadsheet Tools ​

These commands work with the state that browser, computer, and xlsx steps keep on the host that ran them. In distributed mode, run them on the worker. To give a coding tool the CLI reference, install the dagu skill.

browser session ​

Work a site in a browser that stays open between commands, one operation at a time, then turn what worked into a browser step.

bash
dagu browser session open [flags] [URL]
echo '{"act": "Click the Sign in button"}' | dagu browser session do <id>
dagu browser session describe <id>
dagu browser session export --dag <dag> --step <id> <session-id>
dagu browser session close <id>

Every command prints one JSON object. A failed command prints {"error": {"code", "message"}} and exits 1. Sessions live on the host that runs the commands.

Error codes

invalid_input, session_not_found, session_busy, session_ended, model_required, profile_in_use, launch_failed, operation_failed, write_blocked, write_gate_lost (the write gate stopped, closing the browser), export_invalid, and failed.

browser session open ​

Open a browser, go to the URL if given, and wait for the session's commands.

FlagDescription
--provider, --model, --base-url, --api-key-nameModel for acts, extracts, and judged conditions. The key is read from the named environment variable, or the provider's usual one, on every command
--llmThe model as a step's llm field, in YAML or JSON, such as '{provider: openai, model: gpt-5-mini}'
--profileKeep cookies and storage under this profile, shared with browser steps that name it
--headedShow the browser window
--viewportPage size as WIDTHxHEIGHT
--executable, --proxyChrome binary and proxy, as in a step's browser options
--allowed-domainKeep the browser on this host or *.domain; repeatable
--idle-timeoutClose the browser after this long without a command (default 30m, at most 24h)
--outline-charsMost characters of the page outline (default 4000; 0 leaves it out)
--write-gateWrite gate mode. The flag can only tighten the host's browser.write_gate
--write-policyWrite policy file naming the sign-in endpoints whose writes are sent
bash
dagu browser session open --provider openai --model gpt-5-mini https://portal.example.com

The result has the session id, the page url, title, and outline, and cdp_url, the browser's DevTools address, where an application can show the page to a person. Without a model, only operations that need none run.

  • With --write-gate rehearse, every write the page sends is blocked and reported under writes. With record, writes are blocked unless the do command allows the signature with --allow-write; a blocked write fails with write_blocked.
  • Sessions use the host's browser.client_certificates and browser.trusted_cas. tls_verified is true when the certificate proxy verified the final HTTPS host, and false when no result is available; check warnings then.
  • A page the site refused is reported as refused, with the host, HTTP status, bot_check (such as cloudflare), and a message.

browser session do ​

Read one operation from stdin, in JSON or YAML, and run it.

FlagDescription
--outline-charsMost characters of the page outline (default 4000)
--allow-writeIn a record session, let the operation send the write of this signature; repeatable

The operation is written like an item of a browser step's with.do: goto, act, upload, extract, expect, wait, or screenshot, with when and timeout. Give an act's variables under variables:

json
{"act": "Type %password% into the Password field",
 "variables": {"password": {"env": "PORTAL_PASSWORD"}}}
  • A variable given as {"env": NAME} is read from the environment on this and every later command, and masked like a secret. A plain string serves this command only. Values are never kept.
  • An element the outline shows with its ID can be used without the model: {"click": "0-131"}, {"type": {"into": "0-229", "text": "%user%"}}, {"select": {"in": "0-106", "option": "Pending"}}, or {"upload": {"into": "0-57", "files": "/path/to/invoice.pdf"}}. The session keeps it as an act in words, such as Click the "Sign in" button.
  • The result reports the operation's index, its status (done, failed, or skipped), the actions performed and whether an export replays them (recorded), outputs, saved files, writes, tokens, and the next page's outline. A failed operation exits 1; the session stays open.
  • An allowed write sends the values the form holds at that moment, so check them first.

browser session describe ​

Report what the page shows, without asking a model.

FlagDescription
--findOnly outline entries containing this text, with their parents
--max-charsMost characters of the outline (default 8000)
--treeReport the accessibility tree the model sees instead of the outline
--screenshotAlso save a screenshot under this name
-f, --formatjson (default) or text

The outline lists headings, labeled fields, selects with their options, file inputs, buttons, checkboxes, links, messages, and tables by columns and rows, the page's own content first. Each element do can target shows its ID in brackets. Text typed into fields is never shown.

browser session export ​

Build a browser.run step from the operations the session ran.

FlagDescription
--dagDAG the step goes in, by name or file path (required)
--stepID of the step (required)
--skipLeave out the operation with this index; repeatable
--dry-runBuild the step without writing its recordings
--closeClose the session afterwards
-f, --formatjson (default), or yaml for the step alone

The step keeps the operations that succeeded or were skipped by when, in order. An environment variable becomes ${NAME}, which the DAG declares under its secrets; a literal becomes a parameter. The recordings go into the step's replay cache, so its first run replays them without the model. An upload keeps the session's files until you point files at what each run uploads. A closed session can still be exported for a day.

browser session close ​

bash
dagu browser session close [--force] [--keep] <id>

Close the browser and delete the session. --force closes it while another command holds it. --keep ends it but keeps its history for export for a day.

browser session gate ​

bash
dagu browser session gate (--person | --guard) <id>

--person tells the write gate a person holds the browser, in a --headed window or through cdp_url, so their writes are sent and still reported. --guard returns the session to its write gate mode.

browser session list ​

List this host's sessions, oldest first, after closing those idle past their timeout. Each has a state: idle, busy, or ended.

json
{"sessions": [], "capabilities": ["trusted_cas", "write_gate"]}

capabilities names features this build supports: trusted_cas for private CAs and tls_verified, and write_gate for the write gate flags and writes results.

browser writes ​

List, approve, and revoke the commit points of a DAG's browser steps, the writes a step behind the write gate may send. Each command prints JSON.

bash
dagu browser writes list [--step <id>] <DAG>
dagu browser writes approve [flags] <DAG>
dagu browser writes revoke [flags] <DAG>
FlagDescription
--stepOnly this step, by ID, or by name when it has no ID
--signatureapprove, revoke: only this write signature; repeatable
--from-dagapprove: copy the commit points of another DAG, such as the copy a rehearsal ran as, into steps of the same name, and approve them
bash
dagu browser writes approve books --from-dag books-trial

browser cache clear ​

Forget the recorded act and upload operations that browser steps replay, so the next run asks the model again.

bash
dagu browser cache clear [--step <id>] <DAG>

Without --step, every step of the DAG is cleared.

computer check ​

Check that computer steps can capture the screen and send input. Run it as the same user, in the same session, as the worker that runs them.

bash
dagu computer check [-f text|json]
text
System:  darwin
Display: 3024x1964 pixels
Ready:   computer steps can operate this desktop

When the desktop cannot be driven, it prints a Problem: line for each cause and exits non-zero. On macOS it also opens the Screen Recording and Accessibility prompts that are missing; grant both to the app that starts Dagu, such as Terminal. On Windows, the worker must run in a logged-in session, not as a service, with the screen unlocked.

JSON output and problem codes
json
{"os": "darwin", "width": 3024, "height": 1964, "ready": false,
 "problems": [{"code": "accessibility", "message": "Accessibility permission is missing; grant it in System Settings > Privacy & Security > Accessibility"}]}
CodeMeaning
unsupportedThe system is not macOS or Windows
load_failedThe macOS system frameworks could not be loaded
no_sessionNo graphical login session (macOS)
other_sessionAnother user's session has the display (macOS)
service_sessionThe process runs as a Windows service, in session 0
screen_lockedThe screen is locked, or a Windows secure prompt is shown
screen_recordingScreen Recording permission is missing (macOS)
accessibilityAccessibility permission is missing (macOS)
no_displayThe display size is unavailable
session_disconnectedThe Remote Desktop client disconnected, so the display does not draw (Windows)

width and height are 0 when the size is unknown.

computer elements ​

List the accessible elements of the front window, to find the role and name an exact check or a pinned step selects. Works on macOS, with the Accessibility permission, and on 64-bit Windows.

bash
dagu computer elements [flags]
FlagDescription
--at-pointerReport the element under the pointer instead
--afterWith --at-pointer, wait this long first, such as 3s
--watchReport the element under the pointer whenever it changes, one JSON line each, until stdin closes
--matchReport the elements a JSON selector matches (- reads it from stdin); succeed only when exactly one does
--limitMost elements to list (default 400)
-f, --formattext (default) or json
bash
dagu computer elements --match '{"role": "button", "name": "Save", "in": {"role": "group", "name": "Payment"}}'

Each element has role, name, id, value, label, bounds, window, and path; JSON also marks disabled elements and, on macOS, an empty field's placeholder. Errors use the codes invalid_input, unsupported, load_failed, no_elements, not_found, ambiguous, failed, or a computer check code.

computer cache clear ​

Forget the recorded act operations computer steps replay, so the next run asks the model again.

bash
dagu computer cache clear [--step <id> [--op <n>]] <DAG>

--step clears one step; --op with it forgets only the task at that position in with.do, counted from 1.

computer cache show ​

Show what a DAG's computer steps recorded on this host, written the way a step pins it: an act's recorded steps and an extract's fields, keyed by the system they were recorded on.

bash
dagu computer cache show [--step <id> [--op <n>]] [-f text|json] <DAG>
bash
dagu computer cache show invoices --step post --op 2
  • Newest recordings come first; a task recorded with other parameters has one per variant.
  • An action with no pinned form, such as a drag or a click near an element's edge, is listed with its reason instead.
  • An act that never used a variable its task names says so in a comment, because pinned it leaves that field as each run finds it.
  • JSON output is {"operations": [...]}, each with step, op, kind, system, saved_at, assumes, assumes_unknown, and recorded, fields, or unpinnable.

xlsx inspect ​

Describe every sheet of a workbook before writing xlsx steps for it, the same way xlsx.info does. Nothing is written and no run is created.

bash
dagu xlsx inspect <path> [flags]
FlagDescription
--sheetDescribe this sheet only
-n, --rowsTyped sample rows per sheet (default 5)
--passwordPassword of a protected workbook. Prefer DAGU_XLSX_PASSWORD, which stays out of the process list
-f, --formattext (default) or json
bash
dagu xlsx inspect orders.xlsx --sheet Orders --rows 10
cat orders.xlsx | dagu xlsx inspect - --format json

For each sheet it reports the used range, the data block, the header row and column names, row count, tables, and sample rows. Each column gets a type and a profile from up to 5,000 rows: filled and blank cells, distinct values, the range, and the cells that do not read as the column's type:

text
Columns: Status (string: done, open; 40 blank), Qty (number; 1..250; 1 odd: D300 "TBD")

- reads the workbook from stdin, up to 64 MiB. See Looking at a Workbook First for the JSON fields.

xlsx read ​

Print a sheet's rows the way xlsx.read publishes them: numbers stay numbers, dates become ISO 8601 text, text keeps leading zeros, and each row carries its sheet row number as _row.

bash
dagu xlsx read <path> [flags]
FlagDescription
--sheetSheet name (default: the first sheet)
--rangeCell range, Sheet!A2:F reference, named range, or table name
--headertrue (default), false, a row number, or rows such as 3,4
--columnsColumns to keep, comma-separated, with optional name:alias renames
--typesColumn types to pin, as name:type pairs or a JSON object: string, number, integer, boolean, date, datetime
--on-type-errorFor a cell that fails its type: fail (default), warn (read as null), or keep
--skip-hiddenLeave out hidden rows
--max-rowsMost rows to print (default 5000)
--passwordPassword of a protected workbook. Prefer DAGU_XLSX_PASSWORD
-f, --formattext (tab-separated, default) or json
bash
dagu xlsx read orders.xlsx --columns "Invoice No,Amount" --types "Amount:number" --format json

JSON output has rows, count, headers, sheet, range, warnings, and truncated. - reads the workbook from stdin, up to 64 MiB.

xlsx cache clear ​

Forget the cells an xlsx.extract step cached by sheet layout, so its next run asks the model again.

bash
dagu xlsx cache clear [--step <id>] <DAG>

It prints Removed xlsx replay cache for step "<step>" of DAG "<dag>" for each step cleared.

Home Directory ​

Set DAGU_HOME, or pass --dagu-home to one command, to keep every file under one directory. This isolates a second instance or a CI job:

bash
dagu --dagu-home /tmp/dagu-ci start etl.yaml
text
$DAGU_HOME/
├── config.yaml   # server configuration
├── base.yaml     # defaults shared by every DAG
├── dags/         # DAG files
├── data/         # run history, queues, and state
└── logs/         # run and admin logs

Settings resolve in this order: command-line flags, then environment variables, then the configuration file. Run dagu config to see the result. Every setting and its variable is in Configuration.

Dagu is open source under the GNU General Public License v3.0.