Skip to main content
On this page

Kater CLI Topics

Create commands

What the create commands have in common: a place to put the new object, a dry run first, and a create that you can run again.

kater new adds a new object to Kater content, with one command for each kind: kater new workspace, kater new query, kater new chart, kater new app, kater new semantic-model, kater new db-dataset and kater new kater-dataset. Each command takes only the options that work for its kind of object. kater new field, kater new test and kater new scratch make the other kinds, each in its own way.

Terminal window
# Go to a connection's folder in your local copy of Kater content
cd connections/snowflake_prod_connection
# See where a new semantic model can go, and the models it can start from
kater new options semantic_model --scope modeling
# See the file that a new semantic model would get, and write nothing
kater new semantic-model --target-path modeling/kater_objects/semantic_models/marketing --name google_ads_campaigns --base kater_dataset.google_ads__campaign_report --dry-run
# Make it
kater new semantic-model --target-path modeling/kater_objects/semantic_models/marketing --name google_ads_campaigns --base kater_dataset.google_ads__campaign_report

Find a place first

kater new options lists the folders where a new object can go, a free name, and the objects that you can start it from or copy. A workspace or an app takes its name as an argument. Every other create needs --name and --target-path. A path that starts with connections/ is from the content root, and any other path is from the folder you are in. Leave out --target-path, and a query or a chart goes in the workspace that you work in. A chart can also go in the workspace of its --source-query.

Do a dry run

--dry-run shows the file that the command would write, its name and its revisions, and writes nothing. A dry run can propose a place and a name, so you can give --scope in place of --target-path, and leave out --name.

Check that nothing changed since the dry run

With --json, a dry run gives its revisions in witnesses. Give them to the create with the revision options, such as --namespace-revision. The create then stops when a file that it reads changed after the dry run. Each command takes only the revisions that its own dry run can give. The revision options work only on a create that writes, not with --dry-run.

Run a create again

--reuse-existing lets you run the same create again, such as after a timeout. When the file already holds exactly what the create would write, the create succeeds and writes nothing. Other content still stops it.

Shared datasets and semantic models go in connections/<connection>/modeling/kater_objects/. See Workspaces.