PlanetScale CLI
Use the PlanetScale CLI to create development branches, open deploy requests, and make non-blocking schema changes directly from your terminal.
Getting Started
Make sure to first set up your PlanetScale developer environment. Once you've installed the pscale
CLI, you can interact with PlanetScale and manage your databases straight from the command line.
Ready to take these commands for a run on the terminal?
Available Commands
Use pscale [command] [command]
to start up the pscale
CLI in your terminal.
Command | Subcommands/Options | Flags | Description |
---|---|---|---|
api | --help , --org string , --database string , --branch string , --field key=value , --header stringArray , --input string , --method string , --query key=value | Performs authenticated calls against the PlanetScale API and prints the response to stdout. | |
audit-log | list | --help , --org string | List all audit logs |
auth | login , logout | --help | Authenticate via console |
backup | create , delete , list , restore , show | --help , --org string | Manage branch backups |
branch | create , delete , diff , keyspaces , list , promote , refresh-schema , schema , show , switch , vschema | --help , --org string | Manage branches |
completion | bash , zsh , fish , powershell | --help | Generate completion script for specified shell |
connect | <database_name> <branch_name> | --execute string , --execute-env-url string , --execute-protocol string , --help , --host string , --org string , --port string , --remote-addr string , --role string | Create a secure connection to the given database and branch |
database | create , delete , dump , list , restore-dump , show | --help | Manage databases |
deploy-request | apply , cancel , close , create , deploy , diff , edit , list , revert , review , show , skip-revert | --help | Manage deploy requests including gated deployments |
help | audit-log , auth , backup , branch , completion , connect , data-import , database , deploy-request , help , org , password , region , service-token , shell , signup | --help | View help for any command |
org | list , show , switch | --help | Manage and switch organizations |
password | create , delete , list | --help , --org string | Manage branch credentials |
ping | --help , --count, -n int , --concurrency int , --provider, -p string --timeout duration | Check latency between your machine and PlanetScale's public regions | |
region | list | --org string | View available regions |
service-token | add-access , create , delete , delete-access , list , show-access | --help , --org string | Manage access of service tokens |
shell | <database_name> <branch_name> | --help , --local-addr string , --org string , --remote-addr string | Open a MySQL shell instance to the specified database and branch |
signup | --help | Sign up for a new PlanetScale account |
Flags
You may use the following flags with the PlanetScale CLI commands.
Flag | Description |
---|---|
--api-token string | The API token to use for authenticating against the PlanetScale API |
--api-url string | The base URL for the PlanetScale API. (default "https://api.planetscale.com/") |
--config string | Config file (default: $HOME/.config/planetscale/pscale.yml) |
--debug | Enable debug mode |
-f, --format string | Show output in specific format. Possible values: [human, json, csv] (default: "human") |
-h, --help | Get more information about a command |
--no-color | Disable color output |
--service-token string | Service Token for authenticating |
--service-token-id string | The Service Token ID for authenticating |
--version | Show pscale version |
Service tokens permissions
A complete list of access permissions available for use with service tokens can be found in the PlanetScale API documentation.
Need help?
Get help from the PlanetScale support team, or join our GitHub discussion board to see how others are using PlanetScale.