Headless Platform Extension - WP-CLI
WP Engine Headless Platform Extension WP-CLI Commands
Section titled “WP Engine Headless Platform Extension WP-CLI Commands”The Headless 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
Section titled “wp atlas blueprint import”Requires: Atlas Headless Extension 0.1.0+.
Description
Section titled “Description”Imports a blueprint from a URL or file path.
Synopsis
Section titled “Synopsis”wp atlas blueprint import <path>
Options
Section titled “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
Section titled “Examples”wp atlas blueprint import https://example.com/path/to/blueprint.zipwp atlas blueprint import /local/path/to/blueprint.zipwp atlas blueprint import /local/path/to/blueprint-folder/
wp atlas blueprint export
Section titled “wp atlas blueprint export”Requires: AHE 0.1.0+.
Description
Section titled “Description”Exports a Headless Platform blueprint using the current state of the site.
Synopsis
Section titled “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
Section titled “wp atlas reset”Requires: AHE 0.1.0+.
Description
Section titled “Description”Resets WordPress blueprint state by deleting models, taxonomies, taxonomy terms, posts, relationship data, and media items relating to ACF post types.
Synopsis
Section titled “Synopsis”wp atlas reset [--yes] [--all]
OPTIONS
Section titled “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 resetwp atlas reset --yeswp atlas reset --allwp atlas reset --yes --all