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 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.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
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.
kosmo integrations:call planetscale.planetscale_list_databases '{"organization":"example_organization","page":1,"limit":1}' --json 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.
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 - Parameters
- organization, page, limit
kosmo integrations:call planetscale.planetscale_list_databases '{"organization":"example_organization","page":1,"limit":1}' --json 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 - Parameters
- organization, database
kosmo integrations:call planetscale.planetscale_get_database '{"organization":"example_organization","database":"example_database"}' --json 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 - Parameters
- organization, name, region, notes
kosmo integrations:call planetscale.planetscale_create_database '{"organization":"example_organization","name":"example_name","region":"example_region","notes":"example_notes"}' --json 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 - Parameters
- organization, database, page, limit
kosmo integrations:call planetscale.planetscale_list_branches '{"organization":"example_organization","database":"example_database","page":1,"limit":1}' --json 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 - Parameters
- organization, database, branch
kosmo integrations:call planetscale.planetscale_get_branch '{"organization":"example_organization","database":"example_database","branch":"example_branch"}' --json 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 - Parameters
- none
kosmo integrations:call planetscale.planetscale_list_organizations '{}' --json 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 - Parameters
- none
kosmo integrations:call planetscale.planetscale_get_current_user '{}' --json 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
kosmo integrations:schema planetscale.planetscale_list_databases --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema planetscale.planetscale_get_database --json | Parameter | Type | Required | Description |
|---|---|---|---|
organization | string | yes | The organization name. |
database | string | yes | The database name. |
planetscale.planetscale_create_database 4 parameters
kosmo integrations:schema planetscale.planetscale_create_database --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema planetscale.planetscale_list_branches --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema planetscale.planetscale_get_branch --json | Parameter | Type | Required | Description |
|---|---|---|---|
organization | string | yes | The organization name. |
database | string | yes | The database name. |
branch | string | yes | The branch name. |
planetscale.planetscale_list_organizations 0 parameters
kosmo integrations:schema planetscale.planetscale_list_organizations --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
planetscale.planetscale_get_current_user 0 parameters
kosmo integrations:schema planetscale.planetscale_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.