> setup & auth
Every pscale session starts here: install the CLI, authenticate against PlanetScale, and point it at the right organization. pscale remembers your org in a config file, so getting this wrong sends every later command — branch, connect, deploy-request — at the wrong place. These commands establish the credentials and org context everything else builds on.
// setup & auth
8 commands$ brew install planetscale/tap/pscale$ pscale auth login$ pscale auth check$ pscale auth logout$ pscale org list$ pscale org switch my-org$ pscale database list --org other-org$ pscale completion zsh > "${fpath[1]}/_pscale"// faq
Where does pscale store my login and org selection?
`pscale auth login` runs a browser OAuth flow and caches the session under ~/.config/planetscale/pscale.yml, which also records your default organization. Commands like `pscale org switch` update that file — or write a per-project .pscale.yml so a repo is pinned to its own org and branch.
How do I authenticate in CI where there's no browser?
Don't use `auth login` — create a service token with `pscale service-token create`, grant it database access with `add-access`, then pass it via the --service-token-id and --service-token flags or the PLANETSCALE_SERVICE_TOKEN_ID / PLANETSCALE_SERVICE_TOKEN environment variables.
Why does every command ask me for an organization?
If you belong to multiple orgs and haven't picked a default, pscale can't guess. Run `pscale org switch <org>` once, or pass --org <org> on any individual command. Service tokens are org-scoped, so in CI the org still has to be spelled out with --org.