PlanetScale CLI
$ pscale Official Med RiskPlanetScale CLI manages databases, non-blocking schema branches, deploy requests, service tokens, and local proxy tunnels. Features consistent --format json output, service-token auth via env vars, and safe deploy-request workflows.
brew install planetscale/tap/pscale pscale offers mature branch diffing, deploy request linting, and --format json automation that maps directly to Git/PR agent workflows.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --format json and --format csv, service-token env vars, and deterministic Cobra subcommands.
- Supports
--format jsonacross commands andPLANETSCALE_SERVICE_TOKENenv auth
Branch + deploy-request model prevents direct DDL writes to production branches when safe migrations are enabled.
branch diffanddeploy-requestworkflow separate schema staging from prod
Single Go binary via Homebrew, Scoop, apt/rpm, and GitHub Releases across all major OSes.
- Cross-platform static Go binary
Simplifies Vitess branching, schema diffing, and local pscale connect proxying.
- Handles branching, diffs, and secure local proxies without manual MySQL TLS setup
Official planetscale/cli maintained by PlanetScale under Apache-2.0.
- Official
planetscale/clirepository
Well-structured command reference and workflow guides.
- Official reference at planetscale.com/docs/reference/planetscale-cli
Security, Auth & Guardrails
OAuth token stored in ~/.config/planetscale/access-token, or service tokens passed via PLANETSCALE_SERVICE_TOKEN and PLANETSCALE_SERVICE_TOKEN_ID.
CLI is Apache-2.0 open-source; PlanetScale managed databases are billed per plan.
# PlanetScale CLI Agent Rules - Always pass `--format json` and explicit `--org <org>` flags. - Develop schema changes on a branch via `pscale branch create` and inspect with `pscale branch diff`. - NEVER run `pscale database delete` or auto-deploy `deploy-request deploy` to `main` without human sign-off.
Agent-Ready Command Recipes
Safe Read-Only Queries
pscale database list --org <org> --format json
Enumerates PlanetScale databases and status in machine-readable JSON.
pscale branch diff <db> <branch> --org <org> --format json
Previews DDL differences safely before opening a deploy request.
Controlled Writes & Previews
pscale branch create <db> agent-schema-change --org <org> --format json
Creates an isolated development branch for schema edits without touching production.
Strengths for Agents
- +
--format jsonworks consistently across database, branch, and deploy-request commands. - + Branch +
branch diff+ deploy-request lifecycle aligns naturally with safe agent PR workflows. - + Service token env vars (
PLANETSCALE_SERVICE_TOKEN) avoid interactive browser login in CI.
Caveats & Pitfalls
- !
pscale shellis interactive by default unless SQL is piped via stdin. - !
pscale connectruns a persistent foreground tunnel process.