Install dbt Cloud CLI
The dbt Cloud CLI is currently in public preview. Share feedback or request features you'd like to see on the dbt community Slack.
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.
The dbt Cloud CLI is available in all deployment regions and and for both multi-tenant and single-tenant accounts (Azure single-tenant not supported at this time).
Install dbt Cloud CLI
You can install the dbt Cloud CLI on the command line by using one of these methods:
- Existing dbt Core users (pip)
- macOS (brew)
- Windows (native executable)
- Linux (native executable)
Installing the dbt Cloud CLI with pip replaces dbt Core. This change can be avoided by using the native install method and configuring your PATH or by creating a new virtual environment.
Otherwise, to switch back to dbt Core, uninstall the dbt Cloud CLI and follow the dbt Core installation instructions.
Before installing the dbt Cloud CLI, make sure you have Python installed and your virtual environment venv or pyenv . If you already have a Python environment configured, you can skip to the pip installation step.
Install a virtual environment
We recommend using virtual environments (venv) to namespace cloud-cli
.
Create a new venv:
python3 -m venv dbt-cloud
Activate the virtual environment each time you create a shell window or session:
source dbt-cloud/bin/activate # activate the environment for Mac and Linux OR
dbt-env\Scripts\activate # activate the environment for Windows(Mac and Linux only) Create an alias to activate your dbt environment with every new shell window or session. You can add the following to your shell's configuration file (for example, $HOME/.bashrc, $HOME/.zshrc) while replacing
<PATH_TO_VIRTUAL_ENV_CONFIG>
with the path to your virtual environment configuration:alias env_dbt='source <PATH_TO_VIRTUAL_ENV_CONFIG>/bin/activate'
Install dbt Cloud CLI in pip
(Optional) If you already have dbt Core installed, this installation will override that package. Note your dbt Core version in case you need to reinstall it later:
dbt --version
Make sure you're in your virtual environment and run the following command to install the dbt Cloud CLI:
pip3 install dbt
(Optional) To revert back to dbt Core, first uninstall both the dbt Cloud CLI and dbt Core
Reinstall dbt Core using the version from Step 2.
pip3 uninstall dbt-core dbt
pip3 install dbt-core==VERSION
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.
Run the following command to verify that there is no conflict with a dbt Core installation on your system:
which dbt
- This should return a
dbt not found
. If the dbt help text appears, usepip uninstall dbt
to deactivate dbt Core from your machine.
- This should return a
Install the dbt Cloud CLI with Homebrew:
brew untap dbt-labs/dbt
brew tap dbt-labs/dbt-cli
brew install dbtVerify the installation by running
dbt --help
from the command line. If the help text doesn't indicate that you're using the dbt Cloud CLI, make sure you've deactivated your pyenv or venv and don't have a version of dbt globally installed.- You don't have to run the
dbt deps
command when your environment starts. Previously, you had to do it during initialization. However, you'll still need to rundbt deps
if you make changes to yourpackages.yml
file.
- You don't have to run the
Refer to the FAQs if your operating system runs into path conflicts.
Download the latest Windows release for your platform from GitHub.
Extract the
dbt.exe
executable into the same folder as your dbt project.
Advanced users can configure multiple projects to use the same dbt Cloud CLI by placing the executable in the Program Files folder and adding it to their Windows PATH environment variable.
Note that if you are using VS Code, you must restart it to pick up modified environment variables.
- Verify the installation by running
./dbt --help
from the command line. If the help text doesn't indicate that you're using the dbt Cloud CLI, make sure you've deactivated your pyenv or venv and don't have a version of dbt globally installed.- You don't have to run the
dbt deps
command when your environment starts. Previously, you had to do it during initialization. However, you'll still need to rundbt deps
if you make changes to yourpackages.yml
file.
- You don't have to run the
Refer to the FAQs if your operating system runs into path conflicts.
Download the latest Linux release for your platform from GitHub. (Pick the file based on your CPU architecture)
Extract the
dbt-cloud-cli
binary to the same folder as your dbt project.tar -xf dbt_0.29.9_linux_amd64.tar.gz
./dbt --version
Advanced users can configure multiple projects to use the same Cloud CLI executable by adding it to their PATH environment variable in their shell profile.
- Verify the installation by running
./dbt --help
from the command line. If the help text doesn't indicate that you're using the dbt Cloud CLI, make sure you've deactivated your pyenv or venv and don't have a version of dbt globally installed.- You don't have to run the
dbt deps
command when your environment starts. Previously, you had to do it during initialization. However, you'll still need to rundbt deps
if you make changes to yourpackages.yml
file.
- You don't have to run the
Update dbt Cloud CLI
The following instructions explain how to update the dbt CLoud CLI to the latest version depending on your operating system.
During the public preview period, we recommend updating before filing a bug report. This is because the API is subject to breaking changes.
- Existing dbt Core users (pip)
- macOS (brew)
- Windows (executable)
- Linux (executable)
To update:
- Make sure you're in your virtual environment
- Run
pip install --upgrade dbt
.
To update the dbt Cloud CLI, run brew upgrade dbt
. (You can also use brew install dbt
).
To update, follow the same process explained in Windows and replace the existing dbt.exe
executable with the new one.
To update, follow the same process explained in Windows and replace the existing dbt
executable with the new one.
Next steps
After installation, you can configure the dbt Cloud CLI for your dbt Cloud project and use it to run dbt commands similar to dbt Core.
For example, you can execute dbt compile
to compile a project using dbt Cloud.
Note, that if you're using the dbt Cloud CLI, you can connect to your data platform directly in the dbt Cloud interface and don't need a profiles.yml
file.
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?
dbt
. This can create path conflicts if your operating system selects one over the other based on your $PATH environment variable (settings).If you have dbt Core installed locally, either:
Install using pip.
Install natively, but ensure that you deactivate your Python environment or uninstall it using
pip uninstall dbt
before proceeding.(Advanced users) Install natively, but modify the $PATH environment variable to correctly point to the dbt Cloud CLI binary to use both dbt Cloud CLI and dbt Core together.
You can always uninstall the dbt Cloud CLI to return to using dbt Core.