PlanetScale CLI commands - branch
Use the PlanetScale CLI to create development branches, open deploy requests, and make non-blocking schema changes directly from your terminal.
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.
This command allows you to create, delete, diff, and manage branches.
|Create a new branch on the specified database|
|Delete the specified branch from the a database|
|Show the diff of the specified branch against the parent branch.|
|List all branches of a database|
|Promote a database branch to production|
|Refresh the schema for a database branch|
|Show the schema of a branch|
|Show a specific backup of a branch|
|Switch to the specified branch|
* Flag is required
Sub-command flag descriptions
Some of the sub-commands have additional flags unique to the sub-command. This section covers what each of those does. See the above table for which context.
|Sub-command flag||Description||Applicable sub-commands|
|Parent branch that you want to create a new branch off of|
|Region where database should be created|
|Create a new branch from a specified backup|
|Perform the action in your web browser|
|Specify the database name|
|Create a new branch if it does not exist|
|If a new branch is being created, use this to specify a parent branch. Default is |
|View help for auth command|
|The organization for the current user|
|The API token to use for authenticating against the PlanetScale API.|
|The base URL for the PlanetScale API. Default is |
|Config file. Default is |
|Enable debug mode.|
|Show output in a specific format. Possible values: |
|Disable color output.|
|The service token for authenticating.|
|The service token ID for authenticating.|
list sub-command with
Opens the Branches page,
<https://app.planetscale.com/org/database/branches>, in browser.
This will return the diff against the parent branch.