Registry / workflow / dagster-cloud-cli

dagster-cloud-cli

JSON →
library1.13.0pypypiunverified

The `dagster-cloud-cli` provides command-line tools for interacting with Dagster Cloud, enabling operations such as deploying code, managing agents, and configuring workspaces. It is the primary interface for developers to manage their Dagster deployments in a Dagster Cloud environment. The current version is 1.13.0, with releases tightly coupled to the broader Dagster ecosystem's frequent update cadence.

pip install dagster-cloud-cli
INSTALL
IMPORT
SIG · DAGSTER-CLOUD-CLI
D
dagster-cloud-cli
workflowpythonv1.13.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

This quickstart demonstrates how to verify the installation of `dagster-cloud-cli` by running the `dg --version` command. The `dagster-cloud-cli` is primarily a command-line interface tool, and most interactions happen directly in the terminal via the `dg` command. For programmatic interactions with Dagster Cloud itself, the `dagster-cloud` Python library is generally used.

import subprocess import os # The dagster-cloud-cli is primarily used via the 'dg' command in the terminal. # This quickstart demonstrates checking its version programmatically. try: # This runs a basic 'dg --version' command to verify installation. # For actual Dagster Cloud operations (e.g., 'dg deploy'), you would typically # execute commands directly in your shell or CI/CD scripts. print("Running: dg --version") result = subprocess.run(["dg", "--version"], capture_output=True, text=True, check=True) print("\nDagster Cloud CLI Version Information:") print(result.stdout) print("Ensure 'dg' is in your system's PATH after installation.") except FileNotFoundError: print("Error: 'dg' command not found. Ensure dagster-cloud-cli is installed and in your PATH.") except subprocess.CalledProcessError as e: print(f"Error running dg command: {e}") print(f"Stdout: {e.stdout}") print(f"Stderr: {e.stderr}")
dagster-cloud --version
Debug
Known issues
gotchaThe `dagster-cloud-cli` (`dg` command) is a command-line interface. For programmatic interaction with Dagster Cloud services (e.g., fetching run metadata, launching runs from Python), you should use the `dagster-cloud` Python library (SDK) instead of attempting to import from or wrap the CLI tool.
fix
Use `pip install dagster-cloud` and refer to its documentation for Python SDK usage.
affects: All versions
gotchaAuthentication for `dagster-cloud-cli` typically requires setting the `DAGSTER_CLOUD_AGENT_TOKEN` environment variable or using `dg login`. Operations like `dg deploy` will fail without proper authentication.
fix
Set `export DAGSTER_CLOUD_AGENT_TOKEN='...'` in your environment or run `dg login` to authenticate before executing commands that interact with your Dagster Cloud workspace.
affects: All versions
gotchaWhen deploying code using `dg plus deploy`, a `dagster_cloud.yaml` configuration file and a properly structured Dagster project are required in the current directory or specified path. Missing or misconfigured files will prevent successful deployment.
fix
Run `dg init` to set up a new project structure or ensure your existing project contains a valid `dagster_cloud.yaml` file and entrypoint.
affects: All versions
breakingBeginning with Dagster core version 1.12.18 (which `dagster-cloud-cli` depends on), `psycopg2-binary` was removed as a transitive dependency from `dagster-postgres`. If your project relies on `dagster-postgres` and implicitly depended on this, you may encounter import errors.
fix
Explicitly add `pip install psycopg2-binary` to your project's dependencies if you use `dagster-postgres` and previously relied on its transitive inclusion.
affects: >=1.12.18 (core) / >=0.28.18 (libraries)
Errors
Common errors & fixes
dagster-cloud: command not found
The `dagster-cloud` CLI has largely been superseded by the `dg` CLI, or it might not be installed or its executable path is not in your system's PATH.
fix
Install the recommended `dagster-dg-cli` using `pip install dagster-dg-cli` and use `dg` commands. If you explicitly need `dagster-cloud`, ensure it's installed via `pip install dagster-cloud` and verify your PATH.
denied: Your authorization token has expired. Reauthenticate and try again.
The authentication token used by the `dagster-cloud-cli` (or `dg cli`) to connect to Dagster Cloud is no longer valid, often due to expiry or revocation.
fix
Reauthenticate your CLI session by running `dagster-cloud config setup` or `dg login`. This will guide you through browser-based authentication or prompt for a new user token.
Error: Could not find a setup.py or requirements.txt in the target directory.
When deploying code to Dagster Cloud, particularly with serverless deployments, the CLI requires a `setup.py` or `requirements.txt` file in the specified target directory to define and build your Python dependencies.
fix
Ensure that a `setup.py` or `requirements.txt` file, listing your project's Python dependencies (including `dagster-cloud`), is present in the root of the directory you are deploying.
dagster_cloud_cli.core.errors.DagsterCloudAgentServerError: Exceeded 30 redirects.
This error typically occurs when attempting to launch a job in a Dagster Cloud branch deployment using the branch *name* instead of its unique *deployment ID*.
fix
Use the specific deployment ID (a long hexadecimal string) when launching jobs in a branch deployment. The deployment ID can be obtained from the Dagster Cloud UI or by running `dagster-cloud ci status` after the deployment.
Upgrade
Version history
1.13.0latest on PyPI · released Apr 9, 2026
Audit
Dependencies
dagsterrequiredCore Dagster library, required for defining pipelines and assets.
dagster-cloudrequiredPython SDK for programmatic interaction with Dagster Cloud.
Agent activity
15 hits · last 30 days
node
12
OpenAI (training)
1
Resources