Skip to main content

About dbt environment command

The dbt environment command enables you to interact with your dbt Cloud environment. Use the command for:

  • Viewing your local configuration details (account ID, active project ID, deployment environment, and more).
  • Viewing your dbt Cloud configuration details (environment ID, environment name, connection type, and more).

This guide lists all the commands and options you can use with dbt environment in the dbt Cloud CLI. To use them, add a command or option like this: dbt environment [command] or use the shorthand dbt env [command].

dbt environment show

show command To view your local and dbt Cloud configuration details. To run the command with the dbt Cloud CLI, type one of the following commands, including the shorthand:

dbt environment show
dbt env show

The command returns the following information:

❯ dbt env show
Local Configuration:
Active account ID 185854
Active project ID 271692
Active host name cloud.getdbt.com
dbt_cloud.yml file path /Users/cesar/.dbt/dbt_cloud.yml
dbt_project.yml file path /Users/cesar/git/cloud-cli-test-project/dbt_project.yml
dbt Cloud CLI version 0.35.7
OS info darwin arm64

Cloud Configuration:
Account ID 185854
Project ID 271692
Project name Snowflake
Environment ID 243762
Environment name Development
Defer environment ID [N/A]
dbt version 1.6.0-latest
Target name default
Connection type snowflake

Snowflake Connection Details:
Account ska67070
Warehouse DBT_TESTING_ALT
Database DBT_TEST
Schema CLOUD_CLI_TESTING
Role SYSADMIN
User dbt_cloud_user
Client session keep alive false

Note, that dbt Cloud won't return anything that is a secret key and will return an 'NA' for any field that isn't configured.

dbt environment flags

Use the following flags (or options) with the dbt environment command:

  • -h, --help To view the help documentation for a specific command in your command line interface.

    dbt environment [command] --help
    dbt environment [command] -h

    The --help flag returns the following information:

      ❯ dbt help environment
    Interact with dbt environments

    Usage:
    dbt environment [command]

    Aliases:
    environment, env

    Available Commands:
    show Show the working environment

    Flags:
    -h, --help help for environment

    Use "dbt environment [command] --help" for more information about a command.

    For example, to view the help documentation for the show command, type one of the following commands, including the shorthand:

    dbt environment show --help
    dbt env show -h
0