data
PlanetScale CLI for Coding Agents
Use the PlanetScale CLI for coding agents with headless JSON commands, schema discovery, credentials, and permission controls.
7 functions 6 read 1 write Bearer token auth
PlanetScale CLI for Coding Agents
Let coding agents discover schemas and execute integration functions through CLI commands or MCP.
Use this pattern when another coding agent needs exact commands and schema discovery. The PlanetScale CLI uses the same integration registry as the TUI, Lua runtime, and MCP gateway, but returns predictable command output for automation.
Command Shape
# PlanetScale CLI for Coding Agents
kosmokrator integrations:configure planetscale --set access_token="$PLANETSCALE_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmo integrations:call planetscale.planetscale_list_databases '{"organization":"example_organization","page":1,"limit":1}' --json Discovery Before Execution
Agents and scripts can inspect PlanetScale docs and schemas 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 Useful PlanetScale CLI Functions
| Function | Type | Parameters | Description |
|---|---|---|---|
planetscale.planetscale_list_databases | Read | organization, page, limit | List databases in a PlanetScale organization. Returns a paginated list of databases with their names, regions, and states. |
planetscale.planetscale_get_database | Read | organization, database | Get details of a specific PlanetScale database, including its state, region, and branch count. |
planetscale.planetscale_create_database | Write | organization, name, region, notes | Create a new database in a PlanetScale organization. Specify the database name and optionally a region and notes. |
planetscale.planetscale_list_branches | Read | organization, database, page, limit | List branches of a PlanetScale database. Returns a paginated list of branches with their names, roles, and states. |
planetscale.planetscale_get_branch | Read | organization, database, branch | Get details of a specific branch of a PlanetScale database, including its role, region, and readiness. |
planetscale.planetscale_list_organizations | Read | none | List organizations the authenticated user belongs to. Useful for discovering organization names needed by other PlanetScale tools. |
planetscale.planetscale_get_current_user | Read | none | Get the profile of the currently authenticated PlanetScale user. Useful for verifying API credentials and retrieving account information. |
Automation Notes
- Use
--jsonfor machine-readable output. - Keep credentials out of argv by using environment variables or stored KosmoKrator configuration.
- Configure read/write policy before unattended runs; use
--forceonly for trusted automation. - Use the MCP gateway instead when the agent needs dynamic tool discovery inside a conversation.