Skip to main content

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 org command

This command allows you to list, show, switch, and update organizations, and to manage organization members, teams, and SSO. Usage:

Available sub-commands

* Flag is required

Service token automation: org

Legend: ✅ supported · 🚫 unavailable with a service token · 👤 interactive login only. org show fails with not authenticated yet. Please run 'pscale auth login' under a valid service token. That is the no-current-org state. Do not run pscale auth login. Use org list --format json, then set PLANETSCALE_ORG or pass --org on resource commands. SSO commands require manage_sso on the service token. org update requires write_organization. Setup and commands to avoid: CLI overview · Service tokens

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.

Available flags

Global flags

Examples

The org command with switch sub-command

Command:
Output: Successfully switched to organization <ORGANIZATION_NAME> (using file: /Users/name/.config/planetscale/pscale.yml)

The org command with member sub-commands

Command:
Members can be identified by email or by the USER_ID shown by org member list, which is paginated at 100 members per page. Changing another member’s role or removing them requires the organization admin role, and you cannot change your own role or remove the last admin. You can remove yourself without being an admin.

Update organization settings

--org is required. Only flags you pass are sent to the API.
--spend-alert-amount cannot be combined with --spend-alert=false. You cannot enable both --idp-managed-roles and --idp-sso-managed-roles. Enabling one turns the other off.

Manage organization SSO

--org is required. Organization administrators can enable SSO from the CLI. Service tokens need manage_sso access. See Single sign-on for what enabling SSO does to membership. sso domain verify returns a portal URL and tries to open it. Domain records appear after you finish verification in the portal. With --wait, the command prints the URL, then waits until a new domain is verified or failed.
In JSON mode, disable, directory disable, and domain delete require --force.

Manage organization teams

Teams can be identified by ID, name, or slug. --org is required. List and member-list commands are paginated; pass --page for the next page instead of walking every page automatically.
SSO or directory-managed teams cannot be updated, deleted, or have members added or removed through the API.

Need help?

Get help from the PlanetScale Support team, or join our Discord community to see how others are using PlanetScale.