Kater CLI Share and administer admin connection
kater admin connection
Sets up and checks the connections between Kater and your warehouses.
A connection is a folder under connections/ that holds one connection.yaml. The file names the warehouse, its settings without secrets, and the databases and schemas that Kater reads. See Connections and schema sync.
id: d5c8ffbf-4c47-4195-b949-cc9fcd0186f2name: snowflake_prod_connectionwarehouse_metadata: warehouse_type: snowflake snowflake_account_id: myorg-myaccount warehouse: COMPUTE_WH role: SYSADMIN auth_method: key_pairlabel: Snowflake productiondatabases:- db__database: DEMO_DB name: demo_db timezone: UTC schemas: - db__schema: ANALYTICS_AD_REPORTING name: analytics_ad_reporting tables: [] exclude_tables: []query_timezone_conversion: do_not_convertquery_timeout: 300Commands
| Command | What it does |
|---|---|
kater admin connection create | Add a Snowflake connection through Kater’s API. |
kater admin connection update | Change a connection’s settings, schemas or tables. |
kater admin connection sign-in | Replace a Snowflake connection’s stored sign-in, or add one. |
kater admin connection scaffold | Add the folders and files a connection is missing. |
kater admin connection list | List the connections you can see. |
kater admin connection objects | List the tables in a connection’s warehouse. |
kater admin connection test | Check that Kater can reach a connection’s warehouse. |
kater admin connection show | Show a connection’s settings and credential status. |
About connection.yaml
- Edit it by hand, or with
kater admin connection update. Both make the same changes.updaterewrites only the lines that it changes, so the file keeps your comments. - The id never changes.
kater admin connection createwrites it one time. - The file holds no credentials. Kater stores each warehouse’s credential on its server, encrypted. A key such as
passwordoruserin the file is an error. - A change reaches Kater when you push it. Commit the change in your local copy, then run
kater git push. - Sync after a selection change. After you change the databases, schemas or tables, run
kater sync --resource-type db_dataset.
Warehouse settings
Each settings option writes one key under warehouse_metadata. create and update refuse an option that belongs to another warehouse.
| Warehouse | --warehouse-type | Settings options |
|---|---|---|
| Snowflake | snowflake | --account, written as snowflake_account_id. --warehouse, --role, and --auth-method, which is username_password or key_pair. create sets auth_method from the credential that you give. |
- Names are read as the warehouse reads them. This covers
--database,--schema,--table, the selection options ofupdate,--timezoneandsync --sources. In Snowflake,analyticsandANALYTICSare one database, and"Analytics"is another. - Create the connection first.
createmakes a new folder, so create the connection before you put its file inconnections/. - Both writers preview.
createandupdatetake--dry-run, which prints the YAML and saves nothing. They also take--json. - Removing a schema leaves its files. Its DDL files stay until
kater sync --resource-type db_dataset --pruneruns.
Checks on connection.yaml
Kater checks connection.yaml wherever it reads it.
- In VS Code, problems show on the line that they are about, as you type.
- On compile, a compile of a connection’s whole modeling scope, or of the whole root, lists them under
connection_checks.kater compileexits with an error code when one is an error, so CI cannot merge a broken file. - Selection drift gives a warning in the same places. A selected schema or a listed table with no file needs
kater sync --resource-type db_dataset. Files left for an unselected schema or an excluded table needkater sync --resource-type db_dataset --prune. - Files only. These checks read files only. Tables that are new in the warehouse show only when a sync queries it.
Who can run it
- Creating a connection, and
sign-in, need thesettings:managepermission. - Changing a connection needs edit access to its
connection.yaml. testandobjectsreach the warehouse through Kater’s API, with your organisation’s stored credential. They need theconnections:querypermission. Your computer never holds a warehouse credential.
Run kater admin connection in your own terminal. The Kater MCP’s kater tool and the Files terminal in Kater do not run it.
Examples
# List the connections you can readkater admin connection list# Check a connection's file and its credentialkater admin connection show snowflake_prod_connection# Check that Kater can reach the warehousekater admin connection test snowflake_prod_connection# Take a schema out of the connection's selectionkater admin connection update snowflake_prod_connection --remove-schema DEMO_DB.ANALYTICS_VELIR_GA4# Replace the connection's stored sign-in with a new key pairkater admin connection sign-in snowflake_prod_connection --user kater_service --private-key-file ~/.ssh/kater_key.p8