7.4 KiB
CLI Reference
Commands accept either DAG names (from YAML name field) or file paths.
- Both formats:
start,stop,status,retry - File path only:
dry,enqueue - DAG name only:
restart
Global Options
dagu [global options] command [command options] [arguments...]
--config, -c- Config file (default:~/.config/dagu/config.yaml)--quiet, -q- Suppress output--cpu-profile- Enable CPU profiling--help, -h- Show help--version, -v- Print version
Commands
start
Run a DAG workflow.
dagu start [options] DAG_NAME_OR_FILE [-- PARAMS...]
Interactive Mode:
- If no DAG file is specified, opens an interactive selector
- Only available in terminal (TTY) environments
- Shows enhanced progress display during execution
Options:
--params, -p- Parameters as JSON--run-id, -r- Custom run ID--no-queue, -n- Execute immediately
# Basic run
dagu start my-workflow.yaml
# Interactive mode (no file specified)
dagu start
# With parameters (note the -- separator)
dagu start etl.yaml -- DATE=2024-01-01 ENV=prod
# Custom run ID
dagu start --run-id batch-001 etl.yaml
stop
Stop a running DAG.
dagu stop [options] DAG_NAME_OR_FILE
Options:
--run-id, -r- Specific run ID (optional)
dagu stop my-workflow # Stop current run
dagu stop --run-id=20240101_120000 etl # Stop specific run
restart
Restart a DAG run with a new ID.
dagu restart [options] DAG_NAME
Options:
--run-id, -r- Run to restart (optional)
dagu restart my-workflow # Restart latest
dagu restart --run-id=20240101_120000 etl # Restart specific
retry
Retry a failed DAG execution.
dagu retry [options] DAG_NAME_OR_FILE
Options:
--run-id, -r- Run to retry (required)
dagu retry --run-id=20240101_120000 my-workflow
status
Display current status of a DAG.
dagu status [options] DAG_NAME_OR_FILE
Options:
--run-id, -r- Check specific run (optional)
dagu status my-workflow # Latest run status
Output:
Status: running
Started: 2024-01-01 12:00:00
Steps:
✓ download [completed]
⟳ process [running]
○ upload [pending]
server
Start the web UI server.
dagu server [options]
Options:
--host, -s- Host (default: localhost)--port, -p- Port (default: 8080)--dags, -d- DAGs directory
dagu server # Default settings
dagu server --host=0.0.0.0 --port=9000 # Custom host/port
scheduler
Start the DAG scheduler daemon.
dagu scheduler [options]
Options:
--dags, -d- DAGs directory
dagu scheduler # Default settings
dagu scheduler --dags=/opt/dags # Custom directory
start-all
Start scheduler, web UI, and coordinator service.
dagu start-all [options]
Options:
--host, -s- Host (default: localhost)--port, -p- Port (default: 8080)--dags, -d- DAGs directory
dagu start-all # Default settings
dagu start-all --host=0.0.0.0 --port=9000 # Production mode
Note: This command now also starts the coordinator service for distributed execution.
dry
Validate a DAG without executing it.
dagu dry [options] DAG_FILE [-- PARAMS...]
dagu dry my-workflow.yaml
dagu dry etl.yaml -- DATE=2024-01-01 # With parameters
enqueue
Add a DAG to the execution queue.
dagu enqueue [options] DAG_FILE [-- PARAMS...]
Options:
--run-id, -r- Custom run ID--params, -p- Parameters as JSON
dagu enqueue my-workflow.yaml
dagu enqueue --run-id=batch-001 etl.yaml -- TYPE=daily
dequeue
Remove a DAG from the execution queue.
dagu dequeue --dag-run=<dag-name>:<run-id>
dagu dequeue --dag-run=my-workflow:batch-001
version
Display version information.
dagu version
migrate
Migrate legacy data to new format.
dagu migrate history # Migrate v1.16 -> v1.17+ format
coordinator
Start the coordinator gRPC server for distributed task execution.
dagu coordinator [options]
Options:
--coordinator.host- Host address to bind (default:127.0.0.1)--coordinator.port- Port number (default:50055)--peer.cert-file- Path to TLS certificate file for peer connections--peer.key-file- Path to TLS key file for peer connections--peer.client-ca-file- Path to CA certificate file for client verification (mTLS)--peer.insecure- Use insecure connection (h2c) instead of TLS (default:true)--peer.skip-tls-verify- Skip TLS certificate verification (insecure)
# Basic usage
dagu coordinator --coordinator.host=0.0.0.0 --coordinator.port=50055
# With TLS
dagu coordinator \
--peer.insecure=false \
--peer.cert-file=server.pem \
--peer.key-file=server-key.pem
# With mutual TLS
dagu coordinator \
--peer.insecure=false \
--peer.cert-file=server.pem \
--peer.key-file=server-key.pem \
--peer.client-ca-file=ca.pem
The coordinator service enables distributed task execution by:
- Automatically registering in the service discovery system
- Accepting task polling requests from workers
- Matching tasks to workers based on labels
- Tracking worker health via heartbeats (every 10 seconds)
- Providing task distribution API with automatic failover
- Managing worker lifecycle through file-based discovery
worker
Start a worker that polls the coordinator for tasks.
dagu worker [options]
Options:
--worker.id- Worker instance ID (default:hostname@PID)--worker.max-active-runs- Maximum number of active runs (default:100)--worker.labels, -l- Worker labels for capability matching (format:key1=value1,key2=value2)--peer.insecure- Use insecure connection (h2c) instead of TLS (default:true)--peer.cert-file- Path to TLS certificate file for peer connections--peer.key-file- Path to TLS key file for peer connections--peer.client-ca-file- Path to CA certificate file for server verification--peer.skip-tls-verify- Skip TLS certificate verification (insecure)
# Basic usage
dagu worker
# With custom configuration
dagu worker \
--worker.id=worker-1 \
--worker.max-active-runs=50
# With labels for capability matching
dagu worker --worker.labels gpu=true,memory=64G,region=us-east-1
dagu worker --worker.labels cpu-arch=amd64,instance-type=m5.xlarge
# With TLS connection
dagu worker \
--peer.insecure=false
# With mutual TLS
dagu worker \
--peer.insecure=false \
--peer.cert-file=client.pem \
--peer.key-file=client-key.pem \
--peer.client-ca-file=ca.pem
# With self-signed certificates
dagu worker \
--peer.insecure=false \
--peer.skip-tls-verify
Workers automatically register in the service discovery system, send regular heartbeats, and poll the coordinator for tasks matching their labels to execute them locally.
Configuration
Priority: CLI flags > Environment variables > Config file
Key Environment Variables
DAGU_HOST- Server host (default:127.0.0.1)DAGU_PORT- Server port (default:8080)DAGU_DAGS_DIR- DAGs directoryDAGU_LOG_DIR- Log directoryDAGU_DATA_DIR- Data directoryDAGU_AUTH_BASIC_USERNAME- Basic auth usernameDAGU_AUTH_BASIC_PASSWORD- Basic auth password