Skip to main content

dagster CLI

The dagster command-line interface provides tools for working with Dagster projects, including job execution, asset materialization, schedule management, and development workflows.

Installation

pip install dagster

Global Options

--version
flag
Show the installed Dagster version
--help
flag
Show help message and exit

dagster dev

Start a local development deployment of Dagster, including the webserver and daemon.
Superseded: This command is being replaced by dg dev. The dagster dev command will continue to work but consider migrating to the new CLI.

Usage

dagster dev [OPTIONS]

Options

--code-server-log-level
choice
default:"warning"
Set the log level for code servers spun up by dagster servicesChoices: critical, error, warning, info, debug
--log-level
choice
default:"info"
Set the log level for dagster servicesChoices: critical, error, warning, info, debug
--log-format
choice
default:"colored"
Format of the logs for dagster servicesChoices: colored, json, rich
--port
integer
Port to use for the Dagster webserverAliases: --dagit-port, -p
--host
string
Host to use for the Dagster webserverAliases: --dagit-host, -h
--live-data-poll-rate
string
default:"2000"
Rate at which the dagster UI polls for updated asset data (in milliseconds)
--use-legacy-code-server-behavior
flag
Use the legacy behavior of the daemon and webserver each starting up their own code server
-v, --verbose
flag
Show verbose stack traces for errors in the code server

Workspace Options

-w, --workspace
path
Path to workspace file. Argument can be provided multiple times
-f, --python-file
path
Path to a Python file containing Dagster definitions
-m, --module-name
string
Python module containing Dagster definitions
-d, --working-directory
path
Working directory to use when loading the repository or job
-a, --attribute
string
Attribute within the module or file that defines the Definitions object

Example

# Start development server with default settings
dagster dev

Output

Launching Dagster services...

Serving dagster-webserver on http://127.0.0.1:3000 in process 12345
Starting dagster-daemon in process 12346

Environment Variables

  • DAGSTER_HOME: Directory for Dagster instance configuration (dagster.yaml)
  • DAGSTER_IS_DEV_CLI: Automatically set to “1” when using dagster dev

dagster job

Commands for working with Dagster jobs.

dagster job list

List all jobs in a repository.
dagster job list [OPTIONS]

Example

dagster job list -f my_jobs.py

Output

Repository my_repo
******************
Job: daily_sales_job
Description:
    Process daily sales data and update reports
Ops: (Execution Order)
    load_data
    transform_data
    generate_report

dagster job print

Print detailed information about a job.
dagster job print [OPTIONS]

Options

--verbose
flag
Show detailed op information including inputs and outputs
-j, --job
string
Name of the job to print

Example

dagster job print -f my_jobs.py -j my_job

dagster job execute

Execute a job in the same Python environment.
Superseded: Use dg launch --job <job_name> instead for new projects.
dagster job execute [OPTIONS]

Options

-j, --job
string
Name of the job to execute
-c, --config
path
YAML or JSON file with run configuration. Can be specified multiple times
--tags
json
JSON string of tags to use for this job runExample: '{"team": "data", "priority": "high"}'
-o, --op-selection
string
Specify op subselection to executeExamples:
  • some_op - Execute only this op
  • *some_op - Execute this op and all ancestors
  • *some_op+++ - Execute this op, ancestors, and descendants within 3 levels
  • *some_op,other_op+ - Multiple selections

Example

dagster job execute -f jobs.py -j my_job

dagster job launch

Launch a job using the configured run launcher.
dagster job launch [OPTIONS]

Options

-j, --job
string
Name of the job to launch
-c, --config
path
YAML or JSON file with run configuration
--config-json
json
JSON string of run config (cannot be used with -c/—config)
--tags
json
JSON string of tags for the run
--run-id
string
Custom ID for the launched run
-o, --op-selection
string
Op subselection to execute

Example

dagster job launch -w workspace.yaml -j my_job -c config.yaml

dagster job scaffold_config

Generate a configuration scaffold for a job.
dagster job scaffold_config [OPTIONS]

Options

--print-only-required
flag
Only include required configuration fields

Example

dagster job scaffold_config -f jobs.py -j my_job

Output

ops:
  load_data:
    config:
      database_url: "<database_url>"
      table_name: "<table_name>"
  transform_data:
    config:
      transformation_type: "<transformation_type>"

dagster job backfill

Backfill a partitioned job.
dagster job backfill [OPTIONS]

Options

--partitions
string
Comma-separated list of partition names to backfill
--all
flag
Select all partitions to backfill
--from
string
Start partition for the backfill range
--to
string
End partition for the backfill range
--tags
json
JSON string of tags for the backfill runs
--noprompt
flag
Skip confirmation prompt

Example

dagster job backfill \
  -w workspace.yaml \
  -j daily_partitioned_job \
  --from 2024-01-01 \
  --to 2024-01-31

dagster asset

Commands for working with Dagster assets.

dagster asset materialize

Execute a run to materialize a selection of assets.
Superseded: Use dg launch --assets <selection> instead.
dagster asset materialize [OPTIONS]

Options

--select
string
required
Comma-separated asset selection to targetExamples:
  • my_asset - Single asset
  • my_asset* - Asset and all downstream dependencies
  • *my_asset - Asset and all upstream dependencies
  • tag:team=data - All assets with tag
--partition
string
Asset partition to target
--partition-range
string
Asset partition range in format <start>...<end>. Requires all assets to have BackfillPolicy.single_run() policyExample: 2025-01-01...2025-01-05
-c, --config
path
YAML or JSON file with run configuration
--config-json
json
JSON string of run config

Example

dagster asset materialize --select my_asset -f definitions.py

dagster asset list

List assets in a repository.
dagster asset list [OPTIONS]

Options

--select
string
Asset selection to filter the list

Example

dagster asset list -f definitions.py

Output

analytics/daily_sales
analytics/monthly_report
raw_data/customer_events

dagster asset wipe

Eliminate asset key indexes from event logs.
Warning: This operation cannot be undone. Use with caution.
dagster asset wipe [OPTIONS] [KEY]...

Options

--all
flag
Eliminate all asset key indexes
--noprompt
flag
Skip confirmation prompt

Example

dagster asset wipe my_asset_key

dagster asset wipe-partitions-status-cache

Clear the asset partitions status cache.
dagster asset wipe-partitions-status-cache [OPTIONS] [KEY]...

Options

--all
flag
Wipe partitions status cache of all asset keys
--noprompt
flag
Skip confirmation prompt

Example

dagster asset wipe-partitions-status-cache my_asset --noprompt

dagster run

Commands for working with Dagster job runs.

dagster run list

List runs in the current Dagster instance.
dagster run list [OPTIONS]

Options

--limit
integer
Limit the number of runs to display

Example

dagster run list

Output

Run: 1a2b3c4d-5e6f-7g8h-9i0j-k1l2m3n4o5p6
     Job: daily_pipeline
Run: 2b3c4d5e-6f7g-8h9i-0j1k-l2m3n4o5p6q7
     Job: weekly_report

dagster run delete

Delete a run by ID and its associated event logs.
Warning: This operation cannot be undone.
dagster run delete [OPTIONS] RUN_ID

Options

-f, --force
flag
Skip confirmation prompt

Example

dagster run delete 1a2b3c4d-5e6f-7g8h-9i0j-k1l2m3n4o5p6

dagster run wipe

Eliminate all run history and event logs.
Warning: This operation cannot be undone and will delete ALL runs.
dagster run wipe [OPTIONS]

Options

-f, --force
flag
Skip confirmation prompt

Example

dagster run wipe --force

dagster run migrate-repository

Migrate run history for a job from a historic repository to its current repository.
dagster run migrate-repository [OPTIONS]

Options

--from
string
required
Source repository in format <repository_name>@<location_name>
-j, --job
string
Name of the job to migrate

Example

dagster run migrate-repository \
  --from old_repo@old_location \
  -w workspace.yaml \
  -j my_job

dagster schedule

Commands for working with Dagster schedules.

dagster schedule list

List all schedules in a repository.
dagster schedule list [OPTIONS]

Options

--running
flag
Filter for running schedules only
--stopped
flag
Filter for stopped schedules only
--name
flag
Display only schedule names (no details)

Example

dagster schedule list -w workspace.yaml

Output

Repository my_repo
******************
Schedule: daily_refresh [RUNNING]
Cron Schedule: 0 0 * * *
**********************************
Schedule: weekly_report [STOPPED]
Cron Schedule: 0 0 * * 0

dagster schedule start

Start an existing schedule.
dagster schedule start [OPTIONS] [SCHEDULE_NAME]

Options

--start-all
flag
Start all schedules in the repository

Example

dagster schedule start daily_refresh -w workspace.yaml

dagster schedule stop

Stop a running schedule.
dagster schedule stop [OPTIONS] SCHEDULE_NAME

Example

dagster schedule stop daily_refresh -w workspace.yaml

dagster schedule restart

Restart a running schedule.
dagster schedule restart [OPTIONS] [SCHEDULE_NAME]

Options

--restart-all-running
flag
Restart all currently running schedules

Example

dagster schedule restart daily_refresh -w workspace.yaml

dagster schedule preview

Preview changes that will be performed by dagster schedule up.
dagster schedule preview -w workspace.yaml

dagster schedule logs

Get logs for a schedule.
dagster schedule logs SCHEDULE_NAME -w workspace.yaml

dagster schedule wipe

Delete all schedule history and turn off all schedules.
Warning: Cannot be undone.
dagster schedule wipe

dagster schedule debug

Show debug information about the scheduler.
dagster schedule debug

dagster instance

Commands for working with the current Dagster instance.

dagster instance info

Display information about the current instance.
dagster instance info

Output

$DAGSTER_HOME: /Users/username/.dagster

Instance configuration:
-----------------------
storage:
  sqlite:
    base_dir: /Users/username/.dagster/history

Storage schema state:
---------------------
Run storage: Up to date
Event log storage: Up to date
Schedule storage: Up to date

dagster instance migrate

Automatically migrate an out-of-date instance.
dagster instance migrate [OPTIONS]

Options

--bigint-migration
flag
Run an optional bigint migration for ID columns

Example

dagster instance migrate

dagster instance reindex

Rebuild indexes over historical runs for improved performance.
dagster instance reindex

dagster instance concurrency

Commands for managing instance-wide op concurrency limits.

dagster instance concurrency get

Get op concurrency limits.
dagster instance concurrency get [OPTIONS] [KEY]
Options:
--all
flag
Get info on all instance op concurrency limits
Example:
dagster instance concurrency get my_concurrency_key
Output:
"my_concurrency_key": 2 / 10 slots occupied

dagster instance concurrency set

Set op concurrency limits.
dagster instance concurrency set KEY LIMIT
Example:
dagster instance concurrency set database_operations 5

dagster project

Commands for bootstrapping new Dagster projects and code locations.

dagster project scaffold

Create a folder structure with a single Dagster code location.
Superseded: Use create-dagster project instead.
dagster project scaffold [OPTIONS]

Options

--name
string
required
Name of the new Dagster project
--excludes
string
Exclude file patterns from the project template. Can be specified multiple timesValid patterns: readme.md, setup, tests (case-insensitive)
--ignore-package-conflict
flag
Skip checking for PyPI package name conflicts

Example

dagster project scaffold --name my_dagster_project

dagster project from-example

Download an official Dagster example to the current directory.
dagster project from-example [OPTIONS]

Options

--name
string
Name for the new project directory
--example
string
required
Name of the example to download
--version
string
Version of the example to download (defaults to installed Dagster version)

Example

dagster project from-example --example assets_modern_data_stack

dagster project list-examples

List available official Dagster examples.
dagster project list-examples

Output

Examples available in `dagster project from-example`:
* assets_modern_data_stack
* assets_pandas_type_metadata
* feature_graph_backed_assets
* with_pyspark

Troubleshooting

Command Not Found

If you get a “command not found” error:
  1. Verify Dagster is installed:
    pip list | grep dagster
    
  2. Check your PATH includes the Python scripts directory:
    which dagster
    
  3. Try running with the Python module syntax:
    python -m dagster --help
    

Configuration Issues

Check DAGSTER_HOME:
echo $DAGSTER_HOME
If not set, Dagster will use an ephemeral instance. Verify instance configuration:
dagster instance info

Workspace Loading Errors

If you encounter workspace loading errors:
  1. Verify your workspace.yaml is valid
  2. Check that Python modules are importable:
    python -c "import my_module"
    
  3. Ensure your working directory is correct when using relative paths

Permission Errors

If you get permission errors with the instance:
  1. Check DAGSTER_HOME permissions:
    ls -la $DAGSTER_HOME
    
  2. Ensure the dagster.yaml file is readable:
    cat $DAGSTER_HOME/dagster.yaml
    

Environment Variables

DAGSTER_HOME
path
Directory containing the dagster.yaml instance configuration file
DAGSTER_CLI
string
Environment variable prefix for CLI options
DAGSTER_GRPC_PORT
integer
Default port for gRPC servers
DAGSTER_GRPC_HOST
string
Default host for gRPC servers