WP-CLI config commands
wp vx-framework config does from the shell what an object's Source tab does in the dashboard, so you can script it in deploys and CI. Groups are post_types, taxonomies and fieldsets. Option pages and dictionaries have their own groups, option_pages and dictionaries.
| Command | Does |
|---|---|
wp vx-framework config list [--group=<group>] [--format=<format>] | Lists every object with where it comes from. |
wp vx-framework config status [<group> <key>] [--strict] | Shows one object's state, or a site-wide summary. --strict exits with an error on out-of-sync or invalid config, and on files that load with errors or warnings. |
wp vx-framework config export <group> <key> [--write] | Prints the object's JSON. --write also saves it to wp-content/uploads/vx-framework/vx-config (see JSON files). |
wp vx-framework config export --all [--zip=<file>] [--stdout] | Exports every object as a ZIP bundle to wp-content/uploads/vx-framework/exports/, or to standard output with --stdout. |
wp vx-framework config import <file> [--plan] [--yes] | Imports a JSON file or ZIP bundle. --plan shows what would happen without doing it. |
wp vx-framework config override <group> <key> | Copies a code-defined object into the database so it can be edited. |
wp vx-framework config reset <group> <key> | Discards the database copy, returning to the code definition. |
wp vx-framework config import-run <session-id> [--rollback] | Inspects, or rolls back, an import made in the dashboard. |
With VX Framework Pro, --write saves to the last registered folder it writes to, such as your theme's vx-config, and to wp-content/uploads/vx-framework/vx-config when there is none.
Examples
bash
# Save a dashboard-built fieldset as a JSON file, ready to commit
wp vx-framework config export fieldsets book_details --write
# Move a whole model between sites
wp vx-framework config export --all --stdout > model.zip
wp vx-framework config import model.zip --plan # review
wp vx-framework config import model.zip --yes # apply
# Make a code-defined post type editable, then undo that
wp vx-framework config override post_types place
wp vx-framework config reset post_types placeImporting from the command line is all or nothing: if any object fails, nothing is changed. The dashboard's importer works the other way, one item at a time, so long imports can be paused, resumed and rolled back. See Import and export.
A bundle that refers to objects it doesn't include (a fieldset for a post type that isn't in the bundle and doesn't exist on the site) is refused unless you add --acknowledge-missing-refs.
Technical details for LLMs
- Formats for
list:table,json,csv,yaml,count. importoptions:--plan,--yes,--acknowledge-missing-refs,--mapping-plan=<file>(JSON keyed bygroup:source_keywithcreate/update/map_only/skipdecisions and optional sections, key resolutions and reference resolutions).import-runreceipts are author-scoped; pass the global--user=<author-id>.- All lifecycle commands respect
VXFRAMEWORK_CONFIG_LOCKED. - Related command families:
wp vx-framework abilities(see Developers → WP-CLI).