Skip to content

PlanetScale CLI commands - completion

Use the PlanetScale CLI to create development branches, open deploy requests, and make non-blocking schema changes directly from your terminal.

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

This command allows you to generate a completion script for the specified shell.

Usage:

Terminal
Copied
pscale completion <SUB-COMMAND> <FLAG>

Available sub-commands

Sub-commandDescription
bashGenerated completion for bash shell
zshGenerated completion for zsh shell
fishGenerated completion for fish shell
powershellGenerated completion for powershell shell

Available flags

FlagDescription
-h, --helpView help for completion command

Global flags

CommandDescription
--api-token <TOKEN>The API token to use for authenticating against the PlanetScale API.
--api-url <URL>The base URL for the PlanetScale API. Default is https://api.planetscale.com/.
--config <CONFIG_FILE>Config file. Default is $HOME/.config/planetscale/pscale.yml.
--debugEnable debug mode.
-f, --format <FORMAT>Show output in a specific format. Possible values: human (default), json, csv.
--no-colorDisable color output.
--service-token <TOKEN>The service token for authenticating.
--service-token-id <TOKEN_ID>The service token ID for authenticating.

How to load completions

Bash

Terminal
Copied
source <(pscale completion bash)

# To load completions for each session, execute once:
# Linux:
pscale completion bash > /etc/bash_completion.d/pscale
# macOS:
pscale completion bash > /usr/local/etc/bash_completion.d/pscale

Zsh

Terminal
Copied
# If shell completion is not already enabled in your environment,
# you will need to enable it.  You can execute the following once:

echo "autoload -U compinit; compinit" >> ~/.zshrc

# To load completions for each session, execute once:
pscale completion zsh > "${fpath[1]}/_yourprogram"

# You will need to start a new shell for this setup to take effect.

fish

Terminal
Copied
pscale completion fish | source

# To load completions for each session, execute once:
pscale completion fish > ~/.config/fish/completions/pscale.fish

PowerShell

Terminal
Copied
pscale completion powershell | Out-String | Invoke-Expression

# To load completions for every new session, run:
pscale completion powershell > pscale.ps1
# and source this file from your PowerShell profile.

Need help?

Get help from the PlanetScale support team, or join our GitHub discussion board to see how others are using PlanetScale.

Was this page useful?
Last updated on August 1, 2022
Help us improve this page
© 2022 PlanetScale Inc.