KosmoKrator

data

PlanetScale CLI for AI Agents

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

PlanetScale CLI Setup

PlanetScale can be configured headlessly with `kosmokrator integrations:configure planetscale`.

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

Credentials

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

KeyEnv varTypeRequiredLabel
access_token PLANETSCALE_ACCESS_TOKEN Secret secret yes Access Token
url PLANETSCALE_URL URL url no API Base URL

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

Generic CLI call
kosmo integrations:call planetscale.planetscale_list_databases '{"organization":"example_organization","page":1,"limit":1}' --json
Provider shortcut
kosmo integrations:planetscale planetscale_list_databases '{"organization":"example_organization","page":1,"limit":1}' --json

Discovery

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

Discovery commands
kosmo integrations:docs planetscale --json
kosmo integrations:docs planetscale.planetscale_list_databases --json
kosmo integrations:schema planetscale.planetscale_list_databases --json
kosmo integrations:search "PlanetScale" --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.

planetscale.planetscale_list_databases

List databases in a PlanetScale organization. Returns a paginated list of databases with their names, regions, and states.

Read read
Parameters
organization, page, limit
Generic call
kosmo integrations:call planetscale.planetscale_list_databases '{"organization":"example_organization","page":1,"limit":1}' --json
Shortcut
kosmo integrations:planetscale planetscale_list_databases '{"organization":"example_organization","page":1,"limit":1}' --json

planetscale.planetscale_get_database

Get details of a specific PlanetScale database, including its state, region, and branch count.

Read read
Parameters
organization, database
Generic call
kosmo integrations:call planetscale.planetscale_get_database '{"organization":"example_organization","database":"example_database"}' --json
Shortcut
kosmo integrations:planetscale planetscale_get_database '{"organization":"example_organization","database":"example_database"}' --json

planetscale.planetscale_create_database

Create a new database in a PlanetScale organization. Specify the database name and optionally a region and notes.

Write write
Parameters
organization, name, region, notes
Generic call
kosmo integrations:call planetscale.planetscale_create_database '{"organization":"example_organization","name":"example_name","region":"example_region","notes":"example_notes"}' --json
Shortcut
kosmo integrations:planetscale planetscale_create_database '{"organization":"example_organization","name":"example_name","region":"example_region","notes":"example_notes"}' --json

planetscale.planetscale_list_branches

List branches of a PlanetScale database. Returns a paginated list of branches with their names, roles, and states.

Read read
Parameters
organization, database, page, limit
Generic call
kosmo integrations:call planetscale.planetscale_list_branches '{"organization":"example_organization","database":"example_database","page":1,"limit":1}' --json
Shortcut
kosmo integrations:planetscale planetscale_list_branches '{"organization":"example_organization","database":"example_database","page":1,"limit":1}' --json

planetscale.planetscale_get_branch

Get details of a specific branch of a PlanetScale database, including its role, region, and readiness.

Read read
Parameters
organization, database, branch
Generic call
kosmo integrations:call planetscale.planetscale_get_branch '{"organization":"example_organization","database":"example_database","branch":"example_branch"}' --json
Shortcut
kosmo integrations:planetscale planetscale_get_branch '{"organization":"example_organization","database":"example_database","branch":"example_branch"}' --json

planetscale.planetscale_list_organizations

List organizations the authenticated user belongs to. Useful for discovering organization names needed by other PlanetScale tools.

Read read
Parameters
none
Generic call
kosmo integrations:call planetscale.planetscale_list_organizations '{}' --json
Shortcut
kosmo integrations:planetscale planetscale_list_organizations '{}' --json

planetscale.planetscale_get_current_user

Get the profile of the currently authenticated PlanetScale user. Useful for verifying API credentials and retrieving account information.

Read read
Parameters
none
Generic call
kosmo integrations:call planetscale.planetscale_get_current_user '{}' --json
Shortcut
kosmo integrations:planetscale planetscale_get_current_user '{}' --json

Function Schemas

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

planetscale.planetscale_list_databases 3 parameters
Schema command
kosmo integrations:schema planetscale.planetscale_list_databases --json
ParameterTypeRequiredDescription
organization string yes The organization name.
page integer no Page number (1-based, default: 1).
limit integer no Results per page (default: 20, max: 100).
planetscale.planetscale_get_database 2 parameters
Schema command
kosmo integrations:schema planetscale.planetscale_get_database --json
ParameterTypeRequiredDescription
organization string yes The organization name.
database string yes The database name.
planetscale.planetscale_create_database 4 parameters
Schema command
kosmo integrations:schema planetscale.planetscale_create_database --json
ParameterTypeRequiredDescription
organization string yes The organization name.
name string yes The database name (lowercase, hyphens allowed).
region string no The region slug (e.g., "us-east-1"). Defaults to the organization region.
notes string no Optional notes about the database.
planetscale.planetscale_list_branches 4 parameters
Schema command
kosmo integrations:schema planetscale.planetscale_list_branches --json
ParameterTypeRequiredDescription
organization string yes The organization name.
database string yes The database name.
page integer no Page number (1-based, default: 1).
limit integer no Results per page (default: 20, max: 100).
planetscale.planetscale_get_branch 3 parameters
Schema command
kosmo integrations:schema planetscale.planetscale_get_branch --json
ParameterTypeRequiredDescription
organization string yes The organization name.
database string yes The database name.
branch string yes The branch name.
planetscale.planetscale_list_organizations 0 parameters
Schema command
kosmo integrations:schema planetscale.planetscale_list_organizations --json
ParameterTypeRequiredDescription
No parameters.
planetscale.planetscale_get_current_user 0 parameters
Schema command
kosmo integrations:schema planetscale.planetscale_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.