Skip to main content

create-dagster CLI

create-dagster project

Scaffold a new Dagster project at PATH. The name of the project will be the final component of PATH.

This command can be run inside or outside of a workspace directory. If run inside a workspace, the project will be added to the workspace’s list of project specs.

“.” may be passed as PATH to create the new project inside the existing working directory.

Created projects will have the following structure:

├── src
│ └── PROJECT_NAME
│ ├── __init__.py
│ ├── definitions.py
│ ├── defs
│ │ └── __init__.py
│ └── components
│ └── __init__.py
├── tests
│ └── __init__.py
└── pyproject.toml

The src.PROJECT_NAME.defs directory holds Python objects that can be targeted by the dg scaffold command or have dg-inspectable metadata. Custom component types in the project live in src.PROJECT_NAME.components. These types can be created with dg scaffold component.

Examples:

create-dagster project PROJECT_NAME
Scaffold a new project in new directory PROJECT_NAME. Automatically creates directory
and parent directories.
create-dagster project .
Scaffold a new project in the CWD. The project name is taken from the last component of the CWD.
create-dagster project [OPTIONS] PATH

Options:

--uv-sync, --no-uv-sync

Preemptively answer the “Run uv sync?” prompt presented after project initialization.

--use-editable-dagster <use_editable_dagster>

Install all Dagster package dependencies from a local Dagster clone. Accepts a path to local Dagster clone root or may be set as a flag (no value is passed). If set as a flag, the location of the local Dagster clone will be read from the DAGSTER_GIT_REPO_DIR environment variable.

--verbose

Enable verbose output for debugging.

--disable-cache

Disable the cache..

--cache-dir <cache_dir>

Specify a directory to use for the cache.

Arguments:

PATH

Required argument

create-dagster workspace

Initialize a new Dagster workspace.

The scaffolded workspace folder has the following structure:

├── projects
│ └── Dagster projects go here
├── deployments
│ └── local
│ ├── pyproject.toml
│ └── uv.lock
└── dg.toml

Examples:

create-dagster workspace WORKSPACE_NAME
Scaffold a new workspace in new directory WORKSPACE_NAME. Automatically creates directory
and parent directories.
create-dagster workspace .
Scaffold a new workspace in the CWD. The workspace name is the last component of the CWD.
create-dagster workspace [OPTIONS] PATH

Options:

--uv-sync, --no-uv-sync

Preemptively answer the “Run uv sync?” prompt presented after project initialization.

--use-editable-dagster <use_editable_dagster>

Install all Dagster package dependencies from a local Dagster clone. Accepts a path to local Dagster clone root or may be set as a flag (no value is passed). If set as a flag, the location of the local Dagster clone will be read from the DAGSTER_GIT_REPO_DIR environment variable.

--verbose

Enable verbose output for debugging.

--disable-cache

Disable the cache..

--cache-dir <cache_dir>

Specify a directory to use for the cache.

Arguments:

PATH

Required argument