data
Snowflake CLI for AI Agents
Use the Snowflake CLI from KosmoKrator to call Snowflake tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Snowflake CLI Setup
Snowflake can be configured headlessly with `kosmokrator integrations:configure snowflake`.
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash
# Configure and verify this integration.
kosmokrator integrations:configure snowflake --set access_token="$SNOWFLAKE_ACCESS_TOKEN" --set account="$SNOWFLAKE_ACCOUNT" --enable --read allow --write ask --json
kosmokrator integrations:doctor snowflake --json
kosmokrator integrations:status --json Credentials
Authentication type: Manual OAuth token oauth2_manual_token. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
access_token | SNOWFLAKE_ACCESS_TOKEN | Secret secret | yes | Access Token |
account | SNOWFLAKE_ACCOUNT | Text string | yes | Account Identifier |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call snowflake.snowflake_execute_query '{"sql":"example_sql","warehouse":"example_warehouse","database":"example_database","schema":"example_schema"}' --json kosmo integrations:snowflake snowflake_execute_query '{"sql":"example_sql","warehouse":"example_warehouse","database":"example_database","schema":"example_schema"}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs snowflake --json
kosmo integrations:docs snowflake.snowflake_execute_query --json
kosmo integrations:schema snowflake.snowflake_execute_query --json
kosmo integrations:search "Snowflake" --json
kosmo integrations:list --json Automation Contexts
The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.
CLI Functions
Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.
snowflake.snowflake_execute_query
Execute a SQL statement on Snowflake. Returns column metadata and result rows. Optionally specify warehouse, database, and schema context.
write - Parameters
- sql, warehouse, database, schema
kosmo integrations:call snowflake.snowflake_execute_query '{"sql":"example_sql","warehouse":"example_warehouse","database":"example_database","schema":"example_schema"}' --json kosmo integrations:snowflake snowflake_execute_query '{"sql":"example_sql","warehouse":"example_warehouse","database":"example_database","schema":"example_schema"}' --json snowflake.snowflake_list_databases
List all databases in the Snowflake account. Returns database names, identifiers, and creation timestamps.
read - Parameters
- none
kosmo integrations:call snowflake.snowflake_list_databases '{}' --json kosmo integrations:snowflake snowflake_list_databases '{}' --json snowflake.snowflake_get_database
Get details for a specific Snowflake database, including retention time, owner, and size.
read - Parameters
- database
kosmo integrations:call snowflake.snowflake_get_database '{"database":"example_database"}' --json kosmo integrations:snowflake snowflake_get_database '{"database":"example_database"}' --json snowflake.snowflake_list_schemas
List all schemas within a Snowflake database. Returns schema names and metadata.
read - Parameters
- database
kosmo integrations:call snowflake.snowflake_list_schemas '{"database":"example_database"}' --json kosmo integrations:snowflake snowflake_list_schemas '{"database":"example_database"}' --json snowflake.snowflake_list_tables
List all tables within a Snowflake database schema. Returns table names, types, and metadata.
read - Parameters
- database, schema
kosmo integrations:call snowflake.snowflake_list_tables '{"database":"example_database","schema":"example_schema"}' --json kosmo integrations:snowflake snowflake_list_tables '{"database":"example_database","schema":"example_schema"}' --json snowflake.snowflake_describe_table
Describe a Snowflake table — get column names, data types, nullable, default values, and other metadata.
read - Parameters
- database, schema, table
kosmo integrations:call snowflake.snowflake_describe_table '{"database":"example_database","schema":"example_schema","table":"example_table"}' --json kosmo integrations:snowflake snowflake_describe_table '{"database":"example_database","schema":"example_schema","table":"example_table"}' --json snowflake.snowflake_list_warehouses
List all warehouses in the Snowflake account. Returns warehouse names, sizes, and status.
read - Parameters
- none
kosmo integrations:call snowflake.snowflake_list_warehouses '{}' --json kosmo integrations:snowflake snowflake_list_warehouses '{}' --json snowflake.snowflake_get_warehouse
Get details for a specific Snowflake warehouse, including size, type, auto-suspend, and auto-resume settings.
read - Parameters
- name
kosmo integrations:call snowflake.snowflake_get_warehouse '{"name":"example_name"}' --json kosmo integrations:snowflake snowflake_get_warehouse '{"name":"example_name"}' --json snowflake.snowflake_get_current_user
Get the current authenticated Snowflake user and session information.
read - Parameters
- none
kosmo integrations:call snowflake.snowflake_get_current_user '{}' --json kosmo integrations:snowflake snowflake_get_current_user '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
snowflake.snowflake_execute_query 4 parameters
kosmo integrations:schema snowflake.snowflake_execute_query --json | Parameter | Type | Required | Description |
|---|---|---|---|
sql | string | yes | The SQL statement to execute (e.g., "SELECT * FROM my_table LIMIT 10"). |
warehouse | string | no | The warehouse to use for the query (overrides default). |
database | string | no | The database context for the query. |
schema | string | no | The schema context for the query. |
snowflake.snowflake_list_databases 0 parameters
kosmo integrations:schema snowflake.snowflake_list_databases --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
snowflake.snowflake_get_database 1 parameters
kosmo integrations:schema snowflake.snowflake_get_database --json | Parameter | Type | Required | Description |
|---|---|---|---|
database | string | yes | The database name or identifier. |
snowflake.snowflake_list_schemas 1 parameters
kosmo integrations:schema snowflake.snowflake_list_schemas --json | Parameter | Type | Required | Description |
|---|---|---|---|
database | string | yes | The database name to list schemas from. |
snowflake.snowflake_list_tables 2 parameters
kosmo integrations:schema snowflake.snowflake_list_tables --json | Parameter | Type | Required | Description |
|---|---|---|---|
database | string | yes | The database name. |
schema | string | yes | The schema name within the database. |
snowflake.snowflake_describe_table 3 parameters
kosmo integrations:schema snowflake.snowflake_describe_table --json | Parameter | Type | Required | Description |
|---|---|---|---|
database | string | yes | The database name. |
schema | string | yes | The schema name. |
table | string | yes | The table name. |
snowflake.snowflake_list_warehouses 0 parameters
kosmo integrations:schema snowflake.snowflake_list_warehouses --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
snowflake.snowflake_get_warehouse 1 parameters
kosmo integrations:schema snowflake.snowflake_get_warehouse --json | Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | The warehouse name. |
snowflake.snowflake_get_current_user 0 parameters
kosmo integrations:schema snowflake.snowflake_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults with
integrations:configure. Add --force only for trusted automation that should bypass that policy.