- Home
- Skills
- Dbt Labs
- Dbt Agent Skills
- Running Dbt Commands
running-dbt-commands_skill
- Python
152
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill dbt-labs/dbt-agent-skills --skill running-dbt-commands- SKILL.md5.8 KB
Overview
This skill helps agents construct and run dbt CLI commands safely and predictably. It codifies best practices for selecting models, choosing the correct dbt flavor, passing variables, and interpreting run results so commands behave as users expect.
How this skill works
The skill inspects the desired action (build, run, test, show, list) and builds a recommended dbt CLI invocation with safe defaults: explicit --select, --quiet plus warn-error options, and appropriate flags for vars, limits, full-refresh, defer/state, or static analysis. It also guides which dbt executable to use (core, fusion, or cloud CLI) and how to preview selections with dbt list before executing.
When to use it
- When running or testing specific models and you need a safe, explicit CLI command
- When unsure which dbt executable (dbt, dbtf, or platform CLI) to invoke
- When previewing which resources a selector will target before executing
- When passing variables, limits, or full-refresh options to dbt commands
- When you want to defer upstream builds to production artifacts or favor state
Best practices
- Always include an explicit --select; never run the whole project without approval
- Prefer dbt build (runs + tests) over running test alone after model changes
- Use --quiet with --warn-error-options '{"error": ["NoNodesForSelectionCriteria"]}' to catch selector typos while minimizing noise
- Preview targeted nodes with dbt list --select <selector> (use --output json for programmatic checks)
- Ask which dbt CLI flavor to use; use dbtf or ~/.local/bin/dbt for Fusion if available
Example use cases
- Build a single model and its downstream models: dbt build --select stg_orders+ --quiet --warn-error-options '{"error": ["NoNodesForSelectionCriteria"]}'
- Preview selection output before running: dbt list --select my_model+ --resource-type model --output json
- Inspect sample rows from a model: dbt show --select my_model --limit 10
- Run an inline SQL preview: dbt show --inline "select * from {{ ref('orders') }}" --limit 5
- Run using production artifacts for deferral: dbt build --select my_model --defer --state prod-artifacts --favor-state
FAQ
If unsure, ask the user. Common setups: dbt Core in a virtualenv (command dbt), Fusion installed at ~/.local/bin/dbt or dbtf (use dbtf for Fusion), or the cloud CLI at ~/.local/bin/dbt.
Why prefer build over run or test?
dbt build performs both run and test for each node and refreshes models; test alone does not rebuild models after changes.