Skip to main content
On this page

Kater CLI Your terminal scope

kater scope use

Saves the folder or model that your commands work on.

Commands that name no --scope then use it, until you save another one.

Examples

Terminal window
# Work in the ad_reporting workspace
kater scope use connections/snowflake_prod_connection/workspaces/ad_reporting
# Work on one saved query
kater scope use connections/snowflake_prod_connection/workspaces/ad_reporting/query_contracts/spend_by_platform.sql
# Work on the ad_reporting semantic model in the shared layer
kater scope use connections/snowflake_prod_connection/modeling --model semantic.ad_reporting

Arguments

ArgumentDescription
<path>The place to work in: a workspace, a connection’s modeling folder or a folder in it, or one SQL file. Any other folder must hold SQL files that you can read. A path is relative to the folder you are in.

Options

OptionDescription
--model-type <kind>The kind of model you expect: db_dataset, kater_dataset, semantic, workspace, query or chart. The command stops when the model you select is of another kind.
--model <model>One model in PATH to work on. Give its name, its typed address such as semantic.ad_reporting, or the id that kater model list shows.

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

Select one model

  • A SQL file that holds one model selects that model.
  • For a file with more than one model, or for a folder, add --model.
  • A folder alone is a place to browse, not a model to edit. See Active authoring scope.

What it saves

  • One file. It writes ~/.kater/scope.json in your home folder. KATER_CONFIG_DIR does not move it.
  • The place, not the text. It keeps the content root, the workspace or connection, the layer and the model you selected. It never keeps the text of a file.
  • The content root too. A command that names no path and no --kater-root works in that content root, even from another folder.
  • When it moves. When the place moves, or you lose access to it, commands stop and ask you to run kater scope use again.

See also