| name | studio-cli |
| description | This skill should be used when the user asks to "create a WordPress site", "start a local WordPress site", "develop a WordPress plugin", "develop a WordPress theme", "share a preview site", "preview my site", "send a site to a client", "publish to WordPress.com", "run WP-CLI", "configure WordPress site", "set up custom domain", "enable HTTPS", "change PHP version", "create site with blueprint", "manage local WordPress sites", "list my sites", "stop a site", "delete a site", "debug WordPress with Xdebug", "set up WooCommerce locally", "export or import WordPress content", "run a database query", or mentions Studio CLI, local WordPress development, or WordPress Playground. Covers site lifecycle, preview sharing, WP-CLI integration, blueprints, and debugging.
|
| version | 1.0.0 |
WordPress Development with Studio CLI
Studio CLI is a command-line tool for creating and managing local WordPress sites powered by WordPress Playground (PHP WASM). It enables full WordPress development without external dependencies — no Apache, MySQL, or Docker needed.
Prerequisites
Build the CLI before first use (from the Studio repository root):
npm run cli:build
Run commands with:
studio <command>
node dist/cli/main.js <command>
All site commands default to the current working directory via --path. Navigate to a site directory or pass --path /path/to/site explicitly.
Core Concepts
- Local Sites: WordPress instances running via PHP WASM with SQLite — no MySQL needed
- Preview Sites: Temporary sites hosted on WordPress.com for sharing with clients (30-day expiration)
- Blueprints: JSON configuration files for automated site setup (plugins, themes, settings)
- Custom Domains: Local
.local domains with optional HTTPS via self-signed certificates
- WP-CLI: Full WordPress CLI integration for managing content, plugins, themes, and database
Quick Command Reference
| Task | Command |
|---|
| Create site | studio site create --name "My Site" |
| Start site | studio site start |
| Stop site | studio site stop |
| List sites | studio site list |
| Site info | studio site status |
| Delete site | studio site delete [--files] |
| Configure | studio site set --php 8.3 --wp 6.5 |
| Run WP-CLI | studio wp plugin list |
| Login | studio auth login |
| Create preview | studio preview create |
| Update preview | studio preview update <host> |
| List previews | studio preview list |
| Delete preview | studio preview delete <host> |
Plugin & Theme Development
The general pattern for WordPress plugin or theme development:
- Create a dedicated site:
studio site create --name "Dev" --php 8.2 --wp latest
- Write code in
wp-content/plugins/<name>/ or wp-content/themes/<name>/
- Activate via WP-CLI:
studio wp plugin activate <name> or studio wp theme activate <name>
- Test across PHP versions:
studio site set --php 8.3
- Optionally add a custom domain:
studio site set --domain myproject.local --https
For complete scaffolding examples (plugin file headers, block theme templates, cross-version testing matrices, and WooCommerce setup), see references/workflows.md.
Sharing Preview Sites with Clients
To create a shareable preview of a local site:
studio auth login
studio preview create
studio preview update site-abc123.wordpress.com
studio preview list
studio preview delete site-abc123.wordpress.com
Preview sites include wp-content/ and wp-config.php. They exclude .git/ and node_modules/. Preview sites expire after 30 days.
Site Configuration
Adjust site settings without recreation:
studio site set --php 8.3
studio site set --wp 6.5
studio site set --domain myproject.local --https
studio site set --name "New Name"
studio site set --xdebug
The site automatically restarts when configuration changes require it.
Using Blueprints
Blueprints automate site setup with pre-configured plugins, themes, and settings:
studio site create --name "Blueprint Site" --blueprint ./blueprint.json
studio site create --name "WooCommerce Dev" --blueprint https://example.com/woo-blueprint.json
Blueprint JSON follows the WordPress Playground Blueprint format. Studio automatically filters unsupported features for compatibility.
WP-CLI Integration
Run any WP-CLI command against local sites:
studio wp post list
studio wp post create --post_title="Hello" --post_status=publish
studio wp plugin install woocommerce --activate
studio wp plugin list
studio wp plugin deactivate akismet
studio wp theme install flavor --activate
studio wp theme list
studio wp db query "SELECT * FROM wp_options LIMIT 5"
studio wp search-replace 'old-domain.com' 'new-domain.com'
studio wp user list
studio wp user create editor editor@example.com --role=editor
studio wp core version
studio wp core update-db
studio wp --studio-no-path cli info
When a site is running, WP-CLI commands execute against the live server. When stopped, a temporary PHP WASM instance handles the command.
Multi-Site Development
Manage multiple sites simultaneously:
studio site create --path ~/sites/staging --name "Staging" --wp latest
studio site create --path ~/sites/dev --name "Development" --wp 6.4
studio wp plugin list --path ~/sites/staging
studio wp plugin list --path ~/sites/dev
studio site stop --all
studio site list
Troubleshooting
- Site won't start: Check
studio site status for port conflicts. Delete and recreate if necessary.
- Preview upload fails: Verify authentication with
studio auth status. Re-login if token expired (2-week validity).
- Custom domain not resolving: The CLI modifies
/etc/hosts which requires elevated privileges. Check the hosts file entry.
- WP-CLI command not found: Ensure the site path is correct. Use
--path flag or navigate to the site directory.
Additional Resources
Reference Files
references/cli-commands.md — Load when specific command flags, option types, or output format details are needed beyond the quick reference table above. Contains full argument tables for every command.
references/workflows.md — Load when building a plugin, theme, WooCommerce store, or client preview workflow from scratch. Contains full code scaffolds, blueprint JSON examples, database operations, content migration steps, and multi-environment patterns.