Skip to main content

ops dbt

dbt data transformation operations. All commands run against the dbt Cloud CLI (not dbt-core). The dbt project lives at ~/projects/data-warehouses/dbt_wasteology_warehouse.

Cloud CLI Only

This project uses dbt Cloud CLI (v0.40.14). Do NOT use dbt-core or pass --profiles-dir flags. The Cloud CLI detects the project via cwd (finds dbt_project.yml) and authenticates via ~/.dbt/dbt_cloud.yml.

Subcommandsโ€‹

SubcommandDescription
runRun dbt models
testRun dbt tests
buildBuild dbt models (run + test combined)
compileCompile dbt models without running
freshnessCheck source data freshness
lsList dbt resources
debugDebug dbt connection and configuration
docsGenerate dbt documentation
manifestShow dbt manifest information

Examplesโ€‹

Run all dbt models
Terminal
$ops dbt run
Run only staging models (dbt selector syntax)
Terminal
$ops dbt run --select staging.*
Run all dbt tests
Terminal
$ops dbt test
Build my_model and all its upstream dependencies
Terminal
$ops dbt build --select +my_model
Check source data freshness across all configured sources
Terminal
$ops dbt freshness
List all sources in the dbt project
Terminal
$ops dbt ls --type source
Verify dbt connection and configuration
Terminal
$ops dbt debug

Common Workflowsโ€‹

๐Ÿ”„

Daily Refresh

Use ops dbt build to run and test models in dependency order โ€” fails fast on broken tests.

๐Ÿงช

Iterate on a Model

ops dbt run --select my_model+ rebuilds a model and everything downstream of it.

๐Ÿ“ฆ

Source Audit

ops dbt ls --type source shows every declared source. Pair with freshness to spot stale tables.

๐Ÿ”

Troubleshooting

Start with ops dbt debug when something feels off โ€” it verifies auth, project resolution, and connectivity.

Selector Syntax

dbt's selector syntax is powerful: +model (upstream), model+ (downstream), +model+ (both), tag:nightly, staging.* (path glob). All work with run, test, build, and compile.

Output Format

The Cloud CLI prefixes stdout with timestamp logs (e.g. HH:MM:SS data). The ops dbt wrapper handles this automatically for JSON-returning commands like ls.