dbt ls is a command-line utility that lists resources in a dbt project, enabling fast inventory, filtering, and automation.
dbt ls outputs the names of models, seeds, snapshots, tests, macros, and exposures in a dbt project. It reads the compiled manifest and prints matching nodes, giving teams an instant inventory without running heavy build commands.
Automating resource discovery with dbt ls eliminates error-prone manual scans of folders or YAML files.The command runs in milliseconds, works in CI, and guarantees alignment with the manifest used at run-time.
When you execute dbt ls, dbt parses dbt_project.yml, loads the target profile, compiles SQL, and consults the manifest.json.It then applies filters such as resource type, tag, path, or selection syntax before printing node identifiers.
Teams use dbt ls to power CI diff checks, generate documentation stubs, validate pull-request scopes, feed downstream orchestration tools, and audit tag coverage across large projects.
Pass the resource flag:
dbt ls --resource-type model
dbt returns model names like mart_user_activity, ready to feed into dbt run or Galaxys AI copilot for query generation.
Combine selection syntax and flags:
dbt ls --select tag:critical,tag:p1
Only resources tagged critical or p1 appear, supporting risk-based deployments.
Use dbt ls to detect changed nodes: dbt ls --state .--select state:modified
. Feed the result into dbt run -m -f
to run only modified models, reducing CI time dramatically.
Run from the project root, pin dbt versions across environments, cache manifest artifacts, and redirect output to files for deterministic downstream processing.
Avoid parsing human-readable output; use --output json
instead. Ensure selection strings are quoted in shell scripts to prevent globbing.
.
dbt ls underpins automated data-ops workflows. By surfacing an authoritative list of resources, it lets engineers trigger incremental builds, validate pull requests, and measure project growth without slow dbt run executions. The commands speed and selection syntax make it ideal for CI/CD, enabling teams to ship analytics code confidently.
No. dbt ls is a read-only command; it inspects project metadata and never executes SQL against your data warehouse.
Yes. Use --state path/to/dir
to compare current code with a manifest from a previous run, perfect for CI diffing.
Galaxys SQL editor can consume the JSON output of dbt ls to auto-generate exploratory queries, letting developers jump from model names to runnable SQL in one click.
Yes. In dbt Cloud jobs or IDE, you can run dbt ls commands just like in the open-source CLI.