Skip to main content
On this page

Developers

VS Code extension

Compile, preview, run and inspect Kater SQL in VS Code, Cursor or Windsurf, with the same panels as the portal.

Audience
Data teams
Prerequisites
  • VS Code, Cursor or Windsurf
  • The Kater CLI, signed in
  • A local copy of your content

The Kater extension brings the workspace editor into VS Code. Write Kater SQL with completion and diagnostics, run a query and see its rows and chart, and manage access to a folder, all next to your other files.

Install and sign in

  1. Install.

    Run kater vscode install. It installs the extension, kater.kater, into each of VS Code, Cursor and Windsurf it finds on your PATH. VS Code gets it from the Visual Studio Marketplace, and Cursor and Windsurf get it from Open VSX. In an editor, you can also search the Extensions view for Kater SQL.

  2. Open your content.

    Open your local copy. The extension uses the first folder that holds connections/, or the folder in katerQuery.katerRoot.

  3. Sign in.

    Run Kater: Sign In. It signs you in through the browser, as kater login does, and keeps your tokens in VS Code’s secret storage. Kater: Sign Out clears them.

Panels

PanelWhereWhat it shows
KaterBottom panelThe workspace editor for the open file: field picker, rows, chart, chart settings, SQL editor, lineage and compiled SQL.
Kater LogsBottom panelKater Logs: errors and run details.
Kater SandboxBottom panelYour scratch files and their statement results.
Kater AccessExplorerWho has access to the open file, or to a folder you select with Kater: Manage Access….

Languages

Each Kater file type gets its own language, set from its path. The Kater language server gives each one diagnostics, hover, completion, go to definition, formatting and quick fixes. The extension starts it with the CLI that you installed, as kater lsp.

LanguageFiles
Kater Datasetmodeling/kater_objects/datasets/**/*.sql
Kater Semantic Modelmodeling/kater_objects/semantic_models/**/*.sql
Kater Workspaceworkspaces/*/workspace.sql
Kater Query Contractworkspaces/*/query_contracts/**/*.sql
Kater Chartworkspaces/*/charts/**/*.sql
Kater Testmodeling/kater_objects/tests/*.sql, a workspace’s tests/, and users/*/tests/
Kater Scratch Fileusers/*/brainstorm/**/*.sql

Commands

Every command starts with “Kater:” in the command palette.

GroupCommands
RunRun, Run Tags, Compile Query, Refresh Data
PanelsShow Output, Show Field Picker, Show Logs, Show Sandbox, Show Editor, Show Dashboard, Show Workspace Definitions, Show Problems, and Show or Hide Field Picker, SQL Editor, Rows, Chart, Chart Settings, Lineage and Compiled SQL
MakeNew Query, New Workspace, New App, New Chart, New Field, New Scratch File, Save as New Query, Duplicate Query
SandboxOpen in Sandbox, Run Statement, Run All Statements
TestsRun Test, Show Test SQL, Record Test Rows, Mark Test Checked, Generate Tests, Save Query as Test
Rows and fieldsCopy Rows as CSV, Add Field, Add Filter, Top Rows and Row Limit, Find in Rows, Search Fields
QueriesPrevious Query, Next Query, Move Query Left, Move Query Right, Delete Query, Add To, Promote a Field
HistoryUndo Last Change, Redo Last Change
OtherAsk, Compare, Open Page, Manage Access…, Sign In, Sign Out

In a scratch or test file, ⌘↵ runs the statement at the cursor and ⇧⌘↵ runs every statement. On Windows and Linux, use Ctrl in place of ⌘.

Settings

SettingWhat it doesDefault
katerQuery.apiUrlThe Kater API the Access view, brainstorm pages and Ask callThe address kater login saved
katerQuery.authUrlThe sign-in addressThe one kater login saved
katerQuery.authClientIdThe sign-in client idThe one kater login saved
katerQuery.authRedirectUriWhere the browser returns after sign-inhttp://127.0.0.1:8765/callback
katerQuery.webUrlThe Kater web app that Copy link, Open in browser and Ask’s links point athttps://app.kater.ai
katerQuery.katerRootThe absolute content rootThe first folder that holds connections/
katerQuery.serverCommand, serverArgsHow to start the Kater language serverkater lsp
katerQuery.cliCommand, cliArgsHow to run kater CLI operations: compile, run, previews, edits and logskater
katerQuery.envFileA dotenv file whose values override the environment of the CLI and the language server, such as KATER_TARGET. It never holds warehouse settings. Reload the window after a change.None
katerQuery.executionModeRun compiles and runs. Compile writes SQL without querying the warehouse.run
katerQuery.runTargetQuery runs the whole query. Selected runs the nested query at the cursor.query

Work between the portal and VS Code

  • Open links in VS Code. In the portal, set Profile › Links › Open links in to VS Code, or select Open in VS Code when a link asks. Citation links in exported files open the same way.
  • Scope follows your file. The Kater file you have open sets the scope for kater commands in the terminal.
  • Kater runs the warehouse queries. The extension compiles a query on your computer, with a kater process that it starts for the window. It sends the SQL to Kater, and Kater runs it on the warehouse with your organisation’s stored credential. Your computer never holds a warehouse credential, and katerQuery.envFile holds none.

Next steps