WP-CLI Commands

BF Blocks registers a full set of WP-CLI commands under the wp bf-blocks namespace for scripted deployments, CI/CD pipelines, and automation.

CommandFlags / ArgsDescription
wp bf-blocks listList all registered block definitions with their slug, name, and status.
wp bf-blocks export--block=<slug>Export a single block by its slug. Outputs JSON to stdout or a file.
wp bf-blocks export--all --output=<path>Export all blocks to the specified directory path.
wp bf-blocks export--include-templatesInclude PHP template override files in the export (use with --block or --all).
wp bf-blocks import<file|directory>Import blocks from a JSON file or all JSON files in a directory.
wp bf-blocks import--forceImport and overwrite existing blocks without confirmation prompts.
wp bf-blocks flush-cacheClear the BF Blocks block registry cache. Useful after manually editing JSON files.
wp bf-blocks versionDisplay the currently installed BF Blocks version.
wp bf-blocks licence activate<key>Activate the BF Blocks licence for this site.
wp bf-blocks licence deactivateDeactivate the licence on this site (frees the activation slot).
wp bf-blocks licence statusShow licence status, plan, and number of active sites.

Common Usage Examples

Export a single block for version control

wp bf-blocks export --block=testimonial --output=./blocks/testimonial.json

Import all blocks to a new site

wp bf-blocks import ./blocks/ --force

Activate licence in a deployment script

wp bf-blocks licence activate "$BF_BLOCKS_LICENCE_KEY"

Check what's installed

wp bf-blocks list
wp bf-blocks version

Get help inline

Run wp bf-blocks --help or wp bf-blocks export --help for full flag documentation at the command line.