mirror of
https://github.com/dagucloud/dagu.git
synced 2026-12-05 05:32:51 +00:00
Add documentation for the new interactive DAG selection feature introduced
in commit 9706bb71. Users can now run `dagu start` without arguments to
open an interactive TUI for selecting and configuring DAGs.
Updates:
- Document interactive mode in CLI overview
- Add interactive examples to CLI reference
- Note enhanced progress display powered by Bubble Tea
Github-Issue:#1074
5.1 KiB
5.1 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 both scheduler and web UI.
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
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
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
Exit Codes
0- Success1- General error2- Invalid arguments3- DAG not found4- Validation failed5- Execution failed130- Interrupted (SIGINT)143- Terminated (SIGTERM)
Common Usage
# Development
dagu dry my-workflow.yaml # Validate
dagu start my-workflow.yaml # Run
dagu status my-workflow # Check
# Production
dagu start-all --host=0.0.0.0 # Start services
systemctl status dagu # Monitor
journalctl -u dagu -f # View logs
# Debugging
dagu status failed-workflow # Check failure
dagu retry --run-id=xyz failed # Retry run