Kater CLI Build an analysis workspace
kater workspace apply
Writes the changes in a brainstorm copy back to the workspace it was copied from.
Use it when a change that you tested in a copy is ready. Only the files that the copy changed are written, and the copy’s copied-from.yaml names the original.
Examples
# Go to your promote_roas brainstorm topic in your local copy of Kater contentcd connections/snowflake_prod_connection/users/you@example.com/brainstorm/promote_roas# See each file's diff and compare each query in the original and the copy, and save nothingkater workspace apply workspaces/ad_reporting --dry-run# Write the copy's changes back to the ad_reporting workspacekater workspace apply workspaces/ad_reporting# Write back only the spend_by_platform querykater workspace apply workspaces/ad_reporting --files query_contracts/spend_by_platform.sql# Write exactly what a dry run proposed, and stop when the proposal changed sincerevision=$(kater workspace apply workspaces/ad_reporting --dry-run --json | jq -r .revision)kater workspace apply workspaces/ad_reporting --revision "$revision"Arguments
Options
It also takes the global options --json, --kater-root, --scope and --help.
What it writes
- Only changed files. Kater writes only the files that the copy changed since it was copied or last applied. Each file points back at the original workspace.
- A file that only the original changed stays as the original has it.
- No force. When the original changed a file since the copy was made, Kater refuses the file with
origin_changedand both revisions. Make a fresh copy and make the change there. - It compiles first. The copy’s Kater SQL compiles together with the rest of the original, as any save does. A copy that does not compile there writes nothing and names each file’s errors.
- Deletes need a name. A file that the copy deleted is deleted only when
--filesnames it. Kater does not delete a query that a chart in the original still reads. - Apps stay. An app in the copy is not applied. The original’s apps stay with it, and a draft app has its own place,
brainstorm/<topic>/apps/. - Each file’s outcome is reported. The apply is not all or nothing. Afterwards the copy’s record matches again, so the next apply sends only later changes.
- Access. When you can only read the original workspace, only its owner or an administrator can apply the copy. A file that is open in the editor is not written. Close it or save it there, then apply again.
The dry run
A dry run gives each file’s diff, within one shared budget. A file that --files names shows its diff even past that budget. It also compares the original and the copy query by query, as kater compare does. Each query takes a few seconds. It ends with the apply line, whose --revision writes exactly that proposal.
After the apply
apps lists the apps that read the original workspace. kater brainstorm show checks one app. kater compare, with the original on the left and the copy on the right, then shows every query the same.
In a chat
Through the Kater MCP, the kater tool runs the dry run. The kater_apply tool runs the apply, after the person says yes. The agent reads each query’s verdict, and the person’s card shows each query’s rows before and after. --json returns the workspace.apply_copy answer.