Kater CLI Present and share
kater add-to
Adds a query, a chart or a workspace to dashboards, apps and projects, as **Add to** does everywhere in Kater.
With no --to, it lists every place where it can go, with the --to that adds it there.
Examples
# Go to the snowflake_prod_connection connectioncd connections/snowflake_prod_connection# List the places where the spend_mix chart can gokater add-to workspaces/ad_reporting/spend_mix# Add the chart to the Paid Media Review dashboard and to a new app, in one addkater add-to workspaces/ad_reporting/spend_mix --to workspace:workspaces/paid_media_review --to new:apps --name "Spend review"# Copy the spend_by_platform query into a new workspace of yourskater add-to workspaces/ad_reporting/spend_by_platform --to new:dashboards --name "Spend review"# Add statement 2 of a scratch file, with its chart, to the ad_reporting dashboardkater add-to users/you@example.com/brainstorm/sandbox/live_session_check.sql --statement 2 --to workspace:workspaces/ad_reporting# Add the Explore cards in cards.json, each with its chart, to the ad_reporting dashboardkater add-to --cards cards.json --to workspace:workspaces/ad_reporting# Open the query in a new scratch file in the Sandboxkater add-to workspaces/ad_reporting/spend_by_platform --sandboxArguments
Options
It also takes the global options anywhere on the line, and --help.
The places
workspace:FOLDER. A workspace’s dashboard. A chart goes on the dashboard as a tile. A query goes into the workspace. When the workspace is not its own, the add first copies the query, and a chart’s query, into the workspace’squeries/, under its own name, or with_2when that name is taken. The copy reads the workspace’s root, so every filter of that dashboard holds its rows. Itscopied_fromnames the original.app:FOLDER. An app. A query goes at the end of its first page as a table, and a chart as the tag that draws its kind. A page goes in as another page of the app.project:ID. A project, which lists it.new:dashboardsandnew:apps. A new workspace with a dashboard, or a new app, in your own folder. A new workspace starts from the root of the query’s workspace.
A workflow takes it as a step that you write in the workflow. The list says how to open each one.
The list
With no --to, it lists the places on each tab, as Add to shows them: Dashboards, Apps, Projects and Workflows. The dashboard of its own workspace comes first. Each place says one of these:
- The
--tothat adds it there. “Not checked yet” means that nobody checked the copy there yet. The add checks it. - Already added. The place holds it already, so the add leaves it as it is. To take it out, use
kater files remove-fromorkater project remove. - Cannot take it. The place reads another shared model or none, or the copy does not compile there. The command says why.
How the add runs
The add changes every place in one change, and the command waits until it is done. It then says what it added at each place, with a path to open it. A place that cannot take it says why, and the other places still get it. In a local copy, the command makes the change and brings it into your copy.
Through an agent
The kater tool of the Kater MCP lists the places. An agent adds it with kater_apply after the person agrees where.