dbt - Documentation

Command Line Interface (CLI)

dbt is typically run by executing commands on the command line. The following sections outline the commands supported by dbt and their relevant flags.

For information about selecting models on the command line, consult the docs on Model selection syntax.

Available commands:

  • debug: debugs dbt connections and projects
  • init: initializes a new dbt project
  • compile: compiles (but does not run) the models in a project
  • run: runs the models in a project
  • test: executes tests defined in a project
  • deps: downloads dependencies for a project
  • version: prints the version of dbt installed on the system
  • snapshot: executes "snapshot" jobs defined in a project
  • clean: deletes artifacts present in the dbt project
  • seed: loads CSV files into the database
  • docs: generates documentation for a project
  • source: provides tools for working with source data (including validating that sources are "fresh")
  • run-operation: runs arbitrary maintenance SQL against the database
  • rpc: runs an RPC server that clients can submit queries to
  • list: lists resources defined in a dbt project

Available Flags

  • --project-dir: Says which directory to look in for the dbt_project.yml file. Default is the current working directory and its parents.
  • --profiles-dir: Which directory to look in for the profiles.yml file. Default is `~/.dbt/
  • --profile: Which profile to load. Overrides setting in dbt_project.yml.
  • --target: Which target to load for the given profile.
  • --vars: Supply variables to the project. This argument overrides variables defined in your dbt_project.yml file.
  • --log-cache-events: argparse.SUPPRESS,
  • --bypass-cache: If set, bypass the adapter-level cache of database state.

These can also be seen by running dbt --help.

Command Line Interface (CLI)


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.