Kater CLI Find and understand files
kater files add-to
Adds a query or a chart to a workspace, a dashboard, an app or the Sandbox.
It works as Add to on the Files page does, and also adds a page to an app. With no place named, it lists the places where the file can go.
Examples
# Go to the snowflake_prod_connection connectioncd connections/snowflake_prod_connection# List the places where the spend_by_platform query can gokater files add-to workspaces/ad_reporting/query_contracts/spend_by_platform.sql# Open the query in a new scratch file in the Sandboxkater files add-to workspaces/ad_reporting/query_contracts/spend_by_platform.sql --sandbox# Copy the query into a new workspace of yours, named Spend reviewkater files add-to workspaces/ad_reporting/query_contracts/spend_by_platform.sql --new-workspace --name "Spend review"# Add the spend_mix chart to a new app of yourskater files add-to workspaces/ad_reporting/charts/spend_mix.sql --new-appArguments
Options
It also takes the global options --json, --kater-root, --scope and --help.
Where it can go
- A workspace. One of yours, or a connection workspace that you can change, that reads the same shared model. The query goes into its
query_contracts/under its own name, or with_2,_3and on when that name is taken. When the query does not compile there, Kater refuses it with the compiler’s words. A chart brings its query. - A dashboard. This is for a chart only. Kater puts the chart on the dashboard’s first tab. When the workspace is not the chart’s own, Kater first copies the chart and its query there.
- An app. A query goes at the end of the app’s first page as a
<kater-table>tag. A chart goes there as the tag that draws its kind, with its fields. That tag is markeddata-kater-chart, with the chart it came from. A page goes in as another page of the app. - A new app. A page becomes its
index.html. Kater refuses a page that the app check would refuse. - The Sandbox. Kater opens a new scratch file on the query.
A new workspace or app without --name gets the name unnamed_workspace_ or unnamed_app_, with a number.
The list of places
With no place named, the list holds these places, each with the option that selects it:
- The dashboard of the chart’s own workspace, and the dashboards of the workspaces it can go into.
- Your own workspaces, and the connection workspaces you can change that read the same shared model.
- A new workspace, your own apps, a new app and the Sandbox.
Someone else’s workspace or app is never in the list. Each place says whether it holds the query or chart already.
Through an agent
Outside a brainstorm folder, the kater tool of the Kater MCP refuses this change. An agent adds it with kater_apply after the person agrees.