Skip to main content
On this page

Kater CLI Build and check

kater ls

Lists the models and tests that a selection selects, one on each line, as dbt ls does.

Use it to check a selection before you give it to kater run, kater compile or kater test. It reads the declarations only, sends nothing to the warehouse and changes none of your files.

Examples

Terminal window
# Go to a workspace in your local copy of Kater content
cd connections/snowflake_prod_connection/workspaces/ad_reporting
# List the query, its workspace root, the semantic model it reads and its datasets
kater ls --select +query_contracts/spend_by_platform.sql
# List the queries and charts that read the query
kater ls --select query_contracts/spend_by_platform.sql+ --output name
# List the tests of the shared ad_reporting model
kater ls --select semantic.ad_reporting --resource-type test
# List what this branch changed since it left main, and what reads it
kater ls --select state:modified+ --state git:main

Options

OptionDescription
-s, --select <selection>What to list. Leave it out to list every model and test in the project. See Selecting models. You can give it more than one time.
--exclude <selection>What to leave out of the list, in the same words as --select. You can give it more than one time.
--state <state>What state:modified and state:new compare with: a folder that holds an earlier manifest.json, or git:REF, such as git:main.
--resource-type <type>Lists only the nodes of this kind: query, chart, semantic, kater_dataset, db_dataset, workspace or test. You can give it more than one time.
--output <format>What each line shows: selector, name, path or json. The default is selector.

It also takes the global options --json, --kater-root, --scope and --help.

What it prints

The nodes come in the order of their files. With --output selector, each line is a selection that names that node alone: its typed address, TYPE.NAME, such as query.spend_by_platform. When two nodes of one kind have the same name, as two workspaces in different connections can, the line also names the file, path:FILE,TYPE.NAME. You can give any line to --select as it is. name prints the node’s name, path its file, and json the node as one JSON line, with the keys of the manifest.

See also