Skip to content

Basic usage

Available VIP-CLI commands and their options can be reviewed by running vip --help (or -h).

A help menu for individual commands can be viewed by running: vip [command] -h

For example, to view the options and more information about vip config:

$ vip config -h
  Usage: vip config [options] [command]

  Commands:
    envvar  Manage environment variables for an application environment

  Options:
    -d, --debug    Activate debug output
    -h, --help     Output the help for the (sub)command
    -v, --version  Output the version number

VIP-CLI commands

To run a VIP-CLI command against an application’s environment, a user must have an App write role or greater for that application.

A VIP-CLI command can only be run against one environment at a time, so an application and one of its environments must be specified in a VIP-CLI command.

An environment can be targeted in a VIP-CLI command by including the application’s alias, a dot separator, and the target environment type: @<app-alias>.<env>

For example, to target the preprod environment for an application with the alias mytestsite:

$ vip @mytestsite.preprod sync
===================================
+ App: mytestsite (id: 4323)
+ Environment: preprod (id: 4354)
+ Replacements: 
┌─────────────────────────┬─────────────────────────────────┐
│ from                    │ to                              │
├─────────────────────────┼─────────────────────────────────┤
│ //mytestsite.go-vip.net │ //mytestsite-preprod.go-vip.net │
└─────────────────────────┴─────────────────────────────────┘
===================================
? Are you sure you want to sync from production? (y/N) › false

WP-CLI commands

Running WP-CLI commands with VIP-CLI requires a double dash (--) separating the arguments of the vip command from those of the wp command. The double dash must be included to avoid unexpected issues due to parameter conflicts.

For example, to retrieve the list of WordPress users from the preprod environment of the mytestsite application:

$ vip @mytestsite.preprod -- wp user list

Behavior of --skip-plugins[=<plugins>]

On the VIP Platform, including the --skip-plugins[=<plugins>] option with a WP-CLI command will skip the loading of all plugins—or the plugin(s) specified—and skip the loading of client-mu-plugins, but VIP MU plugins will still load.

Interactive shell

VIP-CLI includes an interactive shell mode that provides a terminal-like interface to a VIP WordPress site.

To enter the interactive shell mode, run the VIP-CLI command: vip @<app-alias>.<env> -- wp

WP-CLI commands can then be run without the vip @<app-alias>.<env> -- argument structure.

$ vip @mytestsite.preprod -- wp 
mytestsite.preprod:~$ wp option get home 
https://example.com  
mytestsite.preprod:~$ wp cache delete my-cache-key my-cache-group 
Success: Object deleted.
mytestsite.preprod:~$ 

The interactive shell mode is a convenient way to run multiple commands on the same environment and behaves like a standard terminal or SSH session. 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.

Canceling a command

WP-CLI commands that are still running can be canceled by the user that initiated the command.

  • From the VIP-CLI terminal: Type the keyboard abort command Control + C.
  • From the VIP Dashboard: Navigate to the WP-CLI Commands panel. Select the “Cancel” option to the right of the Running command.

Last updated: February 06, 2023