PlanetScale CLI commands - auth

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.

The auth command

This command allows you to login, logout, and refresh your authentication.


pscale auth <SUB-COMMAND> <FLAG>

Available sub-commands

loginAuthenticate with the PlanetScale API
logoutLog out of the PlanetScale API

Available flags

-h, --helpView help for auth command

Global flags

--api-token <TOKEN>The API token to use for authenticating against the PlanetScale API.
--api-url <URL>The base URL for the PlanetScale API. Default is
--config <CONFIG_FILE>Config file. Default is $HOME/.config/planetscale/pscale.yml.
--debugEnable debug mode.
-f, --format <FORMAT>Show output in a specific format. Possible values: human (default), json, csv.
--no-colorDisable color output.
--service-token <TOKEN>The service token for authenticating.
--service-token-id <TOKEN_ID>The service token ID for authenticating.


The login sub-command


pscale auth login


A new browser tab will open and ask you to sign in via browser if you're not already signed in. Next, you'll be asked to confirm the Device confirmation code displayed in your terminal:

Confirmation Code: XXXXXXX

If they match, click "Confirm code", and you'll be signed in to the CLI.

The logout sub-command


pscale auth logout


Press Enter to log out of the PlanetScale API.

Need help?

Get help from the PlanetScale support team, or join our GitHub discussion board to see how others are using PlanetScale.

Was this page useful?
Last updated on
Help us improve this page