KosmoKrator

data

CockroachDB CLI for AI Agents

Use the CockroachDB CLI from KosmoKrator to call CockroachDB tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

7 functions 6 read 1 write Bearer token auth

CockroachDB CLI Setup

CockroachDB can be configured headlessly with `kosmokrator integrations:configure cockroachdb`.

# 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 cockroachdb --set access_token="$COCKROACHDB_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor cockroachdb --json
kosmokrator integrations:status --json

Credentials

Authentication type: Bearer token bearer_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token COCKROACHDB_ACCESS_TOKEN Secret secret yes API Key
url COCKROACHDB_URL URL url no API Base URL

Call CockroachDB Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call cockroachdb.cockroachdb_list_clusters '{}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:cockroachdb cockroachdb_list_clusters '{}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs cockroachdb --json
kosmo integrations:docs cockroachdb.cockroachdb_list_clusters --json
kosmo integrations:schema cockroachdb.cockroachdb_list_clusters --json
kosmo integrations:search "CockroachDB" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to CockroachDB.

cockroachdb.cockroachdb_list_clusters

Read read

List all CockroachDB clusters in the organization. Returns cluster IDs, names, status, cloud provider, and regions.

Parameters
none

Generic CLI call

kosmo integrations:call cockroachdb.cockroachdb_list_clusters '{}' --json

Provider shortcut

kosmo integrations:cockroachdb cockroachdb_list_clusters '{}' --json

cockroachdb.cockroachdb_get_cluster

Read read

Get details for a specific CockroachDB cluster by ID. Returns full cluster information including configuration, nodes, and connection strings.

Parameters
cluster_id

Generic CLI call

kosmo integrations:call cockroachdb.cockroachdb_get_cluster '{"cluster_id":"example_cluster_id"}' --json

Provider shortcut

kosmo integrations:cockroachdb cockroachdb_get_cluster '{"cluster_id":"example_cluster_id"}' --json

cockroachdb.cockroachdb_create_cluster

Write write

Create a new CockroachDB cluster. Requires a name, cloud provider, and region configuration.

Parameters
name, cloud_provider, region, plan, spend_limit, cluster_version

Generic CLI call

kosmo integrations:call cockroachdb.cockroachdb_create_cluster '{"name":"example_name","cloud_provider":"example_cloud_provider","region":"example_region","plan":"example_plan","spend_limit":1,"cluster_version":"example_cluster_version"}' --json

Provider shortcut

kosmo integrations:cockroachdb cockroachdb_create_cluster '{"name":"example_name","cloud_provider":"example_cloud_provider","region":"example_region","plan":"example_plan","spend_limit":1,"cluster_version":"example_cluster_version"}' --json

cockroachdb.cockroachdb_list_databases

Read read

List all databases in a CockroachDB cluster. Returns database names, sizes, and table counts.

Parameters
cluster_id

Generic CLI call

kosmo integrations:call cockroachdb.cockroachdb_list_databases '{"cluster_id":"example_cluster_id"}' --json

Provider shortcut

kosmo integrations:cockroachdb cockroachdb_list_databases '{"cluster_id":"example_cluster_id"}' --json

cockroachdb.cockroachdb_get_database

Read read

Get details for a specific database in a CockroachDB cluster. Returns table list, sizes, and configuration.

Parameters
cluster_id, database_name

Generic CLI call

kosmo integrations:call cockroachdb.cockroachdb_get_database '{"cluster_id":"example_cluster_id","database_name":"example_database_name"}' --json

Provider shortcut

kosmo integrations:cockroachdb cockroachdb_get_database '{"cluster_id":"example_cluster_id","database_name":"example_database_name"}' --json

cockroachdb.cockroachdb_list_users

Read read

List all SQL users in a CockroachDB cluster. Returns usernames and privileges.

Parameters
cluster_id

Generic CLI call

kosmo integrations:call cockroachdb.cockroachdb_list_users '{"cluster_id":"example_cluster_id"}' --json

Provider shortcut

kosmo integrations:cockroachdb cockroachdb_list_users '{"cluster_id":"example_cluster_id"}' --json

cockroachdb.cockroachdb_get_current_user

Read read

Get information about the current authenticated CockroachDB Cloud user, including email, name, and organization role.

Parameters
none

Generic CLI call

kosmo integrations:call cockroachdb.cockroachdb_get_current_user '{}' --json

Provider shortcut

kosmo integrations:cockroachdb cockroachdb_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

cockroachdb.cockroachdb_list_clusters

List all CockroachDB clusters in the organization. Returns cluster IDs, names, status, cloud provider, and regions.

Operation
Read read
Schema command
kosmo integrations:schema cockroachdb.cockroachdb_list_clusters --json
ParameterTypeRequiredDescription
No parameters.

cockroachdb.cockroachdb_get_cluster

Get details for a specific CockroachDB cluster by ID. Returns full cluster information including configuration, nodes, and connection strings.

Operation
Read read
Schema command
kosmo integrations:schema cockroachdb.cockroachdb_get_cluster --json
ParameterTypeRequiredDescription
cluster_id string yes The cluster ID.

cockroachdb.cockroachdb_create_cluster

Create a new CockroachDB cluster. Requires a name, cloud provider, and region configuration.

Operation
Write write
Schema command
kosmo integrations:schema cockroachdb.cockroachdb_create_cluster --json
ParameterTypeRequiredDescription
name string yes The cluster name (e.g., "my-app-prod").
cloud_provider string yes Cloud provider: "GCP", "AWS", or "AZURE".
region string yes Region where the cluster will be deployed (e.g., "us-east-1", "europe-west1").
plan string no Plan type: "SERVERLESS" or "DEDICATED" (default: "SERVERLESS").
spend_limit integer no Monthly spend limit in cents for serverless clusters.
cluster_version string no CockroachDB version (e.g., "v23.2").

cockroachdb.cockroachdb_list_databases

List all databases in a CockroachDB cluster. Returns database names, sizes, and table counts.

Operation
Read read
Schema command
kosmo integrations:schema cockroachdb.cockroachdb_list_databases --json
ParameterTypeRequiredDescription
cluster_id string yes The cluster ID.

cockroachdb.cockroachdb_get_database

Get details for a specific database in a CockroachDB cluster. Returns table list, sizes, and configuration.

Operation
Read read
Schema command
kosmo integrations:schema cockroachdb.cockroachdb_get_database --json
ParameterTypeRequiredDescription
cluster_id string yes The cluster ID.
database_name string yes The database name.

cockroachdb.cockroachdb_list_users

List all SQL users in a CockroachDB cluster. Returns usernames and privileges.

Operation
Read read
Schema command
kosmo integrations:schema cockroachdb.cockroachdb_list_users --json
ParameterTypeRequiredDescription
cluster_id string yes The cluster ID.

cockroachdb.cockroachdb_get_current_user

Get information about the current authenticated CockroachDB Cloud user, including email, name, and organization role.

Operation
Read read
Schema command
kosmo integrations:schema cockroachdb.cockroachdb_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.