CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-dbt-core

A command-line tool for data transformation and analytics engineering workflows.

Pending
Overview
Eval results
Files

cli-commands.mddocs/

CLI Commands

dbt provides a comprehensive command-line interface with commands for project lifecycle management, data transformation, testing, and documentation. All commands are accessible via the dbt console script.

Core Commands

build

Runs all seeds, models, snapshots, and tests in DAG order - the comprehensive execution command.

dbt build [options]

Options:
  --exclude TEXT           Exclude resources by name or selector
  --full-refresh          Drop and recreate incremental models  
  --select TEXT           Select resources by name or selector
  --threads INTEGER       Number of threads to use
  --profiles-dir PATH     Directory containing profiles.yml
  --project-dir PATH      Directory containing dbt_project.yml
  --target TEXT          Target profile to use
  --vars TEXT            Supply variables as YAML string

run

Compiles SQL and executes models against the target database.

dbt run [options]

Options:
  --exclude TEXT           Exclude models by name or selector
  --full-refresh          Drop and recreate incremental models
  --select TEXT           Select models by name or selector  
  --threads INTEGER       Number of threads to use
  --profiles-dir PATH     Directory containing profiles.yml
  --project-dir PATH      Directory containing dbt_project.yml
  --target TEXT          Target profile to use
  --vars TEXT            Supply variables as YAML string

test

Runs tests on deployed models to validate data quality.

dbt test [options]

Options:
  --exclude TEXT           Exclude tests by name or selector
  --select TEXT           Select tests by name or selector
  --resource-type TEXT    Run only specified resource types
  --store-failures        Store test failures in database tables
  --threads INTEGER       Number of threads to use
  --profiles-dir PATH     Directory containing profiles.yml
  --project-dir PATH      Directory containing dbt_project.yml
  --target TEXT          Target profile to use
  --vars TEXT            Supply variables as YAML string

compile

Generates executable SQL from source, model, test, and analysis files without execution.

dbt compile [options]

Options:
  --exclude TEXT           Exclude resources by name or selector
  --select TEXT           Select resources by name or selector
  --full-refresh          Treat incremental models as table models
  --threads INTEGER       Number of threads to use
  --profiles-dir PATH     Directory containing profiles.yml
  --project-dir PATH      Directory containing dbt_project.yml
  --target TEXT          Target profile to use
  --vars TEXT            Supply variables as YAML string

Project Management Commands

init

Initializes a new dbt project with starter files and directory structure.

dbt init [project_name] [options]

Arguments:
  project_name            Name of project to create (optional)

Options:
  --profiles-dir PATH     Directory for profiles.yml
  --project-dir PATH      Directory to create project in
  --skip-profile-setup    Skip interactive profile setup

deps

Installs dbt packages specified in packages.yml or dependencies.yml.

dbt deps [options]

Options:
  --profiles-dir PATH     Directory containing profiles.yml  
  --project-dir PATH      Directory containing dbt_project.yml
  --source TEXT          Package source (hub, git, local)
  --lock                 Generate package-lock.yml file
  --upgrade              Upgrade packages to latest versions
  --add-package TEXT     Add package in format name@version

clean

Deletes all folders in the clean-targets list (usually target/ and dbt_packages/).

dbt clean [options]

Options:
  --profiles-dir PATH     Directory containing profiles.yml
  --project-dir PATH      Directory containing dbt_project.yml
  --clean-project-files-only  Clean only project files, not profiles

parse

Parses the project and provides performance information about parsing time.

dbt parse [options]

Options:
  --profiles-dir PATH     Directory containing profiles.yml
  --project-dir PATH      Directory containing dbt_project.yml
  --target TEXT          Target profile to use
  --threads INTEGER       Number of threads to use
  --vars TEXT            Supply variables as YAML string

Data Management Commands

seed

Loads CSV files from the data/ directory into the data warehouse.

dbt seed [options]

Options:
  --exclude TEXT           Exclude seeds by name or selector
  --select TEXT           Select seeds by name or selector
  --full-refresh          Drop and recreate seed tables
  --show                  Show sample of loaded data
  --threads INTEGER       Number of threads to use
  --profiles-dir PATH     Directory containing profiles.yml
  --project-dir PATH      Directory containing dbt_project.yml
  --target TEXT          Target profile to use
  --vars TEXT            Supply variables as YAML string

snapshot

Executes snapshots defined in the project to capture changing data over time.

dbt snapshot [options]

Options:
  --exclude TEXT           Exclude snapshots by name or selector
  --select TEXT           Select snapshots by name or selector
  --threads INTEGER       Number of threads to use
  --profiles-dir PATH     Directory containing profiles.yml
  --project-dir PATH      Directory containing dbt_project.yml
  --target TEXT          Target profile to use
  --vars TEXT            Supply variables as YAML string

clone

Creates clones of selected nodes based on their location in the state manifest.

dbt clone [options]

Options:
  --exclude TEXT           Exclude resources by name or selector
  --select TEXT           Select resources by name or selector
  --full-refresh          Force full refresh of cloned models
  --threads INTEGER       Number of threads to use
  --profiles-dir PATH     Directory containing profiles.yml
  --project-dir PATH      Directory containing dbt_project.yml
  --target TEXT          Target profile to use
  --vars TEXT            Supply variables as YAML string

Documentation Commands

docs generate

Generates the documentation website for the project including model lineage and descriptions.

dbt docs generate [options]

Options:
  --exclude TEXT           Exclude resources from documentation
  --select TEXT           Select resources for documentation
  --compile-docs          Compile docs blocks in models
  --empty-catalog         Skip catalog generation (faster)
  --static                Generate static files only
  --threads INTEGER       Number of threads to use
  --profiles-dir PATH     Directory containing profiles.yml
  --project-dir PATH      Directory containing dbt_project.yml
  --target TEXT          Target profile to use
  --vars TEXT            Supply variables as YAML string

docs serve

Serves the documentation website locally on a web server.

dbt docs serve [options]

Options:
  --browser              Open browser automatically
  --host TEXT            Host address to bind (default: localhost)
  --port INTEGER         Port to serve on (default: 8080)
  --profiles-dir PATH     Directory containing profiles.yml
  --project-dir PATH      Directory containing dbt_project.yml

Utility Commands

list / ls

Lists resources in the project based on selection criteria.

dbt list [options]
dbt ls [options]  # alias

Options:
  --exclude TEXT           Exclude resources by name or selector
  --select TEXT           Select resources by name or selector
  --resource-type TEXT    Filter by resource type
  --output TEXT           Output format (name, json, path)
  --output-keys TEXT      Keys to include in output
  --profiles-dir PATH     Directory containing profiles.yml
  --project-dir PATH      Directory containing dbt_project.yml
  --target TEXT          Target profile to use
  --vars TEXT            Supply variables as YAML string

show

Generates executable SQL for a resource or inline query and returns a preview of results without materialization.

dbt show [options]

Options:
  --exclude TEXT           Exclude resources by name or selector
  --select TEXT           Select resources by name or selector
  --inline TEXT           Inline SQL query to execute
  --limit INTEGER         Limit number of rows returned
  --threads INTEGER       Number of threads to use
  --profiles-dir PATH     Directory containing profiles.yml
  --project-dir PATH      Directory containing dbt_project.yml
  --target TEXT          Target profile to use
  --vars TEXT            Supply variables as YAML string

debug

Shows information about the dbt environment and tests database connection.

dbt debug [options]

Options:
  --connection           Test database connection only
  --config-dir PATH      Config directory path
  --profiles-dir PATH     Directory containing profiles.yml
  --project-dir PATH      Directory containing dbt_project.yml
  --vars TEXT            Supply variables as YAML string

retry

Retries nodes that failed in the previous run based on run_results.json.

dbt retry [options]

Options:
  --profiles-dir PATH     Directory containing profiles.yml
  --project-dir PATH      Directory containing dbt_project.yml
  --threads INTEGER       Number of threads to use
  --full-refresh          Force full refresh of retried models
  --target TEXT          Target profile to use
  --vars TEXT            Supply variables as YAML string

run-operation

Executes a named macro with optional arguments.

dbt run-operation <macro_name> [options]

Arguments:
  macro_name              Name of macro to execute

Options:
  --args TEXT            Arguments to pass to macro as YAML
  --profiles-dir PATH     Directory containing profiles.yml
  --project-dir PATH      Directory containing dbt_project.yml
  --threads INTEGER       Number of threads to use
  --target TEXT          Target profile to use
  --vars TEXT            Supply variables as YAML string

Source Commands

source freshness

Checks the freshness of project sources against defined freshness criteria.

dbt source freshness [options]

Options:
  --exclude TEXT           Exclude sources by name or selector
  --select TEXT           Select sources by name or selector
  --output-path PATH      Path to write freshness results
  --threads INTEGER       Number of threads to use
  --profiles-dir PATH     Directory containing profiles.yml
  --project-dir PATH      Directory containing dbt_project.yml
  --target TEXT          Target profile to use
  --vars TEXT            Supply variables as YAML string

Global Options

All commands support these global options:

Global Options:
  --debug                Enable debug logging
  --log-level TEXT       Log level (debug, info, warn, error)
  --log-path PATH        Path for log files
  --no-write-json        Skip writing run_results.json
  --quiet               Suppress non-error output
  --warn-error          Treat warnings as errors
  --use-colors / --no-use-colors  Enable/disable colored output
  --version             Show version information
  --help               Show help message

Usage Examples

# Complete project build
dbt build --threads 4

# Run specific models
dbt run --select my_model+

# Run all changed models  
dbt run --select state:modified+

# Test data quality
dbt test --store-failures

# Generate and serve docs
dbt docs generate
dbt docs serve --port 8080

# Debug connection issues
dbt debug --connection

Install with Tessl CLI

npx tessl i tessl/pypi-dbt-core

docs

artifacts.md

cli-commands.md

configuration.md

exceptions.md

index.md

programmatic-api.md

version.md

tile.json