Skip to main content

dg

info

This feature is considered in a preview stage and is under active development. There may be API changes and feature gaps. Please go to the #dg-components channel in our Slack to report issues or give feedback.

dg is a new command line interface that provides a streamlined Dagster development experience. It is a drop-in replacement for the Dagster CLI that can be used in existing projects or used to scaffold new Dagster projects. Once a project is set up to use dg, you can list, check, and scaffold Dagster definitions and components with ease. dg is designed to be usable from an isolated environment and has no dependency on dagster itself.

Installation

There are two basic approaches to installing dg:

First, install the Python package manager uv if you don't have it:

brew install uv

For more detailed uv installation instructions, see the uv docs.

Next, use uv to install dg as a globally available tool:

uv tool install dagster-dg

This installs dg into a hidden, isolated Python environment. The dg executable is always available in the user's $PATH, regardless of any virtual environment activation in the shell.

While it is possible to create a virtual environment and install dagster-dg into it with uv, we recommend a global installation for most users. It is simpler, only needs to be done once, and better supports multiple Python projects.

dg API reference

For the full dg API reference, see the dg CLI documentation.

You can also run dg --help on the command line:

dg --help
Usage: dg [OPTIONS] COMMAND [ARGS]...                                                                                  

CLI for managing Dagster projects.

╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --clear-cache Clear the cache. │
│ --rebuild-component-registry Recompute and cache the set of available component types for the current │
│ environment. Note that this also happens automatically whenever the cache is │
│ detected to be stale. │
│ --install-completion Automatically detect your shell and install a completion script for the `dg` │
│ command. This will append to your shell startup file. │
│ --version -v Show the version and exit. │
│ --help -h Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Global options ─────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ --verbose Enable verbose output for debugging. │
│ --disable-cache Disable the cache.. │
│ --cache-dir TEXT Specify a directory to use for the cache. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ check Commands for checking the integrity of your Dagster code. │
│ dev Start a local instance of Dagster. │
│ docs Commands for generating docs from your Dagster code. │
│ init Initialize a new Dagster project, optionally inside a workspace. │
│ launch Launch a Dagster run. │
│ list Commands for listing Dagster entities. │
│ scaffold Commands for scaffolding Dagster code. │
│ utils Assorted utility commands. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯