Skip to main content
On this page

Kater CLI Find and understand files

kater files search

Finds the lines that hold some text in one connection's files, as the Search on the Files page does.

Each match shows its file’s path from the content root, its line number and the line. Kater matches the text as you type it, in any case, not as a pattern.

Examples

Terminal window
# Find every line that mentions sum__spend in snowflake_prod_connection
kater files search sum__spend --connection snowflake_prod_connection
# Find at most 50 lines that mention paid media
kater files search "paid media" --connection snowflake_prod_connection --limit 50

Arguments

ArgumentDescription
<text>The text to find, from 1 to 256 characters. Case does not matter.

Options

OptionDescription
--connection <name>The connection, by its folder name under connections/, such as snowflake_prod_connection. Leave it out to use the connection that --scope names. Next, it uses the connection of your saved scope, or of the Files terminal’s folder. Last, it uses the only connection you can see.
--limit <n>The most matching lines to list, from 1 to 400. The default is 400.

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

What it searches

  • It searches only the files that you can read.
  • It skips the files that Kater writes from a model, which are contracts and dataset metadata. It searches the models themselves.
  • It shows a long line from just before its first match.
  • When more lines match than --limit allows, the last line says that more are not shown.

With --json, it returns the files.search answer. It groups the lines by file, and gives each match’s place in its line.

See also