Skip to main content

dbt Command reference

You can run dbt using the following tools:

A key distinction with the tools mentioned, is that dbt Cloud CLI and IDE are designed to support safe parallel execution of dbt commands, leveraging dbt Cloud's infrastructure and its comprehensive features. In contrast, dbt-core doesn't support safe parallel execution for multiple invocations in the same process. Learn more in the parallel execution section.

Parallel execution

dbt Cloud allows for concurrent execution of commands, enhancing efficiency without compromising data integrity. This enables you to run multiple commands at the same time. However, it's important to understand which commands can be run in parallel and which can't.

In contrast, dbt-core doesn't support safe parallel execution for multiple invocations in the same process, and requires users to manage concurrency manually to ensure data integrity and system stability.

To ensure your dbt workflows are both efficient and safe, you can run different types of dbt commands at the same time (in parallel) — for example, dbt build (write operation) can safely run alongside dbt parse (read operation) at the same time. However, you can't run dbt build and dbt run (both write operations) at the same time.

dbt commands can be read or write commands:

Command typeDescription
Example
WriteThese commands perform actions that change data or metadata in your data platform.

Limited to one invocation at any given time, which prevents any potential conflicts, such as overwriting the same table in your data platform at the same time.
dbt build
dbt run
ReadThese commands involve operations that fetch or read data without making any changes to your data platform.

Can have multiple invocations in parallel and aren't limited to one invocation at any given time. This means read commands can run in parallel with other read commands and a single write command.
dbt parse
dbt compile

Available commands

The following sections outline the commands supported by dbt and their relevant flags. They are available in all tools and all supported versions unless noted otherwise. You can run these commands in your specific tool by prefixing them with dbt — for example, to run the test command, type dbt test.

For information about selecting models on the command line, refer to Model selection syntax.

Commands with a ('❌') indicate write commands, commands with a ('✅') indicate read commands, and commands with a (N/A) indicate it's not relevant to the parallelization of dbt commands.

CommandDescriptionParallel execution
Caveats
buildBuild and test all selected resources (models, seeds, snapshots, tests)All tools
All supported versions
cancelCancels the most recent invocation.N/Adbt Cloud CLI
Requires dbt v1.6 or higher
cleanDeletes artifacts present in the dbt projectAll tools
All supported versions
cloneClone selected models from the specified stateAll tools
Requires dbt v1.6 or higher
compileCompiles (but does not run) the models in a projectAll tools
All supported versions
debugDebugs dbt connections and projectsdbt Cloud IDE, dbt Core
All supported versions
depsDownloads dependencies for a projectAll tools
All supported versions
docsGenerates documentation for a projectAll tools
All supported versions
environmentEnables you to interact with your dbt Cloud environment.N/Adbt Cloud CLI
Requires dbt v1.5 or higher
helpDisplays help information for any commandN/Adbt Core, dbt Cloud CLI
All supported versions
initInitializes a new dbt projectdbt Core
All supported versions
listLists resources defined in a dbt projectAll tools
All supported versions
parseParses a project and writes detailed timing infoAll tools
All supported versions
reattachReattaches to the most recent invocation to retrieve logs and artifacts.N/Adbt Cloud CLI
Requires dbt v1.6 or higher
retryRetry the last run dbt command from the point of failureAll tools
Requires dbt v1.6 or higher
runRuns the models in a projectAll tools
All supported versions
run-operationInvoke a macro, including running arbitrary maintenance SQL against the databaseAll tools
All supported versions
seedLoads CSV files into the databaseAll tools
All supported versions
showPreview table rows post-transformationAll tools
All supported versions
snapshotExecutes "snapshot" jobs defined in a projectAll tools
All supported versions
sourceProvides tools for working with source data (including validating that sources are "fresh")All tools
All supported versions
testExecutes tests defined in a projectAll tools
All supported versions
Note, use the --version flag to display the installed dbt Core or dbt Cloud CLI version. (Not applicable for the dbt Cloud IDE). Available on all supported versions.
0