KosmoKrator

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, configure, and verify
# 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.

KeyEnv varTypeRequiredLabel
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.

Generic CLI call
kosmo integrations:call snowflake.snowflake_execute_query '{"sql":"example_sql","warehouse":"example_warehouse","database":"example_database","schema":"example_schema"}' --json
Provider shortcut
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.

Discovery commands
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 write
Parameters
sql, warehouse, database, schema
Generic call
kosmo integrations:call snowflake.snowflake_execute_query '{"sql":"example_sql","warehouse":"example_warehouse","database":"example_database","schema":"example_schema"}' --json
Shortcut
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 read
Parameters
none
Generic call
kosmo integrations:call snowflake.snowflake_list_databases '{}' --json
Shortcut
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 read
Parameters
database
Generic call
kosmo integrations:call snowflake.snowflake_get_database '{"database":"example_database"}' --json
Shortcut
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 read
Parameters
database
Generic call
kosmo integrations:call snowflake.snowflake_list_schemas '{"database":"example_database"}' --json
Shortcut
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 read
Parameters
database, schema
Generic call
kosmo integrations:call snowflake.snowflake_list_tables '{"database":"example_database","schema":"example_schema"}' --json
Shortcut
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 read
Parameters
database, schema, table
Generic call
kosmo integrations:call snowflake.snowflake_describe_table '{"database":"example_database","schema":"example_schema","table":"example_table"}' --json
Shortcut
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 read
Parameters
none
Generic call
kosmo integrations:call snowflake.snowflake_list_warehouses '{}' --json
Shortcut
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 read
Parameters
name
Generic call
kosmo integrations:call snowflake.snowflake_get_warehouse '{"name":"example_name"}' --json
Shortcut
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 read
Parameters
none
Generic call
kosmo integrations:call snowflake.snowflake_get_current_user '{}' --json
Shortcut
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
Schema command
kosmo integrations:schema snowflake.snowflake_execute_query --json
ParameterTypeRequiredDescription
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
Schema command
kosmo integrations:schema snowflake.snowflake_list_databases --json
ParameterTypeRequiredDescription
No parameters.
snowflake.snowflake_get_database 1 parameters
Schema command
kosmo integrations:schema snowflake.snowflake_get_database --json
ParameterTypeRequiredDescription
database string yes The database name or identifier.
snowflake.snowflake_list_schemas 1 parameters
Schema command
kosmo integrations:schema snowflake.snowflake_list_schemas --json
ParameterTypeRequiredDescription
database string yes The database name to list schemas from.
snowflake.snowflake_list_tables 2 parameters
Schema command
kosmo integrations:schema snowflake.snowflake_list_tables --json
ParameterTypeRequiredDescription
database string yes The database name.
schema string yes The schema name within the database.
snowflake.snowflake_describe_table 3 parameters
Schema command
kosmo integrations:schema snowflake.snowflake_describe_table --json
ParameterTypeRequiredDescription
database string yes The database name.
schema string yes The schema name.
table string yes The table name.
snowflake.snowflake_list_warehouses 0 parameters
Schema command
kosmo integrations:schema snowflake.snowflake_list_warehouses --json
ParameterTypeRequiredDescription
No parameters.
snowflake.snowflake_get_warehouse 1 parameters
Schema command
kosmo integrations:schema snowflake.snowflake_get_warehouse --json
ParameterTypeRequiredDescription
name string yes The warehouse name.
snowflake.snowflake_get_current_user 0 parameters
Schema command
kosmo integrations:schema snowflake.snowflake_get_current_user --json
ParameterTypeRequiredDescription
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.