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 login, logout, and refresh your authentication.
pscale auth <SUB-COMMAND> <FLAG>
|Authenticate with the PlanetScale API|
|Log out of the PlanetScale API|
|Check if you are authenticated|
|View help for |
|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.|
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.
pscale auth logout
Press Enter to log out of the PlanetScale API.
pscale auth check
You are authenticated.
If you are not authenticated, exit code 1 will be returned.