Use when the user wants to work with a local WordPress development environment — WordPress Studio, LocalWP, or wp-env. Handles environment detection, site lifecycle, WP-CLI proxy, REST API access, symlink workflows, database operations, and preview/share.
Use this skill when the task involves local WordPress development environments:
Run the detection script to discover installed tools and sites:
node skills/wp-local-env/scripts/detect_local_env.mjs
The script outputs JSON with:
environments[] — each tool found with its sitesrecommended — which tool to prefer for automationwpCli — how to invoke WP-CLI for each toolIf no environment is found, suggest installation:
npm -g install @wordpress/envWordPress Studio:
studio site create --path ~/Studio/my-site
# Optional flags: --php-version=8.2 --domain=mysite.wp.local --https
LocalWP: Site creation is GUI-only. Guide the user through:
wp-env: Create .wp-env.json in the project root:
{
"core": "WordPress/WordPress#6.9",
"plugins": ["./my-plugin"],
"themes": ["./my-theme"]
}
Then: npx wp-env start
| Operation | Studio | LocalWP | wp-env |
|-----------|--------|---------|--------|
| Start | studio site start --path=<path> | GUI only | npx wp-env start |
| Stop | studio site stop --path=<path> | GUI only | npx wp-env stop |
| Delete | studio site delete --path=<path> | GUI only | npx wp-env destroy |
| Status | studio site status --path=<path> | Parse sites.json | npx wp-env run cli wp option get siteurl |
WP-CLI is the primary automation interface for all local tools. Each tool has a different invocation method:
WordPress Studio (no separate WP-CLI install needed):
studio wp <command> --path=<site-path>
# Examples:
studio wp plugin list --path=~/Studio/my-site
studio wp scaffold plugin my-plugin --path=~/Studio/my-site
studio wp db export backup.sql --path=~/Studio/my-site
LocalWP (uses bundled WP-CLI binary):
# Find the binary from detect_local_env.mjs output, then:
<wp-cli-bin> --path=<site-root> <command>
# Typical path on Linux:
~/.config/Local/lightning-services/wp-cli-*/bin/wp --path="~/Local Sites/my-site/app/public" plugin list
wp-env (Docker-wrapped):
npx wp-env run cli wp <command>
# Examples:
npx wp-env run cli wp plugin list
npx wp-env run cli wp scaffold block my-block --plugin=my-plugin
Read: references/studio-adapter.md, references/localwp-adapter.md, references/wpenv-adapter.md
For active plugin/theme development, symlink your project into the local site:
WordPress Studio:
ln -s /path/to/my-plugin ~/Studio/my-site/wp-content/plugins/my-plugin
studio wp plugin activate my-plugin --path=~/Studio/my-site
LocalWP:
ln -s /path/to/my-plugin ~/Local\ Sites/my-site/app/public/wp-content/plugins/my-plugin
<wp-cli-bin> --path="~/Local Sites/my-site/app/public" plugin activate my-plugin
wp-env: Map in .wp-env.json instead of symlinking:
{ "plugins": ["./my-plugin", "/absolute/path/to/other-plugin"] }
All local tools expose the WordPress REST API:
| Tool | URL pattern |
|------|-------------|
| Studio | http://localhost:888x/wp-json/wp/v2/ |
| LocalWP | http://<name>.local/wp-json/wp/v2/ or http://127.0.0.1:<port>/wp-json/wp/v2/ |
| wp-env | http://localhost:8888/wp-json/wp/v2/ |
For authenticated requests, create an Application Password:
studio wp user application-password create admin "claude-code" --path=<site>
# or via the WP-CLI equivalent for LocalWP / wp-env
The existing wp-rest-bridge MCP server can connect to local sites by configuring WP_SITES_CONFIG with the local URL.
Studio (SQLite):
# Export as SQL (MySQL-compatible):
studio wp db export backup.sql --path=<site>
# Direct SQLite access:
sqlite3 ~/Studio/<site>/wp-content/database/.ht.sqlite
LocalWP (MySQL):
# Via WP-CLI:
<wp-cli-bin> --path=<site-root> db export backup.sql
# Direct MySQL access (credentials: root/root, db: local):
mysql --socket=~/.config/Local/run/<site-id>/mysql/mysqld.sock -u root -proot local
wp-env (MySQL in Docker):
npx wp-env run cli wp db export /tmp/backup.sql
Switch PHP version:
studio site set --php-version=8.2 --path=<site>"phpVersion": "8.2" in .wp-env.json, then npx wp-env start --updateSwitch WordPress version:
studio site set --wp-version=6.8 --path=<site> (if supported) or studio wp core update --version=6.8<wp-cli-bin> --path=<site-root> core update --version=6.8"core": "WordPress/WordPress#6.8" in .wp-env.jsonStudio: Built-in preview deployment to WordPress.com:
studio preview create --path=<site>
# Returns a public URL like https://<hash>.wp.build
studio preview update <host> --path=<site>
studio preview delete <host>
LocalWP: Live Links feature (GUI only). Alternative:
# Use ngrok or cloudflared for tunneling:
ngrok http <port>
cloudflared tunnel --url http://localhost:<port>
wp-env: No built-in sharing. Use ngrok against port 8888.
For deeper AI integration, consider setting up the WordPress MCP Adapter plugin (WordPress 6.9+). This turns any local WordPress site into an MCP server.
Read: references/mcp-adapter-setup.md
detect_local_env.mjs after installing/removing tools or creating/deleting sites.wp option get siteurl via the tool-specific method.curl <site-url>/wp-json/wp/v2/ should return the API index.docker info).lsof -i :<port>.wp-playground (ephemeral WASM-based).Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer