> ## Documentation Index
> Fetch the complete documentation index at: https://planetscale.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# PlanetScale CLI

To interact with PlanetScale and manage your databases, you can use the `pscale` CLI to do the following:

* Create, delete and list your databases and branches
* Open a secure MySQL shell instance
* Manage your deploy requests
* ...and more!

<Note>
  `pscale` can use the MySQL command-line client to quickly open an interactive shell for a database branch. Optional instructions for installing the MySQL client can be found for each platform below.
</Note>

## Getting Started

Make sure to first [set up your PlanetScale developer environment](/cli/planetscale-environment-setup). Once you've installed the `pscale` CLI, you can interact with PlanetScale and manage your databases straight from the command line.

## Available Commands

Use `pscale [command] [command]` to start up the `pscale` CLI in your terminal.

| **Command**                               | **Subcommands/Options**                                                                                                                                                                                                                                         | **Flags**                                                                                                                                                                        | **Product**      | **Description**                                                                                                                                                                  |
| :---------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`api`](/cli/api)                         |                                                                                                                                                                                                                                                                 | `--help`, `--org string`, `--database string`, `--branch string`, `--field key=value`, `--header stringArray`, `--input string`, `--method string`, `--query key=value`          | Vitess, Postgres | Performs authenticated calls against the PlanetScale API and prints the response to stdout.                                                                                      |
| [`audit-log`](/cli/audit-log)             | `list`                                                                                                                                                                                                                                                          | `--help`, `--org string`                                                                                                                                                         | Vitess, Postgres | List all [audit logs](/security/audit-log#review-your-organization-audit-log)                                                                                                    |
| [`auth`](/cli/auth)                       | `login`, `logout`                                                                                                                                                                                                                                               | `--help`                                                                                                                                                                         | Vitess, Postgres | Authenticate via console                                                                                                                                                         |
| [`backup`](/cli/backup)                   | `create`, `delete`, `list`, `restore`, `show`                                                                                                                                                                                                                   | `--help`, `--org string`                                                                                                                                                         | Vitess, Postgres | Manage [branch backups](/vitess/backups)                                                                                                                                         |
| [`branch`](/cli/branch)                   | `create`, `delete`, `diff`, `keyspaces`, `list`, `promote`, `refresh-schema`, `schema`, `show`, `switch`, `vschema`                                                                                                                                             | `--help`, `--org string`                                                                                                                                                         | Vitess, Postgres | Manage [branches](/vitess/schema-changes/branching)                                                                                                                              |
| [`completion`](/cli/completion)           | `bash`, `zsh`, `fish`, `powershell`                                                                                                                                                                                                                             | `--help`                                                                                                                                                                         | Vitess, Postgres | Generate completion script for specified shell                                                                                                                                   |
| [`connect`](/cli/connect)                 | `<database_name>` `<branch_name>`                                                                                                                                                                                                                               | `--execute string`, `--execute-env-url string`, `--execute-protocol string`, `--help`, `--host string`, `--org string`, `--port string`, `--remote-addr string`, `--role string` | Vitess           | Create a [secure connection](/vitess/tutorials/connect-any-application#option-2-connect-using-the-planetscale-proxy) to the given database and branch                            |
| [`database`](/cli/database)               | `create`, `delete`, `dump`, `list`, `restore-dump`, `show`                                                                                                                                                                                                      | `--help`                                                                                                                                                                         | Vitess, Postgres | Manage databases                                                                                                                                                                 |
| [`deploy-request`](/cli/deploy-request)   | `apply`, `cancel`, `close`, `create`, `deploy`, `diff`, `edit`, `list`, `revert`, `review`, `show`, `skip-revert`                                                                                                                                               | `--help`                                                                                                                                                                         | Vitess           | Manage [deploy requests](/vitess/schema-changes/deploy-requests#create-a-deploy-request) including [gated deployments](/vitess/schema-changes/deploy-requests#gated-deployments) |
| `help`                                    | `audit-log`, `auth`, `backup`, `branch`, `completion`, `connect`, `data-import`, `database`, `deploy-request`, `help`, `mcp`, `org`, `password`, `ping`, `region`, `role`, `service-token`, `shell`, `signup`, `size`, `traffic-control`, `webhook`, `workflow` | `--help`                                                                                                                                                                         | Vitess, Postgres | View help for any command                                                                                                                                                        |
| [`org`](/cli/org)                         | `list`, `show`, `switch`                                                                                                                                                                                                                                        | `--help`                                                                                                                                                                         | Vitess, Postgres | Manage and switch [organizations](/security/access-control)                                                                                                                      |
| [`mcp`](/cli/mcp)                         | `install`, `server`                                                                                                                                                                                                                                             | `--target string (claude\|cursor\|zed)`, `--help`                                                                                                                                | Vitess, Postgres | Install and start an MCP server ([docs](/connect/mcp))                                                                                                                           |
| [`password`](/cli/password)               | `create`, `delete`, `list`                                                                                                                                                                                                                                      | `--help`, `--org string`                                                                                                                                                         | Vitess           | Manage [branch credentials](/vitess/connecting/connection-strings)                                                                                                               |
| [`ping`](/cli/ping)                       |                                                                                                                                                                                                                                                                 | `--help`, `--count, -n int`, `--concurrency int`, `--provider, -p string` `--timeout duration`                                                                                   | Vitess, Postgres | Check [latency](/vitess/connecting/network-latency) between your machine and PlanetScale's public regions                                                                        |
| [`region`](/cli/region)                   | `list`                                                                                                                                                                                                                                                          | `--org string`                                                                                                                                                                   | Vitess, Postgres | View available [regions](/vitess/regions)                                                                                                                                        |
| [`role`](/cli/role)                       | `create`, `delete`, `get`, `list`, `reassign`, `renew`, `reset`, `reset-default`, `update`                                                                                                                                                                      | `--help`, `--org string`, `--inherited-roles string`, `--ttl duration`, `--force`, `--successor string`, `--name string`, `--web`                                                | Postgres         | Manage [Postgres roles](/postgres/connecting/roles)                                                                                                                              |
| [`service-token`](/cli/service-token)     | `add-access`, `create`, `delete`, `delete-access`, `list`, `show-access`                                                                                                                                                                                        | `--help`, `--org string`                                                                                                                                                         | Vitess, Postgres | Manage access of [service tokens](/api/reference/service-tokens)                                                                                                                 |
| [`size`](/planetscale-plans)              | `cluster list`                                                                                                                                                                                                                                                  | `--help`, `--org string`, `--region string`, `--metal`                                                                                                                           | Vitess, Postgres | View available [cluster sizes](/planetscale-plans)                                                                                                                               |
| [`traffic-control`](/cli/traffic-control) | `budget`, `rule`                                                                                                                                                                                                                                                | `--help`, `--org string`                                                                                                                                                         | Postgres         | Manage [Database Traffic Control](/postgres/traffic-control) budgets and rules for a Postgres database branch                                                                    |
| [`shell`](/cli/shell)                     | `<database_name>` `<branch_name>`                                                                                                                                                                                                                               | `--help`, `--local-addr string`, `--org string`, `--remote-addr string`                                                                                                          | Vitess, Postgres | Open a MySQL shell instance to the specified database and branch                                                                                                                 |
| [`signup`](/cli/signup)                   |                                                                                                                                                                                                                                                                 | `--help`                                                                                                                                                                         | Vitess, Postgres | Sign up for a new PlanetScale account                                                                                                                                            |
| [`webhook`](/cli/webhook)                 | `create`, `delete`, `list`, `show`, `test`, `update`                                                                                                                                                                                                            | `--help`, `--org string`, `--events string`, `--url string`, `--enabled`                                                                                                         | Vitess, Postgres | Manage [webhooks](/api/webhooks) for databases                                                                                                                                   |
| [`workflow`](/cli/workflow)               | `cancel`, `complete`, `create`, `cutover`, `list`, `retry`, `reverse-cutover`, `reverse-traffic`, `show`, `switch-traffic`, `verify-data`                                                                                                                       | `--help`, `--org string`                                                                                                                                                         | Vitess           | Manage the workflows for PlanetScale databases                                                                                                                                   |

## Flags

You may use the following flags with the PlanetScale CLI commands.

| **Flag**                    | **Description**                                                                                                |
| :-------------------------- | :------------------------------------------------------------------------------------------------------------- |
| `--api-token string`        | The API token to use for authenticating against the PlanetScale API                                            |
| `--api-url string`          | The base URL for the PlanetScale API. (default "[https://api.planetscale.com/](https://api.planetscale.com/)") |
| `--config string`           | Config file *(default: `$HOME/.config/planetscale/pscale.yml`)*                                                |
| `--debug`                   | Enable debug mode                                                                                              |
| `-f, --format string`       | Show output in specific format. Possible values: *\[human, json, csv] (default: "human")*                      |
| `-h, --help`                | Get more information about a command                                                                           |
| `--no-color`                | Disable color output                                                                                           |
| `--service-token string`    | Service Token for authenticating                                                                               |
| `--service-token-id string` | The Service Token ID for authenticating                                                                        |
| `--version`                 | Show pscale version                                                                                            |

## Service tokens permissions

A complete list of access permissions available for use with service tokens can be found in the [PlanetScale API documentation](/api/reference/service-tokens#access-permissions).

## Need help?

Get help from [the PlanetScale Support team](https://planetscale.com/contact?initial=support), or join our [Discord community](https://pscale.link/community) to see how others are using PlanetScale.
