Kater CLI Delete and restore
kater rm
Deletes objects, files and folders, as Delete in Kater does.
Each path is one change, and each delete goes to the Trash for 30 days. Run it with --dry-run first: it shows the plan that the Delete dialog shows, and changes nothing.
Examples
# Go to the snowflake_prod_connection connectioncd connections/snowflake_prod_connection# See what the delete of the paid_media_ad_groups query affects, and Kater's plan for each part. Nothing changes.kater rm workspaces/ad_reporting/query_contracts/paid_media_ad_groups.sql --dry-run# Delete the query, with its chart and its tile, in one changekater rm workspaces/ad_reporting/query_contracts/paid_media_ad_groups.sql# Delete the query, and keep the dashboard's tile as it is: it shows Not available until someone fixes itkater rm workspaces/ad_reporting/query_contracts/paid_media_ad_groups.sql --part connections/snowflake_prod_connection/workspaces/ad_reporting/dashboard.yaml#connections/snowflake_prod_connection/workspaces/ad_reporting/dashboard.yaml:866=keep# Delete two charts, each as a change of its ownkater rm workspaces/ad_reporting/charts/spend_mix.sql workspaces/ad_reporting/charts/clicks_impressions_by_week.sql# See the delete of a shared field, with engaged_sessions in its placekater rm modeling/kater_objects/semantic_models/marketing/MARKETING_SESSIONS.sql#sessions --replace-with engaged_sessions --dry-run# Delete a workspace of your own, with its queries, its charts and its dashboard, and tell the people who used itkater rm users/yvonne@kater.ai/workspaces/lifecycle_brief_paid_media --tellArguments
Options
It also takes the global options --json, --kater-root and --help.
What goes with it
- What goes with it. A query goes with its charts and their tiles. A workspace goes with its queries, its charts and its dashboard. A folder goes with everything in it.
- What reads it stays. For each object that reads it, Kater removes each part that stands on its own, such as a chart or a follow-up, and a figure shows Not available.
--partand--replace-withchange this for a part. - Kater keeps rows with it. Rows such as its grants and pins stay with the delete, and come back when you restore it.
- A field or a model of the shared layer can be retired in place of a delete. The plan says so, and
kater retirekeeps it working for what reads it.
When Kater stops
Kater prepares every path first. When one cannot go as asked, nothing is deleted.
- Kater cannot decide what happens to a part. The command names the part. Give it a fix with
--part, or let Kater select its guess with--pick-anyway. - Nothing has that name.
--replace-withnames something that cannot read in its place. The command lists what can. - Kater refuses the path. Kater says why, such as a file that you cannot change.
- Kater is still looking. Kater looks for every place that reads a field or a model of the shared layer, and the command waits for up to 10 minutes. When the search takes longer, run the same command again in a minute.
- You are not signed in. In your own terminal, the delete runs in Kater, so it needs
kater login.
What it answers
For each path, it gives what it deleted and what went with it, what Kater changed in what reads it, and the delete’s id in the Trash. The last lines give the command that restores it, such as kater restore 3f1c9a20-5b7e-4d21-9a0e-1c2d3e4f5a6b, and the command that takes the change back, such as kater undo ch_3f9a21c0d4e5. When a part still shows Not available, it gives the kater trash fix command that fixes it. When Kater still writes the delete, it says so and gives the change’s id. kater git pull brings the delete to your local copy.
- Agents ask first. An agent shows you
--dry-runfirst, and deletes withkater_applyonly after you say yes.