Loading...
Loading...
Use when setting up, configuring, or troubleshooting local WordPress development environments with @wordpress/env (wp-env). Triggers on mentions of wp-env, local WordPress development, Docker-based WordPress, or requests to start/stop/configure a local WordPress instance.
npx skill4agent add wordpress/agent-skills wp-env.wp-env.jsonwp-env@wordpress/env.wp-env.jsonwp dbwp-env runnpx @wordpress/env start --runtime=playground.wp-env.jsonwp-env rundocker infonode -v.wp-env.jsonstyle.css.wp-env.json.wp-env.override.json# Global (recommended)
npm -g install @wordpress/env
# Or project-local
npm i @wordpress/env --save-dev
# Then use: npx wp-env startwp-env startadminpasswordwp-env start --updatewp-env start --xdebugwp-env start --xdebug=profile,tracewp-env start --auto-port.wp-env.json| Detected type | How detected | Auto-config |
|---|---|---|
| Plugin | | |
| Theme | | |
| Core | | |
.wp-env.json{
"core": null,
"phpVersion": "8.1",
"plugins": [
".",
"https://downloads.wordpress.org/plugin/akismet.zip",
"WordPress/classic-editor"
],
"themes": [],
"port": 8888,
"multisite": false,
"phpmyadmin": false,
"config": {
"WP_DEBUG": true,
"SCRIPT_DEBUG": true
},
"mappings": {
"wp-content/mu-plugins": "./mu-plugins"
},
"lifecycleScripts": {
"afterStart": "wp-env run cli wp rewrite structure /%postname%/"
}
}corepluginsthemesmappings| Format | Example |
|---|---|
| Local path | |
| GitHub shorthand | |
| ZIP URL | |
| Git SSH | |
"akismet".wp-env.override.json.wp-env.override.json.wp-env.jsonconfigmappingspluginsthemes# WP-CLI commands
wp-env run cli wp user list
wp-env run cli wp plugin list
wp-env run cli wp option update blogname "My Site"
wp-env run cli "wp rewrite structure /%postname%/"
# Run commands in a specific directory
wp-env run cli --env-cwd=wp-content/plugins/my-plugin composer install
# PHPUnit tests
wp-env run cli --env-cwd=wp-content/plugins/my-plugin vendor/bin/phpunit
# Pass flags with -- separator
wp-env run cli php -- --version
# MySQL access
wp-env run mysql mysql -- --user=root --password=password wordpressmysqlwordpressclicomposerphpmyadminwp-env stop # Stop and free ports
wp-env reset development # Reset dev database (keeps test)
wp-env reset all # Reset all databases
wp-env logs # Stream PHP/Docker logs
wp-env logs --no-watch # Print logs and exit
wp-env status # Show URLs, ports, config
wp-env status --json # Machine-readable status
wp-env cleanup # Remove containers/volumes (keep images)
wp-env destroy # Remove everything including imageswp-env start --xdebug # Enable debug mode
wp-env start --xdebug=coverage # For code coverage
wp-env start # Disable Xdebug (restart without flag)debugprofiletracedevelopcoveragelaunch.json{
"type": "php",
"request": "launch",
"name": "Listen for Xdebug",
"port": 9003,
"pathMappings": {
"/var/www/html/wp-content/plugins/your-plugin": "${workspaceFolder}"
}
}{ "multisite": true, "plugins": ["."] }wp-env statushttp://localhost:8888/wp-admin/wp-env run cli wp plugin listwp-env reset development| Symptom | Cause | Fix |
|---|---|---|
| "Cannot connect to Docker daemon" | Docker not running | Start Docker Desktop |
| "Port 8888 already in use" | Port conflict | Use |
| Plugin not appearing | Missing | Add standard plugin header comment |
| "Could not find a valid source" | Invalid source string in config | Use full ZIP URL for wp.org plugins, not bare slugs |
| Stale environment after source changes | Cached Docker volumes | |
| White screen / PHP errors | Corrupted database | |
| Override not taking effect | Wrong merge behavior | |
| Tests environment not accessible | Wrong port | Test environment runs on port 8889 by default |
| Xdebug not connecting | IDE not listening or wrong port | Ensure IDE listens on port 9003 with correct |
| npm global install permission error | Node installed to a system path | Use |
--runtime=playground