You can view the available commands with the
vip --help command:
$ vip --help Usage: vip [options] [command] Commands: app List and modify your VIP applications import Check the validity of an import source logout Logout from your current session sync Sync production to a development environment wp Run WP CLI commands against an environment Options: -h, --help Output the help for the (sub)command -v, --version Output the version number -h, --help Output usage information -v, --version Output the version number
Specifying app and environment
On VIP, each application has one or more environments, such as
develop, and each application has an alias that appears in the VIP Dashboard.
An app and its environment can be specified in a VIP-CLI command by providing the app alias or app ID, a dot separator, and the environment name, in the form of:
@<app-alias or app ID>.<env>.
Some example WP-CLI commands run on a
production environment with the alias
$ vip @wpvip.production -- wp option get home $ vip @wpvip.production -- wp user list $ vip @wpvip.production -- wp post list --posts_per_page=100 --url=example.com/fr $ vip @wpvip.production -- wp cache delete example-key
In the examples above, the double dash (
wp separates arguments of the
vip command from those of the
wp command. You should always include them to avoid unexpected issues due to parameter conflicts.
Command output can be redirected and piped for creating powerful workflows and tools:
$ vip @wpvip.production -- wp user list --format=json | jq $ vip @wpvip.production -- wp term list category --format=csv > category.csv
VIP-CLI includes an interactive shell mode that provides a terminal-like interface into your WordPress site. Run the VIP-CLI command in the pattern of
vip @<app-alias>.<env> -- wp to enter the interactive shell mode, then WP-CLI commands can be run on their own:
$ vip @wpvip.production -- wp wpvip.production:~$ wp option get home https://example.com wpvip.production:~$ wp cache delete my-cache-key my-cache-group Success: Object deleted. wpvip.production:~$
Using the interactive shell mode is a convenient way to run multiple commands on the same environment and behaves much like a standard terminal or SSH session would. While the interactive shell looks and acts like a standard terminal, it does not currently support bash operators or commands (e.g.
xargs, variable substitution, etc). Those commands need to be run in the standard VIP-CLI format.
Cancelling a command
To cancel a command, you have two options:
- From the VIP-CLI: You can hit
CTRL + C.
- From the VIP Dashboard: Navigate to the WP-CLI Log. Click on the red cross button to cancel the command.
In both cases, only the user who started a command can cancel it.