{"_id":"@agency/wp-env","_rev":"2-829ca0ac7b612ef237a7c4440d4cf447","name":"@agency/wp-env","dist-tags":{"latest":"4.2.2"},"versions":{"4.2.1":{"name":"@agency/wp-env","version":"4.2.1","description":"A zero-config, self contained local WordPress environment for development and testing.","author":{"name":"The WordPress Contributors"},"license":"GPL-2.0-or-later","keywords":["wordpress","gutenberg","environment","docker"],"homepage":"https://github.com/WordPress/gutenberg/tree/HEAD/packages/env#readme","repository":{"type":"git","url":"git+https://github.com/WordPress/gutenberg.git","directory":"packages/env"},"bugs":{"url":"https://github.com/WordPress/gutenberg/issues"},"directories":{"lib":"lib","test":"tests"},"main":"lib/env.js","bin":{"agency-wp":"bin/wp-env"},"dependencies":{"chalk":"^4.0.0","copy-dir":"^1.3.0","docker-compose":"^0.22.2","extract-zip":"^1.6.7","got":"^10.7.0","inquirer":"^7.1.0","js-yaml":"^3.13.1","ora":"^4.0.2","rimraf":"^3.0.2","simple-git":"^2.35.0","terminal-link":"^2.0.0","yargs":"^17.3.0"},"publishConfig":{"access":"public"},"scripts":{"test":"echo \"Error: run tests from root\" && exit 1"},"gitHead":"8ebe046873d6b0970fb0b30dcb3c7e5a06148704","_id":"@agency/wp-env@4.2.1","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"integrity":"sha512-c7KOqB8VWA54coXyX1lDoWRNMskzhOb7TaNn7+D2oa9azvAwb196gVj/xpmRWCtnTHdms9tK1tFhBRUW9WiB1A==","shasum":"32fb989fc9d65c4a7858591d9b99045649fe6b76","tarball":"https://registry.npmjs.org/@agency/wp-env/-/wp-env-4.2.1.tgz","fileCount":31,"unpackedSize":142769,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBbpICRA9TVsSAnZWagAAAFoQAJmx81SxX4xy+/sXeTwO\n4KaMz+7wuhDbS9z2YVMP5sKyfg9YX1jXGpD8tsse0opHgGuzVSBeuQfFzmf6\nD6cFVW3a3w4n/dJFYa51+5WT5N6KWQefZKc+Fe5htoFe3qSgvNSPfBVdvYkw\naH3uL7InUJTpBs7mBOFm49vm2UgCNK3Mw0aLY417+RYv/xwAdxumOM3YRMaS\nRK4hEz80ky0WEbRa4h7kanzjTKStesrggIKC+uKh1rKdUphhFUiuw2vvuI7D\nW5uiUOi31yBYYz8tzfoWQ80Y7RVNueUrQngry5wSq9go38/tmjWJJqAm9Lk7\nyLcCLrZGBj6A169/wTBD4/VfoJyAo55Y9/c+uVR0a54yUS0V2oHfF0aJoPPW\nlsN2jRzzR8F6qb6vEBojkVGS/cJtbuwOZvjtu6ioVpHG7Gzwo16en1qHHiyX\n1XDj1dbH/nFYtZlxp991QfHAYYCMpLtP0nGFnhJIcdEMcHMAWWDdq/L+bCu7\ni0F7hAteAVPetW+jRKlewa6yGlTMrc0q4vc48hj/GkGkc7AzFU2OzrETX1Db\nRl8157kb1nKX9WK6cahG6mKqazNxN+ZWWn/Pq0k/tDTFFaeFRbeKZb5DBYYi\nmj3WOVlT8zaSAt5ktgQW7O9GF1OF6abYrjoLLEkQeHZvIcF2HhPleNsXutIy\nHCXs\r\n=u1Pc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFY11wiLnvK/wCzcQspMItAaVB6KBHa1uuROHXLyPWnAIhAJWNE9cBAFCpzFClj0IYZv8dU0XkW7YCAD6UDR6edYPE"}]},"_npmUser":{"name":"rheinardkorf","email":"rheinard@thekorfs.com"},"maintainers":[{"name":"rheinardkorf","email":"rheinard@thekorfs.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wp-env_4.2.1_1644542536256_0.4743916583932355"},"_hasShrinkwrap":false},"4.2.2":{"name":"@agency/wp-env","version":"4.2.2","description":"A zero-config, self contained local WordPress environment for development and testing.","author":{"name":"The WordPress Contributors"},"license":"GPL-2.0-or-later","keywords":["wordpress","gutenberg","environment","docker"],"homepage":"https://github.com/WordPress/gutenberg/tree/HEAD/packages/env#readme","repository":{"type":"git","url":"git+https://github.com/WordPress/gutenberg.git","directory":"packages/env"},"bugs":{"url":"https://github.com/WordPress/gutenberg/issues"},"directories":{"lib":"lib","test":"tests"},"main":"lib/env.js","bin":{"agency-wp":"bin/wp-env"},"dependencies":{"chalk":"^4.0.0","copy-dir":"^1.3.0","docker-compose":"^0.22.2","extract-zip":"^1.6.7","got":"^10.7.0","inquirer":"^7.1.0","js-yaml":"^3.13.1","ora":"^4.0.2","rimraf":"^3.0.2","simple-git":"^2.35.0","terminal-link":"^2.0.0","yargs":"^17.3.0"},"publishConfig":{"access":"public"},"scripts":{"test":"echo \"Error: run tests from root\" && exit 1"},"gitHead":"cb3486a7374741bb3a92224b0abb559940d04d65","_id":"@agency/wp-env@4.2.2","_nodeVersion":"16.13.2","_npmVersion":"8.1.2","dist":{"integrity":"sha512-2OO/4V0NZZAlntPIzEbHD0EKmEtS7myBBrKrK7vbZNdMWimDygJA95J15mcZpIjCnFLdrIKcKTedoZudXvvs5g==","shasum":"38741651cdd123411d6c95d5b4a14f11cdd5a01b","tarball":"https://registry.npmjs.org/@agency/wp-env/-/wp-env-4.2.2.tgz","fileCount":31,"unpackedSize":143286,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiDGTYCRA9TVsSAnZWagAAtr4P+waOgoOvgFmEtye+BKUa\n1Q3opkQCYHzWm0/qzZpRhhByZYArM4HeSUOna4t1BIg9VynACRq+eTazhg73\nv45RrhTYfZkXHkCliBfespGUorYOV+4+Sg4wqfJMfeU7Nuq6nP8mlAV0ICbi\naMOEdnjctOEhTUxr84zxlX0DZrC/Zhm3KVBBkduOnfY0QQnR117ZCyHWfoDT\nNCG1C8jLrVu86edn02N9SX3h9/breH+m4BUjLHGODH4Ofbg4J6YWqY2Uay94\nKp15WecV2dPeiCBrGto945M75jMrNqmBryyioDdxcwv45pbufjLnxJ+KDu7W\nZiL8E3R5j1apWRjsJeQh+ZtAWlJ5U1xPi6eV46URW0clYFkRvGwMdxN36erx\nqvstdte+0sd3DH3ydNZGdoJAi061R0ojFZhcA0/55z2X0rAzRj8QHdT2/DfA\nPIZJVRC2V4Z/0oVbLDdYFejf5dnOm/SQsmDTcq24FTLYiWTH2XYr1UXdDDAI\nhCaGmhe6ae4EAaiDXRPq540YOlgM1VSX+pa09pB/OgmdEFib3puQu8/5qm0Q\nGWNGqi6aefwCcSpoPpHDY8eGB1ZcuNlLSVzlwcAq0Vo3uggeHMl29HmEq2lk\nlz0+EkvONAoHlEfumnkwB4bE7mu02h+AfjLsDxnMD97uUGsoUR/p/Jy7OKUx\nK78/\r\n=eQM9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIc3apqFVmooM1ZeSdib/ht/DuCgYjnvQj2yDPBTrZrgIgXq3Ru0gnSuPc2sCQ3iFgkwFMTtN1P9fdfhhfAy1BrVY="}]},"_npmUser":{"name":"rheinardkorf","email":"rheinard@thekorfs.com"},"maintainers":[{"name":"rheinardkorf","email":"rheinard@thekorfs.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wp-env_4.2.2_1644979415903_0.7761452129590296"},"_hasShrinkwrap":false}},"time":{"created":"2022-02-11T01:22:16.190Z","4.2.1":"2022-02-11T01:22:16.469Z","modified":"2022-04-04T11:55:22.952Z","4.2.2":"2022-02-16T02:43:36.042Z"},"maintainers":[{"name":"rheinardkorf","email":"rheinard@thekorfs.com"}],"description":"A zero-config, self contained local WordPress environment for development and testing.","homepage":"https://github.com/WordPress/gutenberg/tree/HEAD/packages/env#readme","keywords":["wordpress","gutenberg","environment","docker"],"repository":{"type":"git","url":"git+https://github.com/WordPress/gutenberg.git","directory":"packages/env"},"author":{"name":"The WordPress Contributors"},"bugs":{"url":"https://github.com/WordPress/gutenberg/issues"},"license":"GPL-2.0-or-later","readme":"# `wp-env` clone\n\n**-- Adds new configuration option to specify the underlining database image.--**\n\nBy default the `mariadb` database image is used for `wp-env`. In most cases this is perfectly fine, this package is for the edge case when it is not.\n\nOverride the image by using `.wp-env.json` configuration file and changing the following new option:\n\n```json\n{\n\t\"dbImage\": \"mysql\",\n}\n```\n\nIf you are not sure why you need this project, then this is not for you. Stick to the official project.\n\n---\n\nBelow is the same as the official README.md\n\n`wp-env` lets you easily set up a local WordPress environment for building and testing plugins and themes. It's simple to install and requires no configuration.\n\n## Quick (tl;dr) instructions\n\nEnsure that Docker is running, then:\n\n```sh\n$ cd /path/to/a/wordpress/plugin\n$ npm -g i @wordpress/env\n$ wp-env start\n```\n\nThe local environment will be available at http://localhost:8888 (Username: `admin`, Password: `password`).\n\n## Prerequisites\n\n`wp-env` requires Docker to be installed. There are instructions available for installing Docker on [Windows 10 Pro](https://docs.docker.com/docker-for-windows/install/), [all other versions of Windows](https://docs.docker.com/toolbox/toolbox_install_windows/), [macOS](https://docs.docker.com/docker-for-mac/install/), and [Linux](https://docs.docker.com/v17.12/install/linux/docker-ce/ubuntu/#install-using-the-convenience-script).\n\nNode.js and NPM are required. The latest LTS version of Node.js is used to develop `wp-env` and is recommended.\n\n## Installation\n\n### Installation as a global package\n\nAfter confirming that the prerequisites are installed, you can install `wp-env` globally like so:\n\n```sh\n$ npm -g i @wordpress/env\n```\n\nYou're now ready to use `wp-env`!\n\n### Installation as a local package\n\nIf your project already has a package.json, it's also possible to use `wp-env` as a local package. First install `wp-env` locally as a dev dependency:\n\n```sh\n$ npm i @wordpress/env --save-dev\n```\n\nThen modify your package.json and add an extra command to npm `scripts` (https://docs.npmjs.com/misc/scripts):\n\n```json\n\"scripts\": {\n\t\"wp-env\": \"wp-env\"\n}\n```\n\nWhen installing `wp-env` in this way, all `wp-env` commands detailed in these docs must be prefixed with `npm run`, for example:\n\n```sh\n# You must add another dash to pass the \"update\" flag to wp-env\n$ npm run wp-env start -- --update\n```\n\ninstead of:\n\n```sh\n$ wp-env start --update\n```\n\n## Usage\n\n### Starting the environment\n\nFirst, ensure that Docker is running. You can do this by clicking on the Docker icon in the system tray or menu bar.\n\nThen, change to a directory that contains a WordPress plugin or theme:\n\n```sh\n$ cd ~/gutenberg\n```\n\nThen, start the local environment:\n\n```sh\n$ wp-env start\n```\n\nFinally, navigate to http://localhost:8888 in your web browser to see WordPress running with the local WordPress plugin or theme running and activated. Default login credentials are username: `admin` password: `password`.\n\n### Stopping the environment\n\nTo stop the local environment:\n\n```sh\n$ wp-env stop\n```\n\n## Troubleshooting common problems\n\nMany common problems can be fixed by running through the following troubleshooting steps in order:\n\n### 1. Check that `wp-env` is running\n\nFirst, check that `wp-env` is running. One way to do this is to have Docker print a table with the currently running containers:\n\n```sh\n$ docker ps\n```\n\nIn this table, by default, you should see three entries: `wordpress` with port 8888, `tests-wordpress` with port 8889 and `mariadb` with port 3306.\n\n### 2. Check the port number\n\nBy default `wp-env` uses port 8888, meaning that the local environment will be available at http://localhost:8888.\n\nYou can configure the port that `wp-env` uses so that it doesn't clash with another server by specifying the `WP_ENV_PORT` environment variable when starting `wp-env`:\n\n```sh\n$ WP_ENV_PORT=3333 wp-env start\n```\n\nRunning `docker ps` and inspecting the `PORTS` column allows you to determine which port `wp-env` is currently using.\n\nYou may also specify the port numbers in your `.wp-env.json` file, but the environment variables take precedent.\n\n### 3. Restart `wp-env`\n\nRestarting `wp-env` will restart the underlying Docker containers which can fix many issues.\n\nTo restart `wp-env`:\n\n```sh\n$ wp-env stop\n$ wp-env start\n```\n\n### 4. Restart Docker\n\nRestarting Docker will restart the underlying Docker containers and volumes which can fix many issues.\n\nTo restart Docker:\n\n1. Click on the Docker icon in the system tray or menu bar.\n2. Select _Restart_.\n\nOnce restarted, start `wp-env` again:\n\n```sh\n$ wp-env start\n```\n\n### 5. Reset the database\n\nResetting the database which the local environment uses can fix many issues, especially when they are related to the WordPress installation.\n\nTo reset the database:\n\n**⚠️ WARNING: This will permanently delete any posts, pages, media, etc. in the local WordPress installation.**\n\n```sh\n$ wp-env clean all\n$ wp-env start\n```\n\n### 6. Nuke everything and start again 🔥\n\nWhen all else fails, you can use `wp-env destroy` to forcibly remove all of the underlying Docker containers and volumes. This will allow you to start from scratch.\n\nTo nuke everything:\n\n**⚠️ WARNING: This will permanently delete any posts, pages, media, etc. in the local WordPress installation.**\n\n```sh\n$ wp-env destroy\n$ wp-env start\n```\n\n### 7. Debug mode and inspecting the generated dockerfile.\n\n`wp-env` uses docker behind the scenes. Inspecting the generated docker-compose file can help to understand what's going on.\n\nStart `wp-env` in debug mode\n\n```sh\nwp-env start --debug\n```\n\n`wp-env` will output its config which includes `dockerComposeConfigPath`.\n\n```sh\nℹ Config:\n\t...\n\t\"dockerComposeConfigPath\": \"/Users/$USERNAME/.wp-env/5a619d332a92377cd89feb339c67b833/docker-compose.yml\",\n\t...\n```\n\n## Using Xdebug\n\nXdebug is installed in the wp-env environment, but it is turned off by default. To enable Xdebug, you can use the `--xdebug` flag with the `wp-env start` command. Here is a reference to how the flag works:\n\n```sh\n# Sets the Xdebug mode to \"debug\" (for step debugging):\nwp-env start --xdebug\n\n# Sets the Xdebug mode to \"off\":\nwp-env start\n\n# Enables each of the Xdebug modes listed:\nwp-env start --xdebug=profile,trace,debug\n```\n\nYou can see a reference on each of the Xdebug modes and what they do in the [Xdebug documentation](https://xdebug.org/docs/all_settings#mode).\n\n_Since we are only installing Xdebug 3, Xdebug is only supported for PHP versions greater than or equal to 7.2 (the default). Xdebug won't be installed if `phpVersion` is set to a legacy version._\n\n### Xdebug IDE support\n\nTo connect to Xdebug from your IDE, you can use these IDE settings. This bit of JSON was tested for VS Code's `launch.json` format (which you can [learn more about here](https://code.visualstudio.com/docs/editor/debugging#_launchjson-attributes)) along with [this PHP Debug extension](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug). Its path mapping also points to a specific plugin -- you should update this to point to the source you are working with inside of the wp-env instance.\n\nYou should only have to translate `port` and `pathMappings` to the format used by your own IDE.\n\n```json\n{\n\t\"name\": \"Listen for XDebug\",\n\t\"type\": \"php\",\n\t\"request\": \"launch\",\n\t\"port\": 9003,\n\t\"pathMappings\": {\n\t\t\"/var/www/html/wp-content/plugins/gutenberg\": \"${workspaceFolder}/\"\n\t}\n}\n```\n\nOnce your IDEs Xdebug settings have been enabled, you should just have to launch the debugger, put a breakpoint on any line of PHP code, and then refresh your browser!\n\nHere is a summary:\n\n1. Start wp-env with xdebug enabled: `wp-env start --xdebug`\n2. Install a suitable Xdebug extension for your IDE if it does not include one already.\n3. Configure the IDE debugger to use port `9003` and the correct source files in wp-env.\n4. Launch the debugger and put a breakpoint on any line of PHP code.\n5. Refresh the URL wp-env is running at and the breakpoint should trigger.\n\n## Command reference\n\n`wp-env` creates generated files in the `wp-env` home directory. By default, this is `~/.wp-env`. The exception is Linux, where files are placed at `~/wp-env` [for compatibility with Snap Packages](https://github.com/WordPress/gutenberg/issues/20180#issuecomment-587046325). The `wp-env` home directory contains a subdirectory for each project named `/$md5_of_project_path`. To change the `wp-env` home directory, set the `WP_ENV_HOME` environment variable. For example, running `WP_ENV_HOME=\"something\" wp-env start` will download the project files to the directory `./something/$md5_of_project_path` (relative to the current directory).\n\n### `wp-env start`\n\nThe start command installs and initializes the WordPress environment, which includes downloading any specified remote sources. By default, `wp-env` will not update or re-configure the environment except when the configuration file changes. Tell `wp-env` to update sources and apply the configuration options again with `wp-env start --update`. This will not overwrite any existing content.\n\n```sh\nwp-env start\n\nStarts WordPress for development on port 8888 (override with WP_ENV_PORT) and\ntests on port 8889 (override with WP_ENV_TESTS_PORT). The current working\ndirectory must be a WordPress installation, a plugin, a theme, or contain a\n.wp-env.json file. After first install, use the '--update' flag to download\nupdates to mapped sources and to re-apply WordPress configuration options.\n\nOptions:\n  --help     Show help                                                 [boolean]\n  --version  Show version number                                       [boolean]\n  --debug    Enable debug output.                     [boolean] [default: false]\n  --update   Download source updates and apply WordPress configuration.\n                                                      [boolean] [default: false]\n  --xdebug   Enables Xdebug. If not passed, Xdebug is turned off. If no modes\n             are set, uses \"debug\". You may set multiple Xdebug modes by passing\n             them in a comma-separated list: `--xdebug=develop,coverage`. See\n             https://xdebug.org/docs/all_settings#mode for information about\n             Xdebug modes.                                              [string]\n```\n\n### `wp-env stop`\n\n```sh\nwp-env stop\n\nStops running WordPress for development and tests and frees the ports.\n```\n\n### `wp-env clean [environment]`\n\n```sh\nwp-env clean [environment]\n\nCleans the WordPress databases.\n\nPositionals:\n  environment  Which environments' databases to clean.\n            [string] [choices: \"all\", \"development\", \"tests\"] [default: \"tests\"]\n```\n\n### `wp-env run [container] [command]`\n\n```sh\nwp-env run <container> [command..]\n\nRuns an arbitrary command in one of the underlying Docker containers. The\n\"container\" param should reference one of the underlying Docker services like\n\"development\", \"tests\", or \"cli\". To run a wp-cli command, use the \"cli\" or\n\"tests-cli\" service. You can also use this command to open shell sessions like\nbash and the WordPress shell in the WordPress instance. For example, `wp-env run\ncli bash` will open bash in the development WordPress instance. When using long\ncommands with arguments and quotation marks, you need to wrap the \"command\"\nparam in quotation marks. For example: `wp-env run tests-cli \"wp post create\n--post_type=page --post_title='Test'\"` will create a post on the tests WordPress\ninstance.\n\nPositionals:\n  container  The container to run the command on.            [string] [required]\n  command    The command to run.                           [array] [default: []]\n\nOptions:\n  --help     Show help                                                 [boolean]\n  --version  Show version number                                       [boolean]\n  --debug    Enable debug output.                     [boolean] [default: false]\n```\n\nFor example:\n\n#### Displaying the users on the development instance:\n\n```sh\nwp-env run cli wp user list\n⠏ Running `wp user list` in 'cli'.\n\nID      user_login      display_name    user_email      user_registered roles\n1       admin   admin   wordpress@example.com   2020-03-05 10:45:14     administrator\n\n✔ Ran `wp user list` in 'cli'. (in 2s 374ms)\n```\n\n#### Creating a post on the tests instance:\n\n```sh\nwp-env run tests-cli \"wp post create --post_type=page --post_title='Ready'\"\n\nℹ Starting 'wp post create --post_type=page --post_title='Ready'' on the tests-cli container.\n\nSuccess: Created post 5.\n✔ Ran `wp post create --post_type=page --post_title='Ready'` in 'tests-cli'. (in 3s 293ms)\n```\n\n#### Opening the WordPress shell on the tests instance and running PHP commands:\n\n```sh\nwp-env run tests-cli wp shell\nℹ Starting 'wp shell' on the tests-cli container. Exit the WordPress shell with ctrl-c.\n\nStarting 31911d623e75f345e9ed328b9f48cff6_mysql_1 ... done\nStarting 31911d623e75f345e9ed328b9f48cff6_tests-wordpress_1 ... done\nwp> echo( 'hello world!' );\nhello world!\nwp> ^C\n✔ Ran `wp shell` in 'tests-cli'. (in 16s 400ms)\n```\n\n#### Installing a plugin or theme on the development instance\n\n```sh\nwp-env run cli plugin install custom-post-type-ui\n\nCreating 500cd328b649d63e882d5c4695871d04_cli_run ... done\nInstalling Custom Post Type UI (1.9.2)\nDownloading installation package from https://downloads.wordpress.org/plugin/custom-post-type-ui.zip...\nThe authenticity of custom-post-type-ui.zip could not be verified as no signature was found.\nUnpacking the package...\nInstalling the plugin...\nPlugin installed successfully.\nSuccess: Installed 1 of 1 plugins.\n✔ Ran `plugin install custom-post-type-ui` in 'cli'. (in 6s 483ms)\n```\n\n**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:\n\n```sh\n$ cd ~/wp-env/500cd328b649d63e882d5c4695871d04\n$ docker-compose run --rm -u $(id -u) -e HOME=/tmp cli [plugin|theme] install <plugin|theme>\n```\n\n### `wp-env destroy`\n\n```sh\nwp-env destroy\n\nDestroy the WordPress environment. Deletes docker containers, volumes, and\nnetworks associated with the WordPress environment and removes local files.\n```\n\n### `wp-env logs [environment]`\n\n```sh\nwp-env logs\n\ndisplays PHP and Docker logs for given WordPress environment.\n\nPositionals:\n  environment  Which environment to display the logs from.\n      [string] [choices: \"development\", \"tests\", \"all\"] [default: \"development\"]\n\nOptions:\n  --help     Show help                                                 [boolean]\n  --version  Show version number                                       [boolean]\n  --debug    Enable debug output.                     [boolean] [default: false]\n  --watch    Watch for logs as they happen.            [boolean] [default: true]\n```\n\n### `wp-env install-path`\n\nOutputs the absolute path to the WordPress environment files.\n\nExample:\n\n```sh\n$ wp-env install-path\n\n/home/user/.wp-env/63263e6506becb7b8613b02d42280a49\n```\n\n## .wp-env.json\n\nYou can customize the WordPress installation, plugins and themes that the development environment will use by specifying a `.wp-env.json` file in the directory that you run `wp-env` from.\n\n`.wp-env.json` supports six fields for options applicable to both the tests and development instances.\n\n| Field          | Type           | Default                                | Description                                                                                                                      |\n| -------------- | -------------- | -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| `\"core\"`       | `string\\|null` | `null`                                 | The WordPress installation to use. If `null` is specified, `wp-env` will use the latest production release of WordPress.         |\n| `\"phpVersion\"` | `string\\|null` | `null`                                 | The PHP version to use. If `null` is specified, `wp-env` will use the default version used with production release of WordPress. |\n| `\"plugins\"`    | `string[]`     | `[]`                                   | A list of plugins to install and activate in the environment.                                                                    |\n| `\"themes\"`     | `string[]`     | `[]`                                   | A list of themes to install in the environment.                                                                                  |\n| `\"port\"`       | `integer`      | `8888` (`8889` for the tests instance) | The primary port number to use for the installation. You'll access the instance through the port: 'http://localhost:8888'.       |\n| `\"config\"`     | `Object`       | See below.                             | Mapping of wp-config.php constants to their desired values.                                                                      |\n| `\"mappings\"`   | `Object`       | `\"{}\"`                                 | Mapping of WordPress directories to local directories to be mounted in the WordPress instance.                                   |\n\n_Note: the port number environment variables (`WP_ENV_PORT` and `WP_ENV_TESTS_PORT`) take precedent over the .wp-env.json values._\n\nSeveral types of strings can be passed into the `core`, `plugins`, `themes`, and `mappings` fields.\n\n| Type              | Format                        | Example(s)                                               |\n| ----------------- | ----------------------------- | -------------------------------------------------------- |\n| Relative path     | `.<path>\\|~<path>`            | `\"./a/directory\"`, `\"../a/directory\"`, `\"~/a/directory\"` |\n| Absolute path     | `/<path>\\|<letter>:\\<path>`   | `\"/a/directory\"`, `\"C:\\\\a\\\\directory\"`                   |\n| GitHub repository | `<owner>/<repo>[#<ref>]`      | `\"WordPress/WordPress\"`, `\"WordPress/gutenberg#trunk\"`   |\n| ZIP File          | `http[s]://<host>/<path>.zip` | `\"https://wordpress.org/wordpress-5.4-beta2.zip\"`        |\n\nRemote sources will be downloaded into a temporary directory located in `~/.wp-env`.\n\nAdditionally, the key `env` is available to override any of the above options on an individual-environment basis. For example, take the following `.wp-env.json` file:\n\n```json\n{\n\t\"plugins\": [ \".\" ],\n\t\"config\": {\n\t\t\"KEY_1\": true,\n\t\t\"KEY_2\": false\n\t},\n\t\"env\": {\n\t\t\"development\": {\n\t\t\t\"themes\": [ \"./one-theme\" ]\n\t\t},\n\t\t\"tests\": {\n\t\t\t\"config\": {\n\t\t\t\t\"KEY_1\": false\n\t\t\t},\n\t\t\t\"port\": 3000\n\t\t}\n\t}\n}\n```\n\nOn the development instance, `cwd` will be mapped as a plugin, `one-theme` will be mapped as a theme, KEY_1 will be set to true, and KEY_2 will be set to false. Also note that the default port, 8888, will be used as well.\n\nOn the tests instance, `cwd` is still mapped as a plugin, but no theme is mapped. Additionally, while KEY_2 is still set to false, KEY_1 is overridden and set to false. 3000 overrides the default port as well.\n\nThis gives you a lot of power to change the options applicable to each environment.\n\n## .wp-env.override.json\n\nAny fields here will take precedence over .wp-env.json. This file is useful when ignored from version control, to persist local development overrides. Note that options like `plugins` and `themes` are not merged. As a result, if you set `plugins` in your override file, this will override all of the plugins listed in the base-level config. The only keys which are merged are `config` and `mappings`. This means that you can set your own wp-config values without losing any of the default values.\n\n## Default wp-config values.\n\nOn the development instance, these wp-config values are defined by default:\n\n```\nWP_DEBUG: true,\nSCRIPT_DEBUG: true,\nWP_PHP_BINARY: 'php',\nWP_TESTS_EMAIL: 'admin@example.org',\nWP_TESTS_TITLE: 'Test Blog',\nWP_TESTS_DOMAIN: 'http://localhost',\nWP_SITEURL: 'http://localhost',\nWP_HOME: 'http://localhost',\n```\n\nOn the test instance, all of the above are still defined, but `WP_DEBUG` and `SCRIPT_DEBUG` are set to false.\n\nAdditionally, the values referencing a URL include the specified port for the given environment. So if you set `testsPort: 3000, port: 2000`, `WP_HOME` (for example) will be `http://localhost:3000` on the tests instance and `http://localhost:2000` on the development instance.\n\n### Examples\n\n#### Latest production WordPress + current directory as a plugin\n\nThis is useful for plugin development.\n\n```json\n{\n\t\"core\": null,\n\t\"plugins\": [ \".\" ]\n}\n```\n\n#### Latest development WordPress + current directory as a plugin\n\nThis is useful for plugin development when upstream Core changes need to be tested.\n\n```json\n{\n\t\"core\": \"WordPress/WordPress#master\",\n\t\"plugins\": [ \".\" ]\n}\n```\n\n#### Local `wordpress-develop` + current directory as a plugin\n\nThis is useful for working on plugins and WordPress Core at the same time.\n\nIf you are running a _build_ of `wordpress-develop`, point `core` to the `build` directory.\n\n```json\n{\n\t\"core\": \"../wordpress-develop/build\",\n\t\"plugins\": [ \".\" ]\n}\n```\n\nIf you are running `wordpress-develop` in a dev mode (e.g. the watch command `dev` or the dev build `build:dev`), then point `core` to the `src` directory.\n\n```json\n{\n\t\"core\": \"../wordpress-develop/src\",\n\t\"plugins\": [ \".\" ]\n}\n```\n\n#### A complete testing environment\n\nThis is useful for integration testing: that is, testing how old versions of WordPress and different combinations of plugins and themes impact each other.\n\n```json\n{\n\t\"core\": \"WordPress/WordPress#5.2.0\",\n\t\"plugins\": [ \"WordPress/wp-lazy-loading\", \"WordPress/classic-editor\" ],\n\t\"themes\": [ \"WordPress/theme-experiments\" ]\n}\n```\n\n#### Add mu-plugins and other mapped directories\n\nYou can add mu-plugins via the mapping config. The mapping config also allows you to mount a directory to any location in the wordpress install, so you could even mount a subdirectory. Note here that theme-1, will not be activated.\n\n```json\n{\n\t\"plugins\": [ \".\" ],\n\t\"mappings\": {\n\t\t\"wp-content/mu-plugins\": \"./path/to/local/mu-plugins\",\n\t\t\"wp-content/themes\": \"./path/to/local/themes\",\n\t\t\"wp-content/themes/specific-theme\": \"./path/to/local/theme-1\"\n\t}\n}\n```\n\n#### Avoid activating plugins or themes on the instance\n\nSince all plugins in the `plugins` key are activated by default, you should use the `mappings` key to avoid this behavior. This might be helpful if you have a test plugin that should not be activated all the time.\n\n```json\n{\n\t\"plugins\": [ \".\" ],\n\t\"mappings\": {\n\t\t\"wp-content/plugins/my-test-plugin\": \"./path/to/test/plugin\"\n\t}\n}\n```\n\n#### Map a plugin only in the tests environment\n\nIf you need a plugin active in one environment but not the other, you can use `env.<envName>` to set options specific to one environment. Here, we activate cwd and a test plugin on the tests instance. This plugin is not activated on any other instances.\n\n```json\n{\n\t\"plugins\": [ \".\" ],\n\t\"env\": {\n\t\t\"tests\": {\n\t\t\t\"plugins\": [ \".\", \"path/to/test/plugin\" ]\n\t\t}\n\t}\n}\n```\n\n#### Custom Port Numbers\n\nYou can tell `wp-env` to use a custom port number so that your instance does not conflict with other `wp-env` instances.\n\n```json\n{\n\t\"plugins\": [ \".\" ],\n\t\"port\": 4013,\n\t\"env\": {\n\t\t\"tests\": {\n\t\t\t\"port\": 4012\n\t\t}\n\t}\n}\n```\n\n#### Specific PHP Version\n\nYou can tell `wp-env` to use a specific PHP version for compatibility and testing. This can also be set via the environment variable `WP_ENV_PHP_VERSION`.\n\n```json\n{\n\t\"phpVersion\": \"7.2\",\n\t\"plugins\": [ \".\" ]\n}\n```\n\n## Contributing to this package\n\nThis is an individual package that's part of the Gutenberg project. The project is organized as a monorepo. It's made up of multiple self-contained software packages, each with a specific purpose. The packages in this monorepo are published to [npm](https://www.npmjs.com/) and used by [WordPress](https://make.wordpress.org/core/) as well as other software projects.\n\nTo find out more about contributing to this package or Gutenberg as a whole, please read the project's main [contributor guide](https://github.com/WordPress/gutenberg/tree/HEAD/CONTRIBUTING.md).\n\n<br /><br /><p align=\"center\"><img src=\"https://s.w.org/style/images/codeispoetry.png?1\" alt=\"Code is Poetry.\" /></p>\n","readmeFilename":"README.md"}