Course Overview
DBT For Data Engineers

Using The DBT Command Line Interface

Lesson #3

In this lesson we will:

  • Begin to use the dbt binary for some simple operations outside of the context of a specific project.

The DBT Executable

We can begin by simply running the dbt command to check for a correct installation:


Amongst the output you will see that we have a number of sub commands which perform different activities such as initialising projects, executing your DBT models, loading seed data and executing tests.

Available sub-commands:
    docs                Generate or serve the documentation website for your project.
    source              Manage your project's sources
    init                Initialize a new DBT project.
    clean               Delete all folders in the clean-targets list (usually the dbt_packages and target directories.)
    debug               Show some helpful information about dbt for debugging. Not to be confused with the --debug option which increases verbosity.
    deps                Pull the most recent version of the dependencies listed in packages.yml
    list (ls)           List the resources in your project
    build               Run all Seeds, Models, Snapshots, and tests in DAG order
    snapshot            Execute snapshots defined in your project
    run                 Compile SQL and execute against the current target database.
    compile             Generates executable SQL from source, model, test, and analysis files. Compiled SQL files are written to the target/ directory.
    parse               Parses the project and provides information on performance
    test                Runs tests on data in deployed models. Run this after `dbt run`
    seed                Load data from csv files into your data warehouse.
    run-operation       Run the named macro with any supplied arguments.

Command Line Help

For each of these sub commands, you can use the help flag to better understand the required parameters for each one:

dbt build --help
dbt test --help
dbt source --help
dbt compile --help

Though you will quickly get used to the most common operations for building, testing and running your models, this online help is useful whilst learning DBT and moving into new areas.


The version flag shows the installed version of dbt and if you are running on an out of date version. It also shows the status of the individual warehouse adapters.

dbt --version


  - installed: 1.4.1
  - latest:    1.4.1 - Up to date!

  - postgres: 1.4.1 - Up to date!

Ordinarily these versions will stay in line when you upgrade DBT, but there may be situation where we you need to remain on a certain version of a warehouse adapter but move forward with the DBT version as your codebase matures. For now, it is worth being aware that there is both a DBT version and a warehouse adapter version.

Because DBT is evolving very quickly, it is worth attempting to stay on the latest version where possible to have the most stable experience and avoid difficult upgrades later on.

Creating A Project

Most of the other DBT command line interactions require a project. In the next lab we will create a project then continue with our exploration of the DBT command line options.

Next Lesson:

Creating A DBT Project

In this lesson we will use the DBT Command Line Interface to create and configure our first DBT project.

0h 15m

Continuous Delivery For Data Engineers

This site has been developed by the team behind Timeflow, an Open Source CI/CD platform designed for Data Engineers who use dbt as part of the Modern Data Stack. Our platform helps Data Engineers improve the quality, reliability and speed of their data transformation pipelines.

Join our mailing list for our latest insights on Data Engineering:

Timeflow Academy is the leading online, hands-on platform for learning about Data Engineering using the Modern Data Stack. Bought to you by Timeflow CI

© 2023 Timeflow Academy. All rights reserved