Skip to content

Commit 83b8460

Browse files
authored
[Docs] Updating CLI flags list (#2812)
## Motivation for the change, related issues This pull request updates the documentation for the `wp-playground-cli` server command, expanding and clarifying the available command-line options. The most important changes include the addition of new flags, improved descriptions for existing options, and important security notes regarding symlink handling. **New and updated CLI options:** * Added a `--php=<version>` option to specify the PHP version, with supported versions listed and a default of `8.3`. * Enhanced the `--auto-mount` option to accept an optional path argument (`--auto-mount[=<path>]`), allowing users to specify which directory to mount or default to the current working directory. The documentation now clarifies what types of directories can be mounted. * Introduced a `--follow-symlinks` flag, enabling Playground to automatically mount symlinked directories and files within mounted directories. * Added a `--quiet` flag to suppress logs and progress messages. **Security and usage notes:** * Added a cautionary note about the security implications of using the `--follow-symlinks` flag, warning that it may expose files outside mounted directories.
1 parent f11a6c0 commit 83b8460

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

packages/docs/site/docs/developers/05-local-development/04-wp-playground-cli.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,12 @@ to your unique WordPress setup. With the Playground CLI, you can use the followi
169169
The `server` command supports the following optional arguments:
170170

171171
- `--port=<port>`: The port number for the server to listen on. Defaults to 9400.
172+
- `--version`: Show version number.
172173
- `--outfile`: When building, write to this output file.
174+
- `--site-url=<url>`: Site URL to use for WordPress. Defaults to `http://127.0.0.1:{port}`.
173175
- `--wp=<version>`: The version of WordPress to use. Defaults to the latest.
174-
- `--auto-mount`: Automatically mount the current directory (plugin, theme, wp-content, etc.).
176+
- `--php=<version>`: PHP version to use. Choices: `8.4`, `8.3`, `8.2`, `8.1`, `8.0`, `7.4`, `7.3`, `7.2`. Defaults to `8.3`.
177+
- `--auto-mount[=<path>]`: Automatically mount a directory. If no path is provided, mounts the current working directory. You can mount a WordPress directory, a plugin directory, a theme directory, a wp-content directory, or any directory containing PHP and HTML files.
175178
- `--mount=<mapping>`: Manually mount a directory (can be used multiple times). Format: `"/host/path:/vfs/path"`.
176179
- `--mount-before-install`: Mount a directory to the PHP runtime before WordPress installation (can be used multiple times). Format: `"/host/path:/vfs/path"`.
177180
- `--mount-dir`: Mount a directory to the PHP runtime (can be used multiple times). Format: `"/host/path"` `"/vfs/path"`.
@@ -181,8 +184,17 @@ The `server` command supports the following optional arguments:
181184
- `--login`: Automatically log the user in as an administrator.
182185
- `--skip-wordpress-setup`: Do not download or install WordPress. Useful if you are mounting a full WordPress directory.
183186
- `--skip-sqlite-setup`: Do not set up the SQLite database integration.
184-
- `--verbosity`: Output logs and progress messages. Choices are "quiet", "normal" or "debug". Defaults to "normal".
187+
- `--verbosity=<level>`: Output logs and progress messages. Choices: `quiet`, `normal`, `debug`. Defaults to `normal`.
185188
- `--debug`: Print the PHP error log if an error occurs during boot.
189+
- `--follow-symlinks`: Allow Playground to follow symlinks by automatically mounting symlinked directories and files encountered in mounted directories.
190+
- `--internal-cookie-store`: Enable internal cookie handling. When enabled, Playground will manage cookies internally using an HttpCookieStore that persists cookies across requests. When disabled, cookies are handled externally (e.g., by a browser in Node.js environments). Defaults to false.
191+
- `--xdebug`: Enable Xdebug. Defaults to false.
192+
- `--experimental-devtools`: Enable experimental browser development tools. Defaults to false.
193+
- `--experimental-multi-worker=<number>`: Enable experimental multi-worker support which requires a `/wordpress` directory backed by a real filesystem. Pass a positive number to specify the number of workers to use. Otherwise, defaults to the number of CPUs minus 1.
194+
195+
:::caution
196+
With the flag `--follow-symlinks`, the following symlinks will expose files outside mounted directories to Playground and could be a security risk.
197+
:::
186198

187199
## Need some help with the CLI?
188200

0 commit comments

Comments
 (0)