cli.php
Provides the wp kindly command family and legacy wp cantata alias. Commands share the AI access checks and content functions and emit JSON results.
Responsibility#
Provides the wp kindly command family and legacy wp cantata alias. Commands share the AI access checks and content functions and emit JSON results.
This is an implementation reference for the released 0.9.13 module. Internal PHP helpers are not a compatibility promise for third-party callers. Prefer the documented REST, Abilities, theme, and filter contracts.
Related modules#
abilities, ai-checks, element-css, page-model, theme-design.
Function and method reference#
emit#
function emit( $value ): void
Internal implementation helper in this module. Its name and signature identify the operation and accepted PHP values; it is not a standalone authenticated endpoint.
Source location: includes/cli.php:7.
require_user#
function require_user(): void
Internal implementation helper in this module. Its name and signature identify the operation and accepted PHP values; it is not a standalone authenticated endpoint.
Source location: includes/cli.php:14.
page_id#
function page_id( array $args, int $index = 0 ): int
Validate positional ids before they can fall through to site-wide access checks.
Source location: includes/cli.php:18.
pages#
function pages( array $args, array $assoc ): void
List editable pages.
Implementation connections: cantata_edit_ai_can, cantata_edit_ai_pages.
Source location: includes/cli.php:24.
get#
function get( array $args, array $assoc ): void
Read a page.
Implementation connections: cantata_edit_ai_can, cantata_edit_ai_outline.
Source location: includes/cli.php:26.
sections#
function sections( array $args, array $assoc ): void
List theme sections.
Implementation connections: cantata_edit_ai_can, cantata_edit_ai_sections_available.
Source location: includes/cli.php:31.
edit#
function edit( array $args, array $assoc ): void
Apply operations from --ops=<JSON|file|->.
Implementation connections: cantata_edit_ai_edit_page.
Source location: includes/cli.php:33.
check#
function check( array $args, array $assoc ): void
Check the current draft.
Implementation connections: cantata_edit_ai_check_page.
Source location: includes/cli.php:40.
publish#
function publish( array $args, array $assoc ): void
Publish the current draft.
Implementation connections: cantata_edit_ai_publish_page.
Source location: includes/cli.php:42.
discard#
function discard( array $args, array $assoc ): void
Discard the current draft.
Implementation connections: cantata_edit_ai_discard_draft.
Source location: includes/cli.php:44.
history#
function history( array $args, array $assoc ): void
List published versions.
Implementation connections: cantata_edit_ai_history.
Source location: includes/cli.php:46.
restore#
function restore( array $args, array $assoc ): void
Restore a version from History.
Implementation connections: cantata_edit_ai_restore_version.
Source location: includes/cli.php:48.
design#
function design( array $args, array $assoc ): void
Read, validate, draft, publish or discard the active client design.
Implementation connections: cantata_edit_design_discard, cantata_edit_design_document, cantata_edit_design_publish, cantata_edit_design_save_draft, cantata_edit_design_validate_input.
Source location: includes/cli.php:50.
css#
function css( array $args, array $assoc ): void
Element CSS (data-ke-css), read-only: wp kindly css check <file|-> prints its canonical form, or each error with
its line (exit 1). For migrations: the value to store is the printed "css". Nothing is written.
Implementation connections: cantata_edit_element_css_parse.
Source location: includes/cli.php:79.