From 42d3fc68e9552ed4bfa62c07792fe529deace36a Mon Sep 17 00:00:00 2001 From: mirnawong1 Date: Wed, 24 Jan 2024 21:13:44 +0000 Subject: [PATCH 1/6] adding dbt env show --- .../docs/docs/cloud/cloud-cli-installation.md | 10 +- .../docs/docs/cloud/configure-cloud-cli.md | 10 +- .../reference/commands/dbt-environment.md | 99 +++++++++++++++++++ website/docs/reference/dbt-commands.md | 3 +- website/sidebars.js | 1 + 5 files changed, 113 insertions(+), 10 deletions(-) create mode 100644 website/docs/reference/commands/dbt-environment.md diff --git a/website/docs/docs/cloud/cloud-cli-installation.md b/website/docs/docs/cloud/cloud-cli-installation.md index edf6511d4b8..4644fe49e73 100644 --- a/website/docs/docs/cloud/cloud-cli-installation.md +++ b/website/docs/docs/cloud/cloud-cli-installation.md @@ -1,6 +1,6 @@ --- title: Install dbt Cloud CLI -sidebar_label: "Install dbt Cloud CLI" +sidebar_label: "Installation" id: cloud-cli-installation description: "Instructions for installing and configuring dbt Cloud CLI" pagination_next: "docs/cloud/configure-cloud-cli" @@ -75,7 +75,7 @@ Before you begin, make sure you have [Homebrew installed](http://brew.sh/) in yo 4. Clone your repository to your local computer using `git clone`. For example, to clone a GitHub repo using HTTPS format, run `git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY`. -5. After cloning your repo, [configure](/docs/cloud/configure-cloud-cli) the dbt Cloud CLI for your dbt Cloud project. This lets you run dbt commands like `dbt compile` to compile your project and validate models and tests. You can also add, edit, and synchronize files with your repo. +5. After cloning your repo, [configure](/docs/cloud/configure-cloud-cli) the dbt Cloud CLI for your dbt Cloud project. This lets you run dbt commands like [`dbt environment show`](/reference/commands/dbt-environment) to view your dbt Cloud configuration or `dbt compile` to compile your project and validate models and tests. You can also add, edit, and synchronize files with your repo. @@ -106,7 +106,7 @@ Note that if you are using VS Code, you must restart it to pick up modified envi 4. Clone your repository to your local computer using `git clone`. For example, to clone a GitHub repo using HTTPS format, run `git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY`. -5. After cloning your repo, [configure](/docs/cloud/configure-cloud-cli) the dbt Cloud CLI for your dbt Cloud project. This lets you run dbt commands like `dbt compile` to compile your project and validate models and tests. You can also add, edit, and synchronize files with your repo. +5. After cloning your repo, [configure](/docs/cloud/configure-cloud-cli) the dbt Cloud CLI for your dbt Cloud project. This lets you run dbt commands like [`dbt environment show`](/reference/commands/dbt-environment) to view your dbt Cloud configuration or `dbt compile` to compile your project and validate models and tests. You can also add, edit, and synchronize files with your repo. @@ -140,7 +140,7 @@ Advanced users can configure multiple projects to use the same Cloud CLI executa 4. Clone your repository to your local computer using `git clone`. For example, to clone a GitHub repo using HTTPS format, run `git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY`. -5. After cloning your repo, [configure](/docs/cloud/configure-cloud-cli) the dbt Cloud CLI for your dbt Cloud project. This lets you run dbt commands like `dbt compile` to compile your project and validate models and tests. You can also add, edit, and synchronize files with your repo. +5. After cloning your repo, [configure](/docs/cloud/configure-cloud-cli) the dbt Cloud CLI for your dbt Cloud project. This lets you run dbt commands like [`dbt environment show`](/reference/commands/dbt-environment) to view your dbt Cloud configuration or `dbt compile` to compile your project and validate models and tests. You can also add, edit, and synchronize files with your repo. @@ -205,7 +205,7 @@ We recommend using virtual environments (venv) to namespace `cloud-cli`. 4. Clone your repository to your local computer using `git clone`. For example, to clone a GitHub repo using HTTPS format, run `git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY`. -5. After cloning your repo, [configure](/docs/cloud/configure-cloud-cli) the dbt Cloud CLI for your dbt Cloud project. This lets you run dbt commands like `dbt compile` to compile your project and validate models and tests. You can also add, edit, and synchronize files with your repo. +5. After cloning your repo, [configure](/docs/cloud/configure-cloud-cli) the dbt Cloud CLI for your dbt Cloud project. This lets you run dbt commands like [`dbt environment show`](/reference/commands/dbt-environment) to view your dbt Cloud configuration or `dbt compile` to compile your project and validate models and tests. You can also add, edit, and synchronize files with your repo. diff --git a/website/docs/docs/cloud/configure-cloud-cli.md b/website/docs/docs/cloud/configure-cloud-cli.md index a442a6e6ad1..acd77bfd23b 100644 --- a/website/docs/docs/cloud/configure-cloud-cli.md +++ b/website/docs/docs/cloud/configure-cloud-cli.md @@ -1,8 +1,8 @@ --- -title: Configure dbt Cloud CLI +title: Configure and use the dbt Cloud CLI id: configure-cloud-cli description: "Instructions on how to configure the dbt Cloud CLI" -sidebar_label: "Configure dbt Cloud CLI" +sidebar_label: "Configuration and usage" pagination_next: null --- @@ -75,7 +75,9 @@ Once you install the dbt Cloud CLI, you need to configure it to connect to a dbt - To find your project ID, select **Develop** in the dbt Cloud navigation menu. You can use the URL to find the project ID. For example, in `https://cloud.getdbt.com/develop/26228/projects/123456`, the project ID is `123456`. -6. You can now [use the dbt Cloud CLI](#use-the-dbt-cloud-cli) and run [dbt commands](/reference/dbt-commands) like `dbt compile`. With your repo recloned, you can add, edit, and sync files with your repo. +6. You should now be able to [use the dbt Cloud CLI](#use-the-dbt-cloud-cli) and run [dbt commands](/reference/dbt-commands) like [`dbt environment show`](/reference/commands/dbt-environment) to view your dbt Cloud configuration details or `dbt compile` to compile models in your dbt project. + +With your repo recloned, you can add, edit, and sync files with your repo. ### Set environment variables @@ -89,7 +91,7 @@ To set environment variables in the dbt Cloud CLI for your dbt project: ## Use the dbt Cloud CLI -- The dbt Cloud CLI uses the same set of [dbt commands](/reference/dbt-commands) and [MetricFlow commands](/docs/build/metricflow-commands) as dbt Core to execute the commands you provide. +- The dbt Cloud CLI uses the same set of [dbt commands](/reference/dbt-commands) and [MetricFlow commands](/docs/build/metricflow-commands) as dbt Core to execute the commands you provide. For example, use the [`dbt environment`](/reference/commands/dbt-environment) command to view your dbt Cloud configuration details. - It allows you to automatically defer build artifacts to your Cloud project's production environment. - It also supports [project dependencies](/docs/collaborate/govern/project-dependencies), which allows you to depend on another project using the metadata service in dbt Cloud. - Project dependencies instantly connect to and reference (or `ref`) public models defined in other projects. You don't need to execute or analyze these upstream models yourself. Instead, you treat them as an API that returns a dataset. diff --git a/website/docs/reference/commands/dbt-environment.md b/website/docs/reference/commands/dbt-environment.md new file mode 100644 index 00000000000..186c86d2143 --- /dev/null +++ b/website/docs/reference/commands/dbt-environment.md @@ -0,0 +1,99 @@ +--- +title: "About dbt environment command" +sidebar_label: "environment" +id: dbt-environment +--- + +The `dbt environment` command enables you to interact with your dbt Cloud environment. The `dbt environment` command is useful for: + +- Viewing your local configuration details (account ID, active project ID, deployment environment, and more). +- Viewing your dbt Cloud configuration details (account ID, environment ID, environment name, connection type, and more). +- CAN YOU MAKE CHANGES TO THE ENVIRONMENT? + +This guide lists all the commands and options you can use with `dbt environment` in the [dbt Cloud CLI](/docs/cloud/cloud-cli-installation). To use it, add a command after it like this: `dbt environment [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: + +```shell +dbt environment show +``` +```shell +dbt env show +``` + +The command returns the following information: + +```bash +❯ 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. + + ```shell + dbt environment [command] --help + dbt environment [command] -h + ``` + + The `--help` flag returns the following information: + + ```bash + ❯ 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: + + ```shell + dbt environment show --help + dbt env show -h + ``` diff --git a/website/docs/reference/dbt-commands.md b/website/docs/reference/dbt-commands.md index 4cb20051ea2..2e534049dce 100644 --- a/website/docs/reference/dbt-commands.md +++ b/website/docs/reference/dbt-commands.md @@ -17,7 +17,7 @@ All commands in the table are compatible with either the dbt Cloud IDE, dbt Clou You can run dbt commands in your specific tool by prefixing them with `dbt`. For example, to run the `test` command, type `dbt test`. -| Command | Description | Compatible tools | Version | +| Command | Description | Compatible tools |
Version
| | ------- | ----------- | ---------------- | ------- | | [build](/reference/commands/build) | Build and test all selected resources (models, seeds, snapshots, tests) | All | All [supported versions](/docs/dbt-versions/core) | | cancel | Cancels the most recent invocation.| dbt Cloud CLI | Requires [dbt v1.6 or higher](/docs/dbt-versions/core) | @@ -27,6 +27,7 @@ You can run dbt commands in your specific tool by prefixing them with `dbt`. Fo | [debug](/reference/commands/debug) | Debugs dbt connections and projects | dbt Cloud IDE
dbt Core | All [supported versions](/docs/dbt-versions/core) | | [deps](/reference/commands/deps) | Downloads dependencies for a project | All | All [supported versions](/docs/dbt-versions/core) | | [docs](/reference/commands/cmd-docs) | Generates documentation for a project | All | All [supported versions](/docs/dbt-versions/core) | +| [environment](/reference/commands/dbt-environment) | Enables you to interact with your dbt Cloud environment. | dbt Cloud CLI | Requires [dbt v1.5 or higher](/docs/dbt-versions/core) | | help | Displays help information for any command | dbt Core
dbt Cloud CLI | All [supported versions](/docs/dbt-versions/core) | | [init](/reference/commands/init) | Initializes a new dbt project | dbt Core | All [supported versions](/docs/dbt-versions/core) | | [list](/reference/commands/list) | Lists resources defined in a dbt project | All | All [supported versions](/docs/dbt-versions/core) | diff --git a/website/sidebars.js b/website/sidebars.js index 0566ef8c3a6..d3d2f191558 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -887,6 +887,7 @@ const sidebarSettings = { "reference/commands/compile", "reference/commands/debug", "reference/commands/deps", + "reference/commands/dbt-environment", "reference/commands/init", "reference/commands/list", "reference/commands/parse", From c26ba9480ea13e7d4389bc3717fac8b00ed074fd Mon Sep 17 00:00:00 2001 From: mirnawong1 <89008547+mirnawong1@users.noreply.github.com> Date: Thu, 25 Jan 2024 17:21:32 +0000 Subject: [PATCH 2/6] Update website/docs/reference/commands/dbt-environment.md --- website/docs/reference/commands/dbt-environment.md | 1 - 1 file changed, 1 deletion(-) diff --git a/website/docs/reference/commands/dbt-environment.md b/website/docs/reference/commands/dbt-environment.md index 186c86d2143..9abf5dd5f10 100644 --- a/website/docs/reference/commands/dbt-environment.md +++ b/website/docs/reference/commands/dbt-environment.md @@ -8,7 +8,6 @@ The `dbt environment` command enables you to interact with your dbt Cloud enviro - Viewing your local configuration details (account ID, active project ID, deployment environment, and more). - Viewing your dbt Cloud configuration details (account ID, environment ID, environment name, connection type, and more). -- CAN YOU MAKE CHANGES TO THE ENVIRONMENT? This guide lists all the commands and options you can use with `dbt environment` in the [dbt Cloud CLI](/docs/cloud/cloud-cli-installation). To use it, add a command after it like this: `dbt environment [command]`. From 058bcc93dea1f59d97fa788ef24eed23d33ba577 Mon Sep 17 00:00:00 2001 From: mirnawong1 <89008547+mirnawong1@users.noreply.github.com> Date: Thu, 25 Jan 2024 17:35:24 +0000 Subject: [PATCH 3/6] Update website/docs/reference/commands/dbt-environment.md --- website/docs/reference/commands/dbt-environment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/commands/dbt-environment.md b/website/docs/reference/commands/dbt-environment.md index 9abf5dd5f10..4eb9587eee9 100644 --- a/website/docs/reference/commands/dbt-environment.md +++ b/website/docs/reference/commands/dbt-environment.md @@ -7,7 +7,7 @@ id: dbt-environment The `dbt environment` command enables you to interact with your dbt Cloud environment. The `dbt environment` command is useful for: - Viewing your local configuration details (account ID, active project ID, deployment environment, and more). -- Viewing your dbt Cloud configuration details (account ID, environment ID, environment name, connection type, 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](/docs/cloud/cloud-cli-installation). To use it, add a command after it like this: `dbt environment [command]`. From cf84bfcd675d56ee46675851919d61b7db670924 Mon Sep 17 00:00:00 2001 From: mirnawong1 <89008547+mirnawong1@users.noreply.github.com> Date: Mon, 29 Jan 2024 10:34:20 +0000 Subject: [PATCH 4/6] Update website/docs/reference/commands/dbt-environment.md --- website/docs/reference/commands/dbt-environment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/commands/dbt-environment.md b/website/docs/reference/commands/dbt-environment.md index 4eb9587eee9..63a832a2d28 100644 --- a/website/docs/reference/commands/dbt-environment.md +++ b/website/docs/reference/commands/dbt-environment.md @@ -4,7 +4,7 @@ sidebar_label: "environment" id: dbt-environment --- -The `dbt environment` command enables you to interact with your dbt Cloud environment. The `dbt environment` command is useful for: +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). From f40599bef8deda82eaf793b261418359b255efaa Mon Sep 17 00:00:00 2001 From: mirnawong1 <89008547+mirnawong1@users.noreply.github.com> Date: Mon, 29 Jan 2024 10:35:47 +0000 Subject: [PATCH 5/6] Update website/docs/reference/commands/dbt-environment.md --- website/docs/reference/commands/dbt-environment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/commands/dbt-environment.md b/website/docs/reference/commands/dbt-environment.md index 63a832a2d28..2e7236e85a9 100644 --- a/website/docs/reference/commands/dbt-environment.md +++ b/website/docs/reference/commands/dbt-environment.md @@ -9,7 +9,7 @@ The `dbt environment` command enables you to interact with your dbt Cloud enviro - 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](/docs/cloud/cloud-cli-installation). To use it, add a command after it like this: `dbt environment [command]`. +This guide lists all the commands and options you can use with `dbt environment` in the [dbt Cloud CLI](/docs/cloud/cloud-cli-installation). To use them, add a command or option like this: `dbt environment [command]`. ### dbt environment show From 61fedc13a2b5911c0cc7a8914b6b0682e2e467e4 Mon Sep 17 00:00:00 2001 From: mirnawong1 <89008547+mirnawong1@users.noreply.github.com> Date: Mon, 29 Jan 2024 10:36:27 +0000 Subject: [PATCH 6/6] Update website/docs/reference/commands/dbt-environment.md --- website/docs/reference/commands/dbt-environment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/reference/commands/dbt-environment.md b/website/docs/reference/commands/dbt-environment.md index 2e7236e85a9..79683640488 100644 --- a/website/docs/reference/commands/dbt-environment.md +++ b/website/docs/reference/commands/dbt-environment.md @@ -9,7 +9,7 @@ The `dbt environment` command enables you to interact with your dbt Cloud enviro - 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](/docs/cloud/cloud-cli-installation). To use them, add a command or option like this: `dbt environment [command]`. +This guide lists all the commands and options you can use with `dbt environment` in the [dbt Cloud CLI](/docs/cloud/cloud-cli-installation). To use them, add a command or option like this: `dbt environment [command]` or use the shorthand `dbt env [command]`. ### dbt environment show