Title: Target environments with VIP-CLI commands
Author: WordPress VIP Documentation
Published: January 4, 2022
Last modified: November 12, 2025

---

 1. [VIP-CLI](https://docs.wpvip.com/vip-cli/)
 2. Target environments with VIP-CLI commands

#  Target environments with VIP-CLI commands

An application on VIP can include one or more [environments](https://docs.wpvip.com/infrastructure/environments/),
and users may have access to more than one application hosted on VIP. A [VIP-CLI](https://docs.wpvip.com/vip-cli/)
command can only be run against one environment at a time, so both an application
and an environment type must be specified in a VIP-CLI command.

**Prerequisite**

 * [VIP-CLI is installed](https://docs.wpvip.com/vip-cli/installing-vip-cli/) and
   has been updated to [the most current version](https://www.npmjs.com/package/@automattic/vip/v/latest).
 * To run a VIP-CLI command against an application’s environment, a user must have
   an [App write role](https://docs.wpvip.com/manage-user-access/vip-dashboard/app-role)
   or greater for that application.

A user can determine which applications are available to them with the `[vip app list](https://docs.wpvip.com/vip-cli/commands/app/list/)`
command. For example:

    ```lang-shell
    $ vip app list
    ┌──────┬─────────────────┬─────────────────────────────────┐
    │ id   │ name            │ repo                            │
    ├──────┼─────────────────┼─────────────────────────────────┤
    │ 8886 │ example-app     │ wpcomvip/my-org-example-app     │
    ├──────┼─────────────────┼─────────────────────────────────┤
    │ 4325 │ mytestmultisite │ wpcomvip/my-org-mytestmultisite │
    └──────┴─────────────────┴─────────────────────────────────┘
    ```

The output returned by the `vip app list` command includes the application ID (`
id`), the application name (`name`), and the GitHub repository (`repo`).

An application can include one or more [platform environments](https://docs.wpvip.com/vip-platform/environments/);
typically Production, Preprod, and Develop. A user can list the environments that
are available for an application with the `[vip app [ID]](https://docs.wpvip.com/vip-cli/commands/app/)`
command. Using the application ID `8886` from the example output above, the command`
vip app 8886` reports that the application includes a `production` and a `develop`
environment:

    ```lang-shell
    $ vip app 8886
    ===================================
    + id: 8886
    + name: example-app
    + repo: wpcomvip/my-org-example-app
    ===================================
    ┌──────┬────────┬────────────┬────────────┬────────────┬────────────────┬────────────────────────────────┬──────────┐
    │ id   │ app id │ name       │ type       │ branch     │ current commit │ primary domain                 │ launched │
    ├──────┼────────┼────────────┼────────────┼────────────┼────────────────┼────────────────────────────────┼──────────┤
    │ 8886 │ 8886   │ production │ production │ production │ 39c3133        │ example-app.go-vip.net         │ false    │
    ├──────┼────────┼────────────┼────────────┼────────────┼────────────────┼────────────────────────────────┼──────────┤
    │ 8887 │ 8886   │ develop    │ develop    │ develop    │ 39c3133        │ example-app-develop.go-vip.net │ false    │
    └──────┴────────┴────────────┴────────────┴────────────┴────────────────┴────────────────────────────────┴──────────┘
    ```

## Target by application name

A VIP-CLI command can be run with only the application’s name specified: `@<app-
name>`.

When a VIP-CLI command is run with this structure, a prompt will appear in the command
line to select the environment type.

To target the `preprod` environment for an application with the name `example-app`:

    ```lang-shell
    $ vip @example-app -- wp option get home
    ? Which environment? … 
      production
    ❯ develop
    ```

### Application alias by name

The environment type can be specified within the VIP-CLI command by including the
application’s name, a dot separator, and the target environment type. For example:`
@<app-name>.<env>`

To target the `develop` environment of an application with the name `example-app`:

    ```lang-shell
    $ vip @example-app.develop -- wp option get blog_public
    1
    ```

## Target by application ID

A VIP-CLI command can be run with only the application’s ID specified: `@<app-ID
>`

When a VIP-CLI command is run with the `@<app-ID>` structure, a prompt will appear
in the command line for the environment type to be specified.

For example, to target the `develop` environment for an application with the ID `
8886`:

    ```lang-shell
    $ vip @8886 -- wp option get blog_public
    ? Which environment? … 
      production
    ❯ develop
    ```

### Application alias by ID

The environment type can be specified within the VIP-CLI command by including the
application’s ID, a dot separator, and the target environment. For example: `@<app-
ID>.<env>`

To target the `develop` environment for an application with the ID `8886`:

    ```lang-shell
    $ vip @8886.develop -- wp option get blog_public
    1
    ```

Last updated: November 12, 2025