Using the dagster-cloud CLI#

Completions#

To make using the dagster-cloud CLI easier, you may want to install command-line completions.

To have the CLI install these completions to your shell, run:

dagster-cloud --install-completion

You may also print out the completion in order to copy it or install it manually:

dagster-cloud --show-completion

For more information, run dagster-cloud --help.

Configuration#

In order to connect to Dagster Cloud, the dagster-cloud CLI requires specifying your Organization, Deployment, and a User Token. The easiest way to specify this information is by setting up the CLI configuration file.

Setting Up CLI Configuration File#

The recommended way to set up your CLI's config for long-term use is through the configuration file, located by default at ~/.dagster_cloud_cli/config. To set up the config file, run dagster-cloud config setup.

Browser Authentication#

The easiest way to set up is to authenticate through the browser.

$ dagster-cloud config setup
? How would you like to authenticate the CLI? (Use arrow keys)
 » Authenticate in browser
   Authenticate using token
Authorized for organization `hooli`

? Default deployment: prod

Once complete, you may set a default deployment so it need not by specified in subsequent dagster-cloud commands. The starting deployment for a new Cloud instance is called prod.

Token Authentication#

Alternatively, you may authenticate using a user token you have generated or been provided. See Managing user and agent tokens.

$ dagster-cloud config setup
? How would you like to authenticate the CLI? (Use arrow keys)
   Authenticate in browser
 » Authenticate using token

? Dagster Cloud organization: hooli
? Dagster Cloud user token: *************************************
? Default deployment: prod
  • For the organization, specify your organization name as it appears in the Dagit URL. For example, hooli if your cloud is located at https://hooli.dagster.cloud/.
  • For the user token, specify the generated or provided token.
  • Optionally, you may set a default deployment so it need not by specified in subsequent dagster-cloud commands. The starting deployment for a new Cloud instance is called prod.

Custom Config File Path#

You may point the CLI at an alternate config location by specifying the DAGSTER_CLOUD_CLI_CONFIG environment variable.

Viewing and Modifying Configuration File#

To view the contents of your CLI config file, run

$ dagster-cloud config view

default_deployment: prod
organization: hooli
user_token: '*******************************8214fe'

You may specify the --show-token flag to show the full user token.

To modify the existing config, simply rerun dagster-cloud config setup.

To quickly toggle between deployments, you can also run dagster-cloud set-deployment <deployment_name>.

Environment Varibles and CLI Options#

Environment variables and CLI options can be used in place of the CLI configuration file, or to override the configuration file. CLI options have the highest priority, followed by environment variables, with the CLI config having the lowest pirority.

SettingEnvironment VariableCLI FlagCLI config value
OrganizationDAGSTER_CLOUD_ORGANIZATION--organization, -oorganization
DeploymentDAGSTER_CLOUD_DEPLOYMENT--deployment, -ddefault_deployment
User TokenDAGSTER_CLOUD_API_TOKEN--user-token, -uuser_token