CLI command reference
The command reference, split by command group the same way the CLI organizes itself:
- Environment commands:
init,server,destroy,lint,acf install,version - Partials and blocks:
partial create/list/sync/check-drift/add-js/remove/install-manifest,block create/list/remove - Templates and static assets:
template create/list/remove/validate,static compile - Agents and output:
agents write,mcp,readme create,--format json
Every command also documents itself: wonderpress alone prints the command map, and wonderpress <command> help (or -h) prints help for that command.
Global options
These flags work across most commands and are not repeated on every page.
| Flag | Description |
|---|---|
--dir <path> | Environment root (default: current directory, or the detected project root). |
--theme <name> | Target a theme by slug instead of the active lookup. |
--env <backend> | host (default) or wp-env. Needed at init; later commands read .wonderpressrc. Override per invocation with WONDERPRESS_ENV. |
--format json | Structured { ok, data, error } envelope. Unknown values are refused. |
-h, --help | Help for the current command. |
Exit codes
| Code | Meaning |
|---|---|
0 | Success. |
1 | Failure. |
2 | Usage: ambiguous theme, bad flags, and similar. |