PlanetScale CLI commands - service-token
Use the PlanetScale CLI to create development branches, open deploy requests, and make non-blocking schema changes directly from your terminal.
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 create, list, and manage access for service tokens.
pscale service-token <SUB-COMMAND> <FLAG>
|Add individual permissions to the specified service token in the organization|
|Create a service token for the organization|
|Delete an entire service token in an organization|
|Delete individual permissions granted to a service token in the organization|
|List the IDs of an organization's service tokens|
|Fetch a service token and its accesses|
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.
|Sub-command flag||Description||Applicable sub-commands|
|The database this project is using.|
|View help for |
|The organization for the current user|
|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 service-token add-access <TOKEN_ID> read_branch delete_branch create_branch --database <DATABASE_NAME_2>
This will add the following permissions to the specified access token:
create_branch. The output will show the updated permissions on all databases.
You can find a list of all permissions in our Access control doc.
|DATABASE_NAME||approve_deploy_request, connect_branch, connect_production_branch, create_branch, create_comment, create_deploy_request, delete_branch, read_branch, read_comment, read_deploy_request|
|DATABASE_NAME_2||read_branch, delete_branch, create_branch|