PlanetScale CLI

PlanetScale is more than a database and our CLI is more than a jumble of commands. It's a command center.

Getting Started

Make sure to first set up your PlanetScale developer environment. Once you've installed the pscale CLI, you'll be able to interact with PlanetScale and manage your databases.

Ready to take these commands for a run on the terminal?

PlanetScale CLI
PlanetScale CLI

Available Commands

Use pscale [command] [command] to start up the pscale CLI in your terminal.

CommandSubcommands/Options
authLogin, logout, refresh your authentication
backupCreate, read, destroy, and update branch backups
branchCreate, delete, and manage branches
connectCreate a secure connection to the given database and branch
databaseCreate, read, destroy, and update databases
deploy-requestCreate, approve, diff, and manage deploy requests
helpHelp about any command
orgModify and manage organization options
service-tokenCreate, get, and list service tokens
shellOpen a MySQL shell instance to the given database and branch
signupSignup for a new PlanetScale account

Flags

You may use the following flags with the PlanetScale CLI commands.

FlagDescription
--api-token stringThe API token to use for authenticating against the PlanetScale API
--config stringConfig file (default is $HOME/.config/planetscale/pscale.yml)
--debugEnable debug mode
-f, --format stringShow output in specific format. Possible values: [human, json, csv] (default "human")
-h, --helpGet more information about a command
--service-token stringService Token for authenticating
--service-token-name stringThe Service Token name for authenticating
--versionShow pscale version. Verify that you're using the latest version

Service Tokens in organizations

To add service tokens for your organization, here's a complete list of access permissions that can be granted to a token:

Token Access Permissions:What they control:
read_branch, delete_branch, create_branchCRUD on Branches of a Database
connect_branchConnect to development Branches of a Database
connect_production_branchConnect to production Branches of a Database
read_deploy_request, create_deploy_request, approve_deploy_requestDeploy Requests on Branches of a Database
read_comment, create_commentComments of Deploy Requests on Branches of a Database

Need help?

Get help from PlanetScale's support team, or join our GitHub Discussion board to see how others are using PlanetScale.

Was this page useful?
Last updated on June 17, 2021
PrivacyTerms
© 2021 PlanetScale Inc.