Command-line reference
Use wp kindly to inspect pages, apply structured edits, manage drafts, and validate element code.
Identity and output#
Run WP-CLI in the target WordPress installation. Content commands require --user=<login> so the plugin can check the actual account's permissions and AI access. Results are JSON. Ordinary failures exit with status 1; the core wrapper uses status 2 for a revision conflict.
wp cantata is a legacy alias for the core command family. New automation should use wp kindly.
Core commands#
| Command | Purpose and parameters |
|---|---|
wp kindly pages --user=editor |
List editable pages; supports the page-list filters |
wp kindly get 123 --user=editor |
Read the page outline; --version=live reads published content; --format chooses the supported representation |
wp kindly sections --user=editor |
List available theme sections |
wp kindly edit 123 --rev=TOKEN --ops=operations.json --user=editor |
Apply structured operations to a draft |
wp kindly check 123 --user=editor |
Check the current draft |
wp kindly publish 123 --rev=TOKEN --user=editor |
Publish the current draft after validation |
wp kindly discard 123 --rev=TOKEN --user=editor |
Discard the current draft |
wp kindly history 123 --limit=20 --user=editor |
List published versions |
wp kindly restore 123 456 --rev=TOKEN --user=editor |
Restore version 456 for page 123 |
The IDs above are examples. Resolve real IDs from pages and history. Do not reuse a revision token after a write without reading the returned or current state.
Structured operations#
--ops accepts a JSON array, a readable file, or - to read standard input. A file avoids shell-quoting mistakes. --path-mode defaults to revision-scoped paths. An optional --title supplies a title change.
Publishing has an explicit --allow-problems option. Review reported problems before using it; it is not an authentication or validation bypass.
Theme design#
wp kindly design get|validate|draft|publish|discard operates on the active structured design document. get supports --version; validate and draft accept JSON, a readable JSON file, or -. Draft, publish, and discard use --rev where required.
Site design publication affects shared styling. Verify more than the page currently open in the editor.
Element code#
wp kindly css check file.css validates and prints canonical element CSS without writing. Use - for stdin. Invalid CSS exits with status 1.
Element JavaScript and PHP register their own wp kindly element-js and wp kindly element-php commands with stronger permission and trust contracts. Follow the full JavaScript and PHP guides before using authoring or migration actions.
Retry behavior#
After a conflict, re-read and reconcile. After a timeout, inspect current draft and history before repeating a mutation. Keep credentials in the established WordPress configuration or scoped runtime environment, not command output or operation files.