Skip to main content

dg

warning

This feature is considered in a preview stage and is under active development. It can change significantly, or be removed completely. It is not considered ready for production use.

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 globally installed and has no dependency on dagster itself.

Installation

Install uv

First, install the Python package manager uv:

brew install uv

For more information on uv, including installation instructions for non-Mac systems, see the uv docs.

Install dg

Next, use uv to install dg:

uv tool install dagster-dg
tip

uv tool install installs Python packages from PyPI into isolated environments and exposes their executables on your shell path. This means the dg command will always execute in an isolated environment separate from any project environment.

note

If you have a local clone of the dagster repo, you can install a local version of dg by running make install_editable_uv_tools in the root folder of the repo. This will create an isolated environment for dg like the standard uv tool install, but the environment will contain an editable installation of dagster-dg.

dg API reference

For the full dg API reference, run dg --help:

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 workspace and a first project within that │
│ workspace. │
│ launch Launch a Dagster run. │
│ list Commands for listing Dagster entities. │
│ scaffold Commands for scaffolding Dagster code. │
│ utils Assorted utility commands. │
╰────────────────────────────────────────────────────────────────────────────────────────╯