Getting Started
Make sure to first set up your PlanetScale developer environment. Once you’ve installed thepscale 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. Auth tokens generated by pscale are valid for one month.
Usage:
Available sub-commands
Agents and automation should use
--format json on auth check and auth login. Start with pscale agent-guide --format json or the Agent setup prompt.Available flags
Global flags
Examples
The check sub-command
Command:
status, authenticated, auth_method, organization, issues, and next_steps.
Service tokens in CI:
The login sub-command (JSON for agents)
Command:
status: ok or action_required if organization setup fails after credentials are saved). Fields include verification_url, user_code, and browser_opened.
Open verification_url manually if the browser does not open. Do not retry login in a loop without browser access.
The login sub-command (interactive)
The logout sub-command
Command:
Revoked logins
If you lose a device that’s signed in to the CLI, revoke all sessions from your account settings. This revokes your CLI logins on every device. An Organization Administrator can also revoke your tokens for their organization. The CLI then can’t access that organization, but it keeps working with your other organizations. In both cases, runpscale auth login to sign in again.

