Registry / workflow / dagster-dg-cli

dagster-dg-cli

JSON →
library1.13.20pypypi✓ verified 24d ago

The `dagster-dg-cli` package provides the command-line interface (CLI) for interacting with Dagster, a Python-native data orchestrator. It allows users to create projects, launch the Dagit UI, deploy to Dagster Cloud, and manage assets, jobs, and runs. The library frequently updates, often on a weekly cadence, in sync with the broader Dagster ecosystem. The current version is 1.13.0.

pip install dagster-dg-cli
INSTALL
IMPORT
SIG · DAGSTER-DG-CLI
D
dagster-dg-cli
workflowpythonv1.13.20
Install
19.3s avg
Import
292ms
Disk
186MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.13.20 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.306s · 182MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 19.3s · import 0.278s · 178MB
186MB installed
● package 186MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

main
from dagster_dg_cli.cli import main
This package is primarily a command-line interface (CLI) wrapper. Direct Python imports of 'main' into user code are rare; its primary utility is via the `dg` shell command.

This quickstart demonstrates how to create a new Dagster project using `dg new`. It then provides instructions to launch the local development UI (Dagit) with `dg dev` in a separate terminal to interact with the newly created project. The Python script executes the setup command but provides clear instructions for the long-running `dg dev` command.

import subprocess import os import time project_name = "my-dagster-quickstart" # 1. Create a new Dagster project print(f"Attempting to create a new Dagster project '{project_name}'...") try: # `dg new` automatically creates the directory if it doesn't exist result = subprocess.run(["dg", "new", project_name], check=True, capture_output=True, text=True, timeout=30) print(f"Project '{project_name}' created successfully:\n{result.stdout}") except subprocess.CalledProcessError as e: # Handle case where project already exists if "already exists" in e.stderr: print(f"Project '{project_name}' already exists. Skipping creation.") else: print(f"Error creating project: {e.stderr}") raise except subprocess.TimeoutExpired: print(f"Error: 'dg new' command timed out after 30 seconds.") raise except FileNotFoundError: print("Error: 'dg' command not found. Ensure dagster-dg-cli is installed and in your PATH.") raise # Change into the new project directory if os.path.exists(project_name): print(f"Changing directory to '{project_name}'...") os.chdir(project_name) else: print(f"Could not find project directory '{project_name}' to change into. Exiting.") exit(1) # 2. Launch the Dagster UI (Dagit) print("\nTo launch the Dagster UI (Dagit), open a new terminal in this directory and run:") print(" dg dev") print("\nThen navigate your browser to http://localhost:3000 to see your project.") print("This `dg dev` command will keep running. Press Ctrl+C in that terminal to stop it.") print("\nDemonstration complete. You can now explore 'my-dagster-quickstart' directory.")
dagster --version
Debug
Known issues
gotchaThe `dagster-dg-cli` package is primarily for providing the `dg` command-line executable. It is not typically imported as a Python library into user code. Most Dagster functionality is accessed via the `dagster` core package and its sub-packages.
fix
Focus on using `dg` commands in your shell. If you need programmatic access to Dagster objects, import directly from the `dagster` package (e.g., `from dagster import asset`).
affects: All versions
gotchaThe `dg api` commands for programmatic inspection (e.g., `dg api job list`, `dg api asset-check list`) are rapidly evolving. Scripts relying on specific output formats or command availability should be version-aware.
fix
Consult the official Dagster documentation for your installed `dagster-dg-cli` version to ensure compatibility when scripting with `dg api` commands. Pin your `dagster-dg-cli` version in `requirements.txt`.
affects: >=1.12.22
gotchaUsing `dg plus deploy` requires the `dagster-cloud` package to be installed and proper configuration (e.g., `agent_queue`, `image`) within your project's `pyproject.toml` file to generate the `dagster_cloud.yaml`.
fix
Ensure `pip install dagster-cloud` and configure your `pyproject.toml` under `[tool.dg.project]` as per Dagster Cloud documentation before attempting `dg plus deploy`.
affects: >=1.12.22
Errors
Common errors & fixes
zsh: command not found: dg
The `dagster-dg-cli` package is either not installed, or its executable (`dg`) is not found in the system's PATH environment variable.
fix
Install the package using `pip install dagster-dg-cli` (or `uv pip install dagster-dg-cli`) and ensure your virtual environment is activated or the Python scripts directory is in your PATH.
ModuleNotFoundError: No module named 'dagster.<something>'
This typically indicates that a required Dagster package or a specific sub-package is not installed in the active Python environment.
fix
Install the necessary Dagster packages, commonly `pip install dagster dagster-webserver dagster-dg-cli`, within your active virtual environment.
Error: Could not import module <module_name>
Dagster's CLI (`dg`) cannot find or load the Python module specified, which contains your asset or job definitions, often due to an incorrect `--module` or `--file` path, or an improperly structured Python package.
fix
Verify that the module or file path provided to the `dg` command is correct, accessible, and that all necessary `__init__.py` files exist to make your directories valid Python packages.
AttributeError: 'AndAutomationCondition' object has no attribute '__name__'
This error often arises from a version mismatch or an incompatibility between the `dagster` core library and a related Dagster components library, particularly when interacting with automation conditions.
fix
Update all Dagster-related packages to their latest compatible versions using `pip install --upgrade dagster dagster-webserver dagster-dg-cli dagster-components` (or specific related packages).
Upgrade
Version history
1.13.20latest on PyPI · released Aug 27, 2026
Audit
Dependencies
dagsterrequiredThe core Dagster library, required for most functionality.
dagster-cloudoptionalRequired for 'dg plus deploy' and Dagster Cloud interactions.
Agent activity
23 hits · last 30 days
node
20
OpenAI (training)
1
Resources
dagster-dg-cli — pip install dagster-dg-cli · libregistry