做什么
设置、 配置或排除本地 WordPress 开发环境时使用 @ wordpress/ env (wp- env) 。 触发到提及 wp-env,本地WordPress开发,基于多克的WordPress,或请求启动/停止/配置本地WordPress实例.
技能库 智客分类:运维与云 wp-env
设置、 配置或排除本地 WordPress 开发环境时使用 @ wordpress/ env (wp- env) 。 触发到提及 wp-env,本地WordPress开发,基于多克的WordPress,或请求启动/停止/配置本地WordPress实例.
官方网址:skills.sh
先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。
设置、 配置或排除本地 WordPress 开发环境时使用 @ wordpress/ env (wp- env) 。 触发到提及 wp-env,本地WordPress开发,基于多克的WordPress,或请求启动/停止/配置本地WordPress实例.
- 用户要求建立本地WordPress开发环境
按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:@wordpress/env (wp-env)、When to use、Inputs required、Procedure、1. Install wp-env、Global (recommended)。
文件分析:这是一份仅含 SKILL.md 的指令型技能,代理激活后整份正文进入上下文。
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.
@wordpress/env (wp-env)When to useInputs requiredProcedure1. Install wp-envGlobal (recommended)Or project-localThen use: npx wp-env start2. Start the environment3. Auto-detection (no config file)4. Configure with `.wp-env.json`5. Run commands in containers
兼容:Targets WordPress 7.0+ (PHP 7.4.0+). Requires Docker and Node.js 18.12+.
来源分类:skills.sh agent-skill
namewp-envdescriptioncompatibility具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗
先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。
复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。
把 Agent Skill「wp-env」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-34a52bf9c93dcb34-Wp-Env.html 请存为 .cursor/skills/wp-env/SKILL.md 或 .claude/skills/wp-env/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。
npx skills add 'https://github.com/wordpress/agent-skills' --list
npx skills add 'https://github.com/wordpress/agent-skills' --skill 'wp-env'
CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。
Zero-config, Docker-based local WordPress development environment for plugins, themes, and core.
.wp-env.json filewp-env, @wordpress/env, or Docker-based WordPress developmentwp-env or wp-playground? For a quick local WordPress, prefer the wp-playground skill by default — it's faster, disposable, and needs no Docker. Use wp-env when the task actually requires it:
.wp-env.jsonwp db commands, data that survives restarts)wp-env run)wp-env can also run without Docker by using Playground as its runtime (npx @wordpress/env start --runtime=playground, experimental). That is still wp-env, driven by the same .wp-env.json, so treat it as a Docker-free fallback for a project that already carries wp-env config, not as a third option. It swaps MySQL for SQLite and drops wp-env run and the separate tests environment, which are most of the reasons to pick wp-env in the first place. For a quick Docker-free WordPress with no wp-env config, use the wp-playground skill directly.
docker infonode -v.wp-env.json, plugin headers, or style.css theme headers).wp-env.json and .wp-env.override.json if present# Global (recommended)
npm -g install @wordpress/env
# Or project-local
npm i @wordpress/env --save-dev
# Then use: npx wp-env start
wp-env start
Default credentials:
adminpasswordCommon start options:
wp-env start --update -- pull latest sources and reconfigurewp-env start --xdebug -- enable Xdebug (debug mode)wp-env start --xdebug=profile,trace -- multiple Xdebug modeswp-env start --auto-port -- find available ports when defaults are busyWhen no .wp-env.json exists, wp-env scans the current directory:
| Detected type | How detected | Auto-config |
|--------------|-------------|-------------|
| Plugin | Plugin Name: header in a root .php file | { "plugins": ["."] } |
| Theme | Theme Name: header in style.css | { "themes": ["."] } |
| Core | wp-includes/version.php exists | { "core": "." } |
.wp-env.jsonPlace at the project root. All fields are optional.
{
"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%/"
}
}
core, plugins, themes, mappings)| Format | Example |
|--------|---------|
| Local path | ".", "./path", "../path" |
| GitHub shorthand | "WordPress/classic-editor", "owner/repo#branch" |
| ZIP URL | "https://downloads.wordpress.org/plugin/akismet.zip" |
| Git SSH | "ssh://user@host/repo.git#ref" |
GOTCHA: WordPress.org plugin/theme slugs (bare names like "akismet") do NOT work. Use the full ZIP URL.
.wp-env.override.jsonCreate .wp-env.override.json next to .wp-env.json for personal settings (gitignored). Only config and mappings are merged -- all other fields (including plugins and themes arrays) fully replace the base.
# 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 wordpress
Available containers: mysql, wordpress, cli, composer, phpmyadmin.
wp-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 images
wp-env start --xdebug # Enable debug mode
wp-env start --xdebug=coverage # For code coverage
wp-env start # Disable Xdebug (restart without flag)
Modes: debug, profile, trace, develop, coverage.
IDE listens on port 9003. VS Code launch.json needs:
{
"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 status shows running containers with correct portshttp://localhost:8888/wp-admin/ loads the WordPress adminwp-env run cli wp plugin list shows expected pluginswp-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 --auto-port or set custom port in .wp-env.json |
| Plugin not appearing | Missing Plugin Name: header in main PHP file | 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 | wp-env start --update or wp-env destroy && wp-env start |
| White screen / PHP errors | Corrupted database | wp-env reset all && wp-env start |
| Override not taking effect | Wrong merge behavior | plugins/themes in override replace base arrays; only config/mappings merge |
| 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 pathMappings |
| npm global install permission error | Node installed to a system path | Use nvm, or install locally: npm i -D @wordpress/env and run via npx wp-env |
--runtime=playground) is experimental and has limited feature parity运维与云
用于容器管理,图像操作,调试的基本道克命令和工作流程.
运维与云
从开放的代理技能生态系统中发现并安装技能. 使用时:(1)用户问"我如何做X",X可能拥有现有技能,(2)用户说"为X找到技能"或"是否为X有技能",(3)用户问"你能否做X",X是专门能力,(4)用户想扩展代理能力,(5)用户想搜索工具,模板,或工作流程,(6)用户提到他们希望…
运维与云
Azure上使用AppLens,AzureMonitor,资源健康,安全分型的调试Azure生产问题. 当:调试生产问题,故障解答应用服务,应用服务高CPU,应用服务部署失败,故障解答容器应用,故障解答功能,故障解答AKS,VM RDP,Linux SSH,VM黑屏幕,无法连接到…
运维与云
准备 azd 用于部署的Azure项目:为Azure开发者CLI(azd)工作流程生成azure.yaml,基础设施(Bicep/Terraform)和多克文件. 仅当用户明确想要使用 azd 作为部署工具时使用, 或项目已经有一个 azure 。 雅姆尔文件。 不使用: 非az…