Playground CLI
@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.
Key features:
- Quick Setup: Set up a local WordPress environment in seconds.
- Flexibility: Allows for configuration to adapt to different scenarios.
- Simple Environment: No extra configuration, just a compatible Node version, and you are ready to use it.
The Playground CLI includes two main commands for running WordPress locally:
start(Simplified): Auto-detects your project type, persists sites between sessions, and opens a browser automatically.server(Advanced): Provides full manual control over configuration. Best for custom setups, CI/CD pipelines, or when you need fine-grained control.
Requirements
The Playground CLI requires Node.js 20.18 or higher, which is the recommended Long-Term Support (LTS) version. You can download it from the Node.js website.
Quickstart
To run the Playground CLI, open a command line and use one of the following commands:
Using start (Simplified)
The start command is the easiest way to get started. It automatically detects your project type, persists your site, and opens the browser:
npx @wp-playground/cli@latest start
When run inside a plugin or theme directory, start automatically mounts your project:
cd my-plugin
npx @wp-playground/cli@latest start
Key differences from server:
- Auto-login is enabled by default
- Opens browser automatically
- Auto-mounts the project by default
Using server (Advanced)
The server command provides full control over configuration:
npx @wp-playground/cli@latest server

Automatic site persistence: By default, the start command keeps your WordPress site persistent across sessions. Your files and database are stored in ~/.wordpress-playground/sites/<path-hash>/, where <path-hash> is derived from your project directory. This means you can stop and restart the CLI without losing your work.
This is useful when:
- You want a clean WordPress installation
- Testing fresh installation scenarios
- Your site data became corrupted or inconsistent
The --reset flag works only with start. For server, manually delete the persisted site directory at ~/.wordpress-playground/sites/<path-hash>/.
Choosing a WordPress and PHP Version
By default, the CLI loads the latest stable version of WordPress and PHP 8.3 due to its improved performance. To specify your preferred versions, you can use the flag --wp=<version> and --php=<version>:
npx @wp-playground/cli@latest server --wp=6.8 --php=8.3
Loading Blueprints
One way to take your Playground CLI development experience to the next level is to integrate with Blueprints. For those unfamiliar with this technology, it allows developers to configure the initial state for their WordPress Playground instances.
Using the --blueprint=<blueprint-address> flag, developers can run a Playground with a custom initial state. We’ll use the example below to do this.
(my-blueprint.json)
{
"landingPage": "/wp-admin/options-general.php?page=akismet-key-config",
"login": true,
"plugins": [
"hello-dolly",
"https://raw.githubusercontent.com/adamziel/blueprints/trunk/docs/assets/hello-from-the-dashboard.zip"
]
}
CLI command loading a blueprint:
npx @wp-playground/cli@latest server --blueprint=my-blueprint.json
Mounting folders manually
Some projects have a specific structure that requires a custom configuration; for example, your repository contains all the files in the /wp-content/ folder. So in this scenario, you can specify to the Playground CLI that it will mount your project from that folder using the --mount flag.
npx @wp-playground/cli@latest server --mount=.:/wordpress/wp-content/plugins/MY-PLUGIN-DIRECTORY
Mounting before WordPress installation
Consider mounting your WordPress project files before the WordPress installation begins. This approach is beneficial if you want to override the Playground boot process, as it can help connect Playground with WP-CLI. The --mount-before-install flag supports this process.
npx @wp-playground/cli@latest server --mount-before-install=.:/wordpress/
On Windows, the path format /host/path:/vfs/path can cause issues. To resolve this, use the flags --mount-dir and --mount-dir-before-install. These flags let you specify host and virtual file system paths in an alternative format: "/host/path" "/vfs/path".