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.

7 functions 6 read 1 write Bearer token auth

PlanetScale CLI Setup

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

# 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 use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

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

Call PlanetScale Headlessly

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

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

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

kosmo integrations:planetscale planetscale_list_databases '{
  "organization": "example_organization",
  "page": 1,
  "limit": 1
}' --json

Agent Discovery Commands

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

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

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 PlanetScale.

planetscale.planetscale_list_databases

Read read

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

Parameters
organization, page, limit

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

planetscale.planetscale_get_database

Read read

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

Parameters
organization, database

Generic CLI call

kosmo integrations:call planetscale.planetscale_get_database '{"organization":"example_organization","database":"example_database"}' --json

Provider shortcut

kosmo integrations:planetscale planetscale_get_database '{"organization":"example_organization","database":"example_database"}' --json

planetscale.planetscale_create_database

Write write

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

Parameters
organization, name, region, notes

Generic CLI call

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

Provider shortcut

kosmo integrations:planetscale planetscale_create_database '{"organization":"example_organization","name":"example_name","region":"example_region","notes":"example_notes"}' --json

planetscale.planetscale_list_branches

Read read

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

Parameters
organization, database, page, limit

Generic CLI call

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

Provider shortcut

kosmo integrations:planetscale planetscale_list_branches '{"organization":"example_organization","database":"example_database","page":1,"limit":1}' --json

planetscale.planetscale_get_branch

Read read

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

Parameters
organization, database, branch

Generic CLI call

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

Provider shortcut

kosmo integrations:planetscale planetscale_get_branch '{"organization":"example_organization","database":"example_database","branch":"example_branch"}' --json

planetscale.planetscale_list_organizations

Read read

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

Parameters
none

Generic CLI call

kosmo integrations:call planetscale.planetscale_list_organizations '{}' --json

Provider shortcut

kosmo integrations:planetscale planetscale_list_organizations '{}' --json

planetscale.planetscale_get_current_user

Read read

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

Parameters
none

Generic CLI call

kosmo integrations:call planetscale.planetscale_get_current_user '{}' --json

Provider 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

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

Operation
Read read
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

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

Operation
Read read
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

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

Operation
Write write
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

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

Operation
Read read
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

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

Operation
Read read
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

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

Operation
Read read
Schema command
kosmo integrations:schema planetscale.planetscale_list_organizations --json
ParameterTypeRequiredDescription
No parameters.

planetscale.planetscale_get_current_user

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

Operation
Read read
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.