Skip to content

Conversation

@fellyph
Copy link
Collaborator

@fellyph fellyph commented Oct 23, 2025

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.

- `--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.
- `--mount=<mapping>`: Manually mount a directory (can be used multiple times). Format: `"/host/path:/vfs/path"`.
- `--mount-before-install`: Mount a directory to the PHP runtime before WordPress installation (can be used multiple times). Format: `"/host/path:/vfs/path"`.
- `--mount-dir`: Mount a directory to the PHP runtime (can be used multiple times). Format: `"/host/path"` `"/vfs/path"`.
Copy link
Member

@brandonpayton brandonpayton Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also --mount-dir-before-install which corresponds with --mount-dir. These flags were created as alternatives to the --mount and --mount-before-install flags to avoid problems with the : character when mounting paths in Windows.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might even be worth deprecating --mount and --mount-before-install so we can have a single pair of flags that works for all supported platforms. What do you think, @WordPress/playground-maintainers?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brandonpayton What about?

-   `--mount-dir`: Mount a directory to the PHP runtime (can be used multiple times). Format: `"/host/path"` `"/vfs/path"`. **Recommended for cross-platform compatibility** as it avoids issues with the `:` character in Windows paths.
-   `--mount-dir-before-install`: Mount a directory before WordPress installation (can be used multiple times). Format: `"/host/path"` `"/vfs/path"`. **Recommended for cross-platform compatibility** as it avoids issues with the `:` character in Windows paths.
-   `--mount=<mapping>`: Manually mount a directory (can be used multiple times). Format: `"/host/path:/vfs/path"`. _Note: May have issues with Windows paths containing `:`. Consider using `--mount-dir` instead._
-   `--mount-before-install`: Mount a directory to the PHP runtime before WordPress installation (can be used multiple times). Format: `"/host/path:/vfs/path"`. _Note: May have issues with Windows paths containing `:`. Consider using `--mount-dir-before-install` instead._

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, this was another case where the option was just in the collapsed section of code outside the scope of the PR. I visually scanned for such sections before commenting but somehow missed it.

Copy link
Member

@brandonpayton brandonpayton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this update, @fellyph!

I think we can also add documentation for --blueprint and --blueprint-may-read-adjacent-files flags.

@brandonpayton
Copy link
Member

Also, check out this PR which will make the --skip-wordpress-install option hidden and replace it with --wordpress-install-mode.

@fellyph
Copy link
Collaborator Author

fellyph commented Oct 23, 2025

@brandonpayton --blueprint and --blueprint-may-read-adjacent-files flags are there, I think the diff is hiding

@fellyph
Copy link
Collaborator Author

fellyph commented Oct 23, 2025

--wordpress-install-mode is cool, I didn't included becuase wasn't merged yet

@brandonpayton
Copy link
Member

@brandonpayton --blueprint and --blueprint-may-read-adjacent-files flags are there, I think the diff is hiding

Ah, I even tried to look for that. It seemed unlikely those would have been left out.

Copy link
Member

@brandonpayton brandonpayton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the most recent updates (and clarifying that I'd missed some existing documentation), this looks good to me.

@mho22
Copy link
Collaborator

mho22 commented Oct 24, 2025

--wordpress-install-mode is cool, I didn't included becuase wasn't merged yet

Just to inform you that we are also adding the --experimental-unsafe-ide-integration option too in this PR.

@fellyph fellyph merged commit 83b8460 into trunk Oct 27, 2025
28 checks passed
@fellyph fellyph deleted the updating-help-cli-message branch October 27, 2025 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants