Headless WordPress Platform Extension - WP-CLI
WP Engine Headless WordPress Platform Extension WP-CLI Commands
The Headless WordPress platform Extension (AHE) plugin (download here) provides the WP-CLI commands below. WP-CLI lets you run commands in your terminal to automate development processes that would take more time and effort to do manually.
We recommend Local for a local WordPress development environment that includes WP-CLI. Choose “Open Site Shell” from the site contextual menu, then try typing the commands below.
All AHE WP-CLI commands return 0 on success and 1 on failure. Success messages are prefixed by “Success:” and failure messages by “Error:”.
wp atlas blueprint import
Requires: Atlas Headless Extension 0.1.0+.
Description
Imports a blueprint from a URL or file path.
Synopsis
wp atlas blueprint import <path>
Options
<path>
The URL or local path of the blueprint zip file, or local path to the blueprint folder containing the main.json
manifest file. Local paths must be absolute.
Examples
wp atlas blueprint import https://example.com/path/to/blueprint.zip
wp atlas blueprint import /local/path/to/blueprint.zip
wp atlas blueprint import /local/path/to/blueprint-folder/
wp atlas blueprint export
Requires: AHE 0.1.0+.
Description
Exports a Headless WordPress platform blueprint using the current state of the site.
Synopsis
wp atlas blueprint export [--name] [--description] [--min-wp] [--min-wpe-atlas-headless-extension] [--version] [--post-types] [--open]
[--name]
Optional blueprint name. Used in the manifest and zip file name.
Defaults to “Atlas Blueprint” resulting in atlas-blueprint.zip
.
[--description]
Optional description of the blueprint.
[--min-wp]
Minimum WordPress version. Defaults to current WordPress version.
[--min-wpe-atlas-headless-extension]
Minimum WP Engine Headless Extension plugin version. Defaults to current version.
[--version]
Optional blueprint version. Defaults to 1.0.
[--post-types]
The post types to be added to the export, separated by commas. Defaults to post
.
page and all registered ACF post types.
[--wp-options]
Named wp_options
keys to be exported, separated by commas.
Default includes stylesheet
, template
, current_theme
, and theme_mods_{stylesheet}
.
[--wp-theme]
Theme slug. Defaults to twentytwentythree.
[--wp-theme-version]
Theme version. Defaults to latest.
[--open]
Open the folder containing the generated zip on success (macOS only,
requires that shell_exec()
has not been disabled).
wp atlas reset
Requires: AHE 0.1.0+.
Description
Resets WordPress blueprint state by deleting models, taxonomies, taxonomy terms, posts, relationship data, and media items relating to ACF post types.
Synopsis
wp atlas reset [--yes] [--all]
OPTIONS
[--yes]
Skip prompt to confirm deletion.
[--all]
Delete all published posts, pages, custom posts and media, not just posts and media associated with ACF models.
EXAMPLES
wp atlas reset
wp atlas reset --yes
wp atlas reset --all
wp atlas reset --yes --all