This guide is applicable to Dagster Cloud.
The dagster-cloud
CLI is a command-line toolkit designed to work with Dagster Cloud.
In this guide, we'll cover how to install and configure the dagster-cloud
CLI, get help, and use some helpful environment variables and CLI options.
The Dagster Cloud Agent library is available in PyPi. To install, run:
pip install dagster-cloud
Refer to the configuration section for next steps.
Optionally, you can install command-line completions to make using the dagster-cloud
CLI easier.
To have the CLI install these completions to your shell, run:
dagster-cloud --install-completion
To print out the completion for copying or manual installation:
dagster-cloud --show-completion
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
.
Set up the config file:
dagster-cloud config setup
Select your authentication method. Note: Browser authentication is the easiest method to configure.
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
When prompted, you can specify a default deployment. If specified, a deployment won't be required in subsequent dagster-cloud
commands. The default deployment for a new Dagster Cloud organization is prod
.
Alternatively, you may authenticate using a user token. Refer to the Managing user and agent tokens guide for more info.
$ 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
When prompted, specify the following:
https://hooli.dagster.cloud/
, this would be hooli
.dagster-cloud
commands. The default deployment for a new Dagster Cloud organization is prod
.To view the contents of the CLI configuration file, run:
$ dagster-cloud config view
default_deployment: prod
organization: hooli
user_token: '*******************************8214fe'
Specify the --show-token
flag to show the full user token.
To modify the existing config, re-run:
dagster-cloud config setup
To quickly toggle between deployments, run:
dagster-cloud set-deployment <deployment_name>
To view help options in the CLI:
dagster-cloud --help
Point the CLI at an alternate config location by specifying the DAGSTER_CLOUD_CLI_CONFIG
environment variable.
Environment variables and CLI options can be used in place of or to override the CLI configuration file.
The priority of these items is as follows:
Setting | Environment variable | CLI flag | CLI config value |
---|---|---|---|
Organization | DAGSTER_CLOUD_ORGANIZATION | --organization , -o | organization |
Deployment | DAGSTER_CLOUD_DEPLOYMENT | --deployment , -d | default_deployment |
User Token | DAGSTER_CLOUD_API_TOKEN | --user-token , -u | user_token |