dbt-commands

Execute dbt commands and select models by name, tag, folder, or pattern.

34|13|Updated Feb 1, 2022
One-click install
npx skills add https://github.com/sfc-gh-dflippo/snowflake-dbt-demo --skill dbt-commands
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dbt-commands
Source: https://github.com/sfc-gh-dflippo/snowflake-dbt-demo/tree/main/.claude/skills/dbt-commands
Command: npx skills add https://github.com/sfc-gh-dflippo/snowflake-dbt-demo --skill dbt-commands

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates confusion around dbt command-line operations by providing comprehensive guidance on model selection, Jinja patterns, and troubleshooting techniques.

Core Features & Use Cases

  • Command Execution: Expert guidance on running dbt commands like build, run, test, and compile with proper flags and options.
  • Model Selection: Advanced syntax for selecting specific models, tags, folders, and dependencies.
  • Use Case: Imagine you need to run only the gold layer models and their dependencies in production. Use this Skill to generate the exact dbt command with proper selection syntax and target configuration.

Quick Start

Use the dbt-commands skill to show me how to run just the dim_customers model along with all its upstream dependencies.

Frequently Asked Questions about dbt-commands

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run specific dbt models without executing the entire project?

Use dbt's model selection syntax to target specific models by name, tag, folder, or pattern. For example, `dbt run -s dim_customers` runs a single model, while `dbt run -s tag:daily` runs all models tagged 'daily'. This lets you execute only the models you need without running the full build.

What's the correct dbt command to run a model and all its upstream dependencies?

Use the `+` selector to include upstream dependencies: `dbt run -s +dim_customers` runs the model plus everything it depends on. The `dbt build` command also respects dependencies and executes in the correct order, handling both models and tests.

How do I debug dbt compilation errors with Jinja templates?

Run `dbt compile` to generate compiled SQL and identify Jinja macro errors without executing models. Check the `target/compiled` folder for the rendered SQL, review the error message for template syntax issues, and use `dbt debug` to verify project configuration and database connectivity.

Can I run dbt tests on specific models or tags?

Yes, use model and tag selection with `dbt test`: `dbt test -s dim_customers` tests only that model, and `dbt test -s tag:critical` runs tests for all models with the critical tag. This narrows test execution to relevant subsets of your data pipeline.

What flags should I use when running dbt commands in production?

Use `--profiles-dir` to specify credential location, `--target` to select environment, `--threads` to control parallelism, and `--fail-fast` to stop on first error. Combine with selection syntax like `dbt run -s tag:prod_only` to control exactly which models execute in production.

How do I generate and view dbt documentation from the command line?

Run `dbt docs generate` to create documentation artifacts, then `dbt docs serve` to view the generated docs locally. This exposes your model lineage, column descriptions, and test coverage—useful for understanding data pipeline dependencies and documentation.