diff --git a/packages/env/README.md b/packages/env/README.md index b9f549e1fbdc46..921c4da7aeb385 100644 --- a/packages/env/README.md +++ b/packages/env/README.md @@ -350,6 +350,29 @@ wp> ^C ✔ Ran `wp shell` in 'tests-cli'. (in 16s 400ms) ``` +#### Installing a plugin or theme on the development instance + +```sh +wp-env run cli plugin install custom-post-type-ui + +Creating 500cd328b649d63e882d5c4695871d04_cli_run ... done +Installing Custom Post Type UI (1.9.2) +Downloading installation package from https://downloads.wordpress.org/plugin/custom-post-type-ui.zip... +The authenticity of custom-post-type-ui.zip could not be verified as no signature was found. +Unpacking the package... +Installing the plugin... +Plugin installed successfully. +Success: Installed 1 of 1 plugins. +✔ Ran `plugin install custom-post-type-ui` in 'cli'. (in 6s 483ms) +``` + +**NOTE**: Depending on your host OS, you may experience errors when trying to install plugins or themes (e.g. `Warning: Could not create directory.`). This is typically because the user ID used within the container does not have write access to the mounted directories created by `wp-env`. To resolve this, run the `docker-compose` command directly from the directory created by `wp-env` and add `-u $(id -u)` and `-e HOME=/tmp` the `run` command as options: + +```sh +$ cd ~/wp-env/500cd328b649d63e882d5c4695871d04 +$ docker-compose run --rm -u $(id -u) -e HOME=/tmp cli [plugin|theme] install +``` + ### `wp-env destroy` ```sh