Skip to main content

Install dbt Cloud CLI

dbt Cloud natively supports developing using a command line (CLI), empowering team members to contribute with enhanced flexibility and collaboration. The dbt Cloud CLI allows you to run dbt commands against your dbt Cloud development environment from your local command line.

dbt commands are run against dbt Cloud's infrastructure and benefit from:

  • Secure credential storage in the dbt Cloud platform
  • Automatic deferral of build artifacts to your Cloud project's production environment
  • Speedier, lower-cost builds
  • Support for dbt Mesh (cross-project ref)
  • Significant platform improvements, to be released over the coming months
Diagram of how the dbt Cloud CLI works with dbt Cloud's infrastructure to run dbt commands from your local command line.Diagram of how the dbt Cloud CLI works with dbt Cloud's infrastructure to run dbt commands from your local command line.

Prerequisites

The dbt Cloud CLI is available in all deployment regions and for both multi-tenant and single-tenant accounts.

  • You are on dbt version 1.5 or higher. Alternatively, set it to Versionless to automatically stay up to date.

Install dbt Cloud CLI

You can install the dbt Cloud CLI on the command line by using one of these methods.

View a video tutorial for a step-by-step guide to installation.

Before you begin, make sure you have Homebrew installed in your code editor or command line terminal. Refer to the FAQs if your operating system runs into path conflicts.

  1. Verify that you don't already have dbt Core installed by running the following command:
which dbt

If the output is dbt not found, then that confirms you don't have it installed.

Run pip uninstall dbt to uninstall dbt Core

If you've installed dbt Core globally in some other way, uninstall it first before proceeding:

pip uninstall dbt
  1. Install the dbt Cloud CLI with Homebrew:

    • First, remove the dbt-labs tap, the separate repository for packages, from Homebrew. This prevents Homebrew from installing packages from that repository:
      brew untap dbt-labs/dbt
    • Then, add and install the dbt Cloud CLI as a package:
      brew tap dbt-labs/dbt-cli
      brew install dbt
      If you have multiple taps, use brew install dbt-labs/dbt-cli/dbt.
  2. Verify your installation by running dbt --help in the command line. If you see the following output, your installation is correct:

    The dbt Cloud CLI - an ELT tool for running SQL transformations and data models in dbt Cloud...

    If you don't see this output, check that you've deactivated pyenv or venv and don't have a global dbt version installed.

    • Note that you no longer need to run the dbt deps command when your environment starts. This step was previously required during initialization. However, you should still run dbt deps if you make any changes to your packages.yml file.
  3. 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.

  4. After cloning your repo, configure the dbt Cloud CLI for your dbt Cloud project. This lets you run dbt commands like dbt environment show 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.

Update dbt Cloud CLI

The following instructions explain how to update the dbt Cloud CLI to the latest version depending on your operating system.

To update the dbt Cloud CLI, run brew update and then brew upgrade dbt.

VS Code extension beta

Visual Studio (VS) Code extensions enhance command line tools by adding extra functionalities. Power user for dbt Core and dbt Cloud is a common extension used to enhance your dbt development with VS Code.

You can use the dbt Cloud CLI with Power User for dbt Core and dbt Cloud by following the instructions here.

The Power User extension will handle installing the Cloud CLI on your behalf.

FAQs

 What's the difference between the dbt Cloud CLI and dbt Core?
 How do I run both the dbt Cloud CLI and dbt Core?
 How to create an alias?
 Why am I receiving a `Session occupied` error?
0