A CLI tool for creating and managing ACF (Advanced Custom Fields) blocks with Twig templates.
npx bp-create-blockCreates a new ACF block with Twig template.
npx bp-create-block create
# or simply
npx bp-create-blockInteractive prompts:
- Block slug
- Block title (defaults to formatted slug)
- Block description
- Block category
- Dashicon (without prefix)
- Keywords (comma-separated)
- Post type restrictions (optional)
- Full alignment support (y/n)
Migrates blocks from v1 to v2 structure.
npx bp-create-block migrateAutomatically updates:
- Moves blocks folder to theme root
- Updates example folder structure
- Modifies functions.php
- Converts block structure to v2 format
Copies an existing block for reuse and customization.
npx bp-create-block reuseRequirements:
- Must be run from blocks folder
- Prompts for source block path
- Option to rename the copied block
Updates blocks from ACF version 2 to version 3.
npx bp-create-block v2-to-v3Automatically updates blockVersion to 3 in all block.json files.
MIT