dg CLI
dg check
Commands for checking the integrity of your Dagster code.
dg check [OPTIONS] COMMAND [ARGS]...
Commands:
- defs
Loads and validates your Dagster definitions using a Dagster instance.
If run inside a deployment directory, this command will launch all code locations in the
deployment. If launched inside a code location directory, it will launch only that code
location.
When running, this command sets the environment variable DAGSTER_IS_DEFS_VALIDATION_CLI=1.
This environment variable can be used to control the behavior of your code in validation mode.
This command returns an exit code 1 when errors are found, otherwise an exit code 0.
- yaml
Check defs.yaml files against their schemas, showing validation errors.
dg dev
Start a local instance of Dagster.
If run inside a workspace directory, this command will launch all projects in the workspace. If launched inside a project directory, it will launch only that project.
dg dev [OPTIONS]
Options:
- --code-server-log-level <code_server_log_level>
Set the log level for code servers spun up by dagster services.
Default:
'warning'
Options: critical | error | warning | info | debug
- --log-level <log_level>
Set the log level for dagster services.
Default:
'info'
Options: critical | error | warning | info | debug
- --log-format <log_format>
Format of the logs for dagster services
Default:
'colored'
Options: colored | json | rich
- -p, --port <port>
Port to use for the Dagster webserver.
- -h, --host <host>
Host to use for the Dagster webserver.
- --live-data-poll-rate <live_data_poll_rate>
Rate at which the dagster UI polls for updated asset data (in milliseconds)
Default:
2000
- --check-yaml, --no-check-yaml
Whether to schema-check defs.yaml files for the project before starting the dev server.
- --target-path <target_path>
Specify a directory to use to load the context for this command. This will typically be a folder with a dg.toml or pyproject.toml file in it.
- --verbose
Enable verbose output for debugging.
- --disable-cache
Disable the cache..
- --cache-dir <cache_dir>
Specify a directory to use for the cache.
- --autoload-defs-module-name <autoload_defs_module_name>
A module to import and recursively search through for definitions.
- -m, --module-name <module_name>
Specify module or modules (flag can be used multiple times) where dagster definitions reside as top-level symbols/variables and load each module as a code location in the current python environment.
- -f, --python-file <python_file>
Specify python file or files (flag can be used multiple times) where dagster definitions reside as top-level symbols/variables and load each file as a code location in the current python environment.
- -d, --working-directory <working_directory>
Specify working directory to use when loading the repository or job
- -w, --workspace <workspace>
Path to workspace file. Argument can be provided multiple times.
- --empty-workspace
Allow an empty workspace
Environment variables:
- DAGSTER_autoload_defs_module_name
Provide a default for
--autoload-defs-module-name
- DAGSTER_MODULE_NAME
Provide a default for
--module-name
- DAGSTER_PYTHON_FILE
Provide a default for
--python-file
- DAGSTER_WORKING_DIRECTORY
Provide a default for
--working-directory
dg docs
Commands for generating docs from your Dagster code.
dg docs [OPTIONS] COMMAND [ARGS]...
Commands:
- build
Build a static version of the Dagster components docs, to be served by a static file server.
dg launch
Launch a Dagster run.
dg launch [OPTIONS]
Options:
- --assets <assets>
Comma-separated Asset selection to target
- --job <job>
Job to target
- --partition <partition>
Asset partition to target
- --partition-range <partition_range>
Asset partition range to target i.e. <start>…<end>
- --config-json <config_json>
JSON string of config to use for the launched run.
- -c, --config <config>
Specify one or more run config files. These can also be file patterns. If more than one run config file is captured then those files are merged. Files listed first take precedence.
- --target-path <target_path>
Specify a directory to use to load the context for this command. This will typically be a folder with a dg.toml or pyproject.toml file in it.
- --verbose
Enable verbose output for debugging.
- --disable-cache
Disable the cache..
- --cache-dir <cache_dir>
Specify a directory to use for the cache.
- -a, --attribute <attribute>
Attribute that is either a 1) repository or job or 2) a function that returns a repository or job
- --package-name <package_name>
Specify Python package where repository or job function lives
- --autoload-defs-module-name <autoload_defs_module_name>
A module to import and recursively search through for definitions.
- -m, --module-name <module_name>
Specify module where dagster definitions reside as top-level symbols/variables and load the module as a code location in the current python environment.
- -f, --python-file <python_file>
Specify python file where dagster definitions reside as top-level symbols/variables and load the file as a code location in the current python environment.
- -d, --working-directory <working_directory>
Specify working directory to use when loading the repository or job
Environment variables:
- DAGSTER_ATTRIBUTE
Provide a default for
--attribute
- DAGSTER_PACKAGE_NAME
Provide a default for
--package-name
- DAGSTER_autoload_defs_module_name
Provide a default for
--autoload-defs-module-name
- DAGSTER_MODULE_NAME
Provide a default for
--module-name
- DAGSTER_PYTHON_FILE
Provide a default for
--python-file
- DAGSTER_WORKING_DIRECTORY
Provide a default for
--working-directory
dg list
Commands for listing Dagster entities.
dg list [OPTIONS] COMMAND [ARGS]...
Commands:
- components
List all available Dagster component types in the current Python environment.
- defs
List registered Dagster definitions in the current project environment.
- envs
List environment variables from the .env file of the current project.
- projects
List projects in the current workspace.
- registry-modules
List dg plugins and their corresponding objects in the current Python environment.
dg scaffold
Commands for scaffolding Dagster entities.
dg scaffold [OPTIONS] COMMAND [ARGS]...
Commands:
- build-artifacts
Scaffolds a Dockerfile to build the given Dagster project or workspace.
- component
Scaffold of a custom Dagster component type.
This command must be run inside a Dagster project directory. The component type scaffold
will be placed in submodule <project_name>.lib.<name>.
- defs
Commands for scaffolding Dagster code.
- github-actions
Scaffold a GitHub Actions workflow for a Dagster project.
This command will create a GitHub Actions workflow in the .github/workflows directory.