Skip to content

Conversation

@fellyph
Copy link
Collaborator

@fellyph fellyph commented Oct 28, 2025

Motivation for the change, related issues

Updating the runCLI demos to show other ways of working with the method, applying for tests. Including more examples of the new flags. The change also included a description to improve the page SEO and apply some recommendations of the WordPress Docs handbook.

New demos:

  • Setting a custom site URL
  • Multiple mounts
  • Symlink support for monorepos
  • Testing plugins with specific PHP versions
  • Mode selection (Blueprint v2)
  • Skip WordPress and SQLite setup
  • Error handling
  • Following symlinks programmatically

Portuguese and Spanish versions are also included.

@fellyph fellyph requested a review from adamziel October 28, 2025 11:14
@fellyph fellyph added [Type] Documentation Improvements or additions to documentation [Aspect] Internationalization (i18n) labels Oct 28, 2025

[@wp-playground/cli](https://www.npmjs.com/package/@wp-playground/cli) is a command-line tool that simplifies the WordPress development and testing flow.
Playground CLI supports auto-mounting a directory with a plugin, theme, or WordPress installation. But if you need flexibility, the CLI supports mounting commands to personalize your local environment.
[@wp-playground/cli](https://www.npmjs.com/package/@wp-playground/cli) is a command-line tool that simplifies the WordPress development and testing flow. You can use Playground CLI to auto-mount a directory with a plugin, theme, or WordPress installation. If you need flexibility, you can use mounting commands to personalize your local environment.
Copy link
Collaborator

Choose a reason for hiding this comment

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

At this point, people are probably unfamiliar with the concept of mounting/automounting in the CLI. I'd explain it first or use a different language here, e.g. "You can use Playground CLI to test a local plugin, theme, or a full WordPress installation". I know it's a carryover from the previous version but it caught my eye

npx @wp-playground/cli@latest server --mount=.:/wordpress/wp-content/plugins/MY-PLUGIN-DIRECTORY
```

**Multiple mounts:**
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice addition! In the future, let's find a good name for the two-parameter mount flag and swap all those examples for that – the : symbol is problematic on windows. Nothing to do in this PR, we need to tweak the naming first.

```

To execute the code above, the developer can set their preferred method. A simple way to execute this code is to save it as a `.ts` file and run it with a tool like `tsx`. For example: `tsx my-script.ts`
To execute the code above, you can set your preferred method. A simple way to execute this code is to save it as a `.ts` file and run it with a tool like `tsx`. For example: `tsx my-script.ts`
Copy link
Collaborator

Choose a reason for hiding this comment

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

TIL. How do you use that tool? Let's give folks something actionable to run it, even a link.

});
```

**Complex blueprint with multiple configurations:**
Copy link
Collaborator

Choose a reason for hiding this comment

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

"multiple configurations"? Did you mean steps? The previous Blueprint also has multiple steps, do we need a separate example?


### Mode selection (Blueprint v2)

You can specify different modes when working with Blueprint v2:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's link to something Blueprints v2-related, otherwise it's a bit confusing what this section is about – should I use the v2 runner? How is it better? etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was concern to add this because we don't have content yet about blueprints v2


### Integration testing with Vitest

The programmatic API is excellent for automated testing. Here's a complete example using Vitest:
Copy link
Collaborator

Choose a reason for hiding this comment

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

pretty cool!

mount: [
{
hostPath: './my-theme',
vfsPath: '/wordpress/wp-content/themes/my-theme'
Copy link
Collaborator

Choose a reason for hiding this comment

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

This isn't much different from one of the first examples. Also, I can't just copy&paste this snippet since I don't have ./my-theme directory locally. Could we offer a few examples that can be just copy&pasted?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Cool, I will try something different.

Copy link
Collaborator

@adamziel adamziel left a comment

Choose a reason for hiding this comment

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

Really cool, thank you! I've left a few comments, nothing major.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Aspect] Internationalization (i18n) [Type] Documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants