You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -93,3 +93,23 @@ Here's an annotated example `wp-cli.yml` file:
93
93
ssh: wpcli@wp-cli.org:2222
94
94
user: wpcli
95
95
path: /srv/www/wp-cli.org
96
+
97
+
## Environment variables
98
+
99
+
WP-CLI's behavior can be changed at runtime through the use of environment variables:
100
+
101
+
*`WP_CLI_CACHE_DIR` - Directory to store the WP-CLI file cache. Default is `~/.wp-cli/cache/`.
102
+
*`WP_CLI_CONFIG_PATH` - Path to the global `config.yml` file. Default is `~/.wp-cli/config.yml`.
103
+
*`WP_CLI_DISABLE_AUTO_CHECK_UPDATE` - Disable WP-CLI automatic checks for updates.
104
+
*`WP_CLI_PACKAGES_DIR` - Directory to store packages installed through WP-CLI's package management. Default is `~/.wp-cli/packages/`.
105
+
*`WP_CLI_SSH_PRE_CMD` - When using `--ssh=<ssh>`, perform a command before WP-CLI calls WP-CLI on the remote server.
106
+
107
+
To set an environment variable on demand, simply place the environment variable definition before the WP-CLI command you mean to run.
108
+
109
+
# Use vim to edit a post
110
+
$ EDITOR=vim wp post edit 1
111
+
112
+
To set the same environment variable value for every shell session, you’ll need to include the environment variable definition in your `~/.bashrc` or `~/.zshrc` file
0 commit comments