# About dbt ls (list) command

The `dbt ls` command lists resources in your dbt project. It accepts selector arguments that are similar to those provided in [dbt run](./run.md). `dbt list` is an alias for `dbt ls`. While `dbt ls` will read your [connection profile](../../docs/local/profiles.yml.md) to resolve [`target`](../dbt-jinja-functions/target.md)-specific logic, this command will not connect to your database or run any queries.

(Applies to dbt v2.0 and later)

In dbt platform run logs when using dbt Fusion engine, `dbt ls` and `dbt list` node results can appear as **No-op** when there is no final status. This replaces **Unknown** and indicates that dbt selected the node but did not run it.

### Usage

```text
dbt ls
     [--resource-type {model,semantic_model,source,seed,snapshot,metric,test,exposure,analysis,function,default,all}]
     [--select SELECTION_ARG [SELECTION_ARG ...]]
     [--models SELECTOR [SELECTOR ...]]
     [--exclude SELECTOR [SELECTOR ...]]
     [--selector YML_SELECTOR_NAME] # legacy flag; use `--select selector:SELECTOR_NAME` in v1.12+
     [--output {json,name,path,selector}]
     [--output-keys KEY_NAME [KEY_NAME]]
```

Refer to [resource selection syntax](../node-selection/syntax.md) for more information on how to select resources in dbt

**Arguments**:

* `--resource-type`: This flag restricts the "resource types" returned by dbt in the `dbt ls` command. By default, all resource types are included in the results of `dbt ls` except for the analysis type.
* `--select`: This flag specifies one or more selection-type arguments used to filter the nodes returned by the `dbt ls` command
* `--models`: Like the `--select` flag, this flag is used to select nodes. It implies `--resource-type=model`, and will only return models in the results of the `dbt ls` command. Supported for backwards compatibility only.
* `--exclude`: Specify selectors that should be *excluded* from the list of returned nodes.

- `--output`: This flag controls the format of output from the `dbt ls` command.
- `--output-keys`: If `--output json`, this flag controls which node properties are included in the output.

Note that the `dbt ls` command does not include models which are disabled or schema tests which depend on models which are disabled. All returned resources will have a `config.enabled` value of `true`.

### Example usage

The following examples show how to use the `dbt ls` command to list resources in your project.

* [Listing models by package](#listing-models-by-package)
* [Listing tests by tag name](#listing-tests-by-tag-name)
* [Listing schema tests of incremental models](#listing-schema-tests-of-incremental-models)
* [Listing JSON output](#listing-json-output)
* [Listing JSON output with custom keys](#listing-json-output-with-custom-keys)
* [Listing semantic models](#listing-semantic-models)
* [Listing functions](#listing-functions)

#### Listing models by package

```bash
dbt ls --select snowplow.*
snowplow.snowplow_base_events
snowplow.snowplow_base_web_page_context
snowplow.snowplow_id_map
snowplow.snowplow_page_views
snowplow.snowplow_sessions
...
```

#### Listing tests by tag name

```bash
dbt ls --select tag:nightly --resource-type test
my_project.schema_test.not_null_orders_order_id
my_project.schema_test.unique_orders_order_id
my_project.schema_test.not_null_products_product_id
my_project.schema_test.unique_products_product_id
...
```

#### Listing schema tests of incremental models

```bash
dbt ls --select config.materialized:incremental,test_type:schema
model.my_project.logs_parsed
model.my_project.events_categorized
```

#### Listing JSON output

```bash
dbt ls --select snowplow.* --output json
{"name": "snowplow_events", "resource_type": "model", "package_name": "snowplow",  ...}
{"name": "snowplow_page_views", "resource_type": "model", "package_name": "snowplow",  ...}
...
```

#### Listing JSON output with custom keys

```bash
dbt ls --select snowplow.* --output json --output-keys "name resource_type description"
{"name": "snowplow_events", "description": "This is a pretty cool model",  ...}
{"name": "snowplow_page_views", "description": "This model is even cooler",  ...}
...
```

#### Listing semantic models

List all resources upstream of your orders semantic model:

```bash
dbt ls -s +semantic_model:orders
```

#### Listing file paths

```bash
dbt ls --select snowplow.* --output path
models/base/snowplow_base_events.sql
models/base/snowplow_base_web_page_context.sql
models/identification/snowplow_id_map.sql
...
```

#### Listing functions

List all functions in your project:

```bash
dbt list --select "resource_type:function" # or dbt ls --resource-type function
jaffle_shop.area_of_circle
jaffle_shop.whoami
```

## Was this page helpful?

YesNo

[Privacy policy](https://www.getdbt.com/cloud/privacy-policy)[Create a GitHub issue](https://github.com/dbt-labs/docs.getdbt.com/issues)

This site is protected by reCAPTCHA and the Google [Privacy Policy](https://policies.google.com/privacy) and [Terms of Service](https://policies.google.com/terms) apply.
