|
4 | 4 |
|
5 | 5 | # Table of contents |
6 | 6 |
|
7 | | -- [Requirements](#requirements) |
8 | | -- [Quickstart](#quickstart) |
9 | | -- [Usage](#usage) |
10 | | -- [Working with Blueprints](#working-with-blueprints) |
11 | | -- [Contributing](#contributing) |
| 7 | +- [Requirements](#requirements) |
| 8 | +- [Quickstart](#quickstart) |
| 9 | +- [Usage](#usage) |
| 10 | +- [Working with Blueprints](#working-with-blueprints) |
| 11 | +- [Contributing](#contributing) |
12 | 12 |
|
13 | 13 | ## Requirements |
14 | 14 |
|
@@ -64,41 +64,41 @@ npx @wp-playground/cli@latest server --mount-before-install=./my-local-site:/wor |
64 | 64 |
|
65 | 65 | The `--auto-mount` flag is the easiest way to get started. It inspects the current directory and automatically mounts it to the correct location in the virtual WordPress site. These are the supported directory types and how they are detected: |
66 | 66 |
|
67 | | -- **Plugin Mode**: Presence of a PHP file with `Plugin Name:` in its header. |
68 | | -- **Theme Mode**: Presence of a style.css file with `Theme Name:` in its header. |
69 | | -- **wp-content Mode**: Presence of plugins and themes subdirectories. |
70 | | -- **WordPress Mode**: Presence of a complete WordPress installation. The directory will be mounted to the root `/wordpress` folder. |
| 67 | +- **Plugin Mode**: Presence of a PHP file with `Plugin Name:` in its header. |
| 68 | +- **Theme Mode**: Presence of a style.css file with `Theme Name:` in its header. |
| 69 | +- **wp-content Mode**: Presence of plugins and themes subdirectories. |
| 70 | +- **WordPress Mode**: Presence of a complete WordPress installation. The directory will be mounted to the root `/wordpress` folder. |
71 | 71 |
|
72 | 72 | ## Command and Arguments |
73 | 73 |
|
74 | 74 | Playground CLI is simple, configurable, and unopinionated. You can set it up according |
75 | 75 | to your unique WordPress setup. With the Playground CLI, you can use the following top-level commands: |
76 | 76 |
|
77 | | -- **`server`**: (Default) Starts a local WordPress server. |
78 | | -- **`run-blueprint`**: Executes a Blueprint file without starting a web server. |
79 | | -- **`build-snapshot`**: Builds a ZIP snapshot of a WordPress site based on a Blueprint. |
| 77 | +- **`server`**: (Default) Starts a local WordPress server. |
| 78 | +- **`run-blueprint`**: Executes a Blueprint file without starting a web server. |
| 79 | +- **`build-snapshot`**: Builds a ZIP snapshot of a WordPress site based on a Blueprint. |
80 | 80 |
|
81 | 81 | The `server` command supports the following optional arguments: |
82 | 82 |
|
83 | | -- `--port=<port>`: The port number for the server to listen on. Defaults to 9400. |
84 | | -- `--outfile`: When building, write to this output file. |
85 | | -- `--wp=<version>`: The version of WordPress to use. Defaults to the latest. |
86 | | -- `--auto-mount`: Automatically mount the current directory (plugin, theme, wp-content, etc.). |
87 | | -- `--mount=<mapping>`: Manually mount a directory (can be used multiple times). Format: /host/path:/vfs/path |
88 | | -- `--mount-before-install`: Mount a directory to the PHP runtime before WordPress installation (can be used multiple times). Format: `"/host/path:/vfs/path"`. |
89 | | -- `--mount-dir`: Mount a directory to the PHP runtime (can be used multiple times). Format: `"/host/path"` `"/vfs/path"`. |
90 | | -- `--mount-dir-before-install`: Mount a directory before WordPress installation (can be used multiple times). Format: `"/host/path"` `"/vfs/path"` |
91 | | -- `--blueprint=<path>`: The path to a JSON Blueprint file to execute. |
92 | | -- `--blueprint-may-read-adjacent-files`: Consent flag: Allow "bundled" resources in a local blueprint to read files in the same directory as the blueprint file. |
93 | | -- `--login`: Automatically log the user in as an administrator. |
94 | | -- `--wordpress-install-mode <mode>`: Control how Playground prepares WordPress before booting. Defaults to `download-and-install`. Other options: `install-from-existing-files` (install using files you've mounted), `install-from-existing-files-if-needed` (same, but skip setup when an existing site is detected), and `do-not-attempt-installing` (never download or install WordPress). |
95 | | -- `--skip-sqlite-setup`: Do not set up the SQLite database integration. |
96 | | -- `--verbosity`: Output logs and progress messages (choices: "quiet", "normal", "debug"). Defaults to "normal". |
97 | | - |
98 | | -- `--debug`: Print the PHP error log if an error occurs during boot. |
99 | | -- `--follow-symlinks`: Allow Playground to follow symlinks by automatically mounting symlinked directories and files encountered in mounted directories. ⚠️ Warning: Following symlinks will expose files outside mounted directories to Playground and could be a security risk. |
100 | | -- `--experimental-multi-worker`: Enables experimental multi-worker support. It needs JSPI and a /wordpress directory on a real filesystem. You can pass a positive number to use a specific number of workers, otherwise, it defaults to the number of CPUs minus one. |
101 | | -- `--internal-cookie-store`: Enables Playground's internal cookie handling. When active, Playground uses an HttpCookieStore to manage and persist cookies across requests. If disabled, cookies are handled externally, like by a browser in Node.js. |
| 83 | +- `--port=<port>`: The port number for the server to listen on. Defaults to 9400. |
| 84 | +- `--outfile`: When building, write to this output file. |
| 85 | +- `--wp=<version>`: The version of WordPress to use. Defaults to the latest. |
| 86 | +- `--auto-mount`: Automatically mount the current directory (plugin, theme, wp-content, etc.). |
| 87 | +- `--mount=<mapping>`: Manually mount a directory (can be used multiple times). Format: /host/path:/vfs/path |
| 88 | +- `--mount-before-install`: Mount a directory to the PHP runtime before WordPress installation (can be used multiple times). Format: `"/host/path:/vfs/path"`. |
| 89 | +- `--mount-dir`: Mount a directory to the PHP runtime (can be used multiple times). Format: `"/host/path"` `"/vfs/path"`. |
| 90 | +- `--mount-dir-before-install`: Mount a directory before WordPress installation (can be used multiple times). Format: `"/host/path"` `"/vfs/path"` |
| 91 | +- `--blueprint=<path>`: The path to a JSON Blueprint file to execute. |
| 92 | +- `--blueprint-may-read-adjacent-files`: Consent flag: Allow "bundled" resources in a local blueprint to read files in the same directory as the blueprint file. |
| 93 | +- `--login`: Automatically log the user in as an administrator. |
| 94 | +- `--wordpress-install-mode <mode>`: Control how Playground prepares WordPress before booting. Defaults to `download-and-install`. Other options: `install-from-existing-files` (install using files you've mounted), `install-from-existing-files-if-needed` (same, but skip setup when an existing site is detected), and `do-not-attempt-installing` (never download or install WordPress). |
| 95 | +- `--skip-sqlite-setup`: Do not set up the SQLite database integration. |
| 96 | +- `--verbosity`: Output logs and progress messages (choices: "quiet", "normal", "debug"). Defaults to "normal". |
| 97 | + |
| 98 | +- `--debug`: Print the PHP error log if an error occurs during boot. |
| 99 | +- `--follow-symlinks`: Allow Playground to follow symlinks by automatically mounting symlinked directories and files encountered in mounted directories. ⚠️ Warning: Following symlinks will expose files outside mounted directories to Playground and could be a security risk. |
| 100 | +- `--experimental-multi-worker`: Enables experimental multi-worker support. It needs JSPI and a /wordpress directory on a real filesystem. You can pass a positive number to use a specific number of workers, otherwise, it defaults to the number of CPUs minus one. |
| 101 | +- `--internal-cookie-store`: Enables Playground's internal cookie handling. When active, Playground uses an HttpCookieStore to manage and persist cookies across requests. If disabled, cookies are handled externally, like by a browser in Node.js. |
102 | 102 |
|
103 | 103 | ## Need some help with the CLI? |
104 | 104 |
|
@@ -165,15 +165,15 @@ cliServer = await runCLI({ |
165 | 165 |
|
166 | 166 | ### Things the Playground does compared to Laravel Valet |
167 | 167 |
|
168 | | -- Handles the entire WordPress installation for you. |
169 | | -- Works across all desktop platforms (Mac, Linux, Windows). |
170 | | -- Does not set up custom host domains for you. |
| 168 | +- Handles the entire WordPress installation for you. |
| 169 | +- Works across all desktop platforms (Mac, Linux, Windows). |
| 170 | +- Does not set up custom host domains for you. |
171 | 171 |
|
172 | 172 | ### Things the Playground does compared to `wp-env` |
173 | 173 |
|
174 | | -- Does not require Docker. |
175 | | -- Is faster to start up for quick tests and development. |
176 | | -- The Playground doesn't come with a MySQL Server, but you can provide your own MySQL credentials. |
| 174 | +- Does not require Docker. |
| 175 | +- Is faster to start up for quick tests and development. |
| 176 | +- The Playground doesn't come with a MySQL Server, but you can provide your own MySQL credentials. |
177 | 177 |
|
178 | 178 | ## Contributing |
179 | 179 |
|
@@ -216,10 +216,10 @@ WordPress Playground CLI is an open-source project and welcomes all contributors |
216 | 216 |
|
217 | 217 | Here are a few quick-start guides to get you started: |
218 | 218 |
|
219 | | -- Code contributions – see the [developer section](https://wordpress.github.io/wordpress-playground/docs/contributing/code). |
220 | | -- Documentation – see the [documentation section](https://wordpress.github.io/wordpress-playground/docs/contributing/documentation). |
221 | | -- Triage – see the [triage section](https://wordpress.github.io/wordpress-playground/contributing/#triaging-issues). |
222 | | -- Contributions to translations – see the [translations section](https://wordpress.github.io/wordpress-playground/contributing/translations). |
223 | | -- Reporting bugs – open an [issue](https://github.com/WordPress/wordpress-playground/issues/new) in the repository. |
224 | | -- Ideas, designs, or anything else – open a [GitHub discussion](https://github.com/WordPress/wordpress-playground/discussions) and let's talk! |
225 | | -- Join our Slack channel [#playground](https://wordpress.slack.com/archives/C04EWKGDJ0K) at Make WordPress |
| 219 | +- Code contributions – see the [developer section](https://wordpress.github.io/wordpress-playground/docs/contributing/code). |
| 220 | +- Documentation – see the [documentation section](https://wordpress.github.io/wordpress-playground/docs/contributing/documentation). |
| 221 | +- Triage – see the [triage section](https://wordpress.github.io/wordpress-playground/contributing/#triaging-issues). |
| 222 | +- Contributions to translations – see the [translations section](https://wordpress.github.io/wordpress-playground/contributing/translations). |
| 223 | +- Reporting bugs – open an [issue](https://github.com/WordPress/wordpress-playground/issues/new) in the repository. |
| 224 | +- Ideas, designs, or anything else – open a [GitHub discussion](https://github.com/WordPress/wordpress-playground/discussions) and let's talk! |
| 225 | +- Join our Slack channel [#playground](https://wordpress.slack.com/archives/C04EWKGDJ0K) at Make WordPress |
0 commit comments