dbt Commands Cheat Sheet
Complete Reference Guide
dbt –empty
Validates the sql without putting any data through it. Also validates dependencies.
dbt build –select ...
Full command:
dbt build –select <'modelname'> –exclude <'modelname'> –full-refresh
Runs through the models, but also applies tests to them; also includes snapshots and seeds.
dbt clean
Deletes files/folders specified in the clean-targets.
dbt clone
Create a duplicate of production tables without copying the data into your target schema.
dbt deps
Validates, clones and installs packages.
dbt docs generate
Generates the documentation.
dbt docs serve
Core only. Shows the documentation. Can specify port, using –port.
dbt parse
Parses and validates the contents of your dbt project, so if there are yaml or jinja syntax errors, they will be shown.
dbt retry
Re-execute the last dbt command, but just from the point of failure.
dbt run
Runs through the models specified.
dbt run –select ...
Full command:
dbt run –select <'modelname'> –exclude <'modelname'>
Runs just the specified model(s).
dbt run-operation
Full command:
dbt run-operation 'macro'
Runs a macro rather than running a sql script calling it.
dbt seed
Creates tables out of your seeds folder.
dbt snapshot
Runs your snapshots. Not included in dbt run.
dbt source freshness
Check the freshness of raw tables.
dbt test
Runs all the data tests configured against the latest materialisations of your models.
dbt test –select ...
Full command:
dbt test –select <:source| modelname| test_type:generic| test_type:singular>
Runs the tests configured on a specified data source, model, generic tests, or singular tests.