Blocks
CLI
Blockstudio registers WP-CLI commands for managing blocks, database records, RPC functions, cron jobs, and settings from the terminal. Everything you can do through the REST API or PHP, you can do from the command line.
Blocks
List all blocks
wp bs blocks list+----------------------------+---------------------+-----------+------------------------+
| name | title | component | category |
+----------------------------+---------------------+-----------+------------------------+
| my-theme/hero | Hero | | my-theme |
| my-theme/card | Card | yes | my-theme |
| my-theme/newsletter | Newsletter | | my-theme |
+----------------------------+---------------------+-----------+------------------------+Filter to components only
wp bs blocks list --componentsOutput as JSON
wp bs blocks list --format=jsonDatabase
List schemas
wp bs db schemas+-------------------+-------------+---------+---------------------+
| block | schema | storage | fields |
+-------------------+-------------+---------+---------------------+
| my-theme/app | subscribers | table | email, name, plan |
| my-theme/app | logs | jsonc | action, details |
+-------------------+-------------+---------+---------------------+CRUD operations
# List records
wp bs db list my-theme/app subscribers
# List with filters
wp bs db list my-theme/app subscribers --plan=pro --limit=10
# Get a single record
wp bs db get my-theme/app subscribers 1
# Create a record
wp bs db create my-theme/app subscribers --email=a@b.com --plan=pro
# Update a record
wp bs db update my-theme/app subscribers 1 --plan=enterprise
# Delete a record
wp bs db delete my-theme/app subscribers 1For single-schema blocks, the schema name defaults to default:
wp bs db list my-theme/leadsOutput formats
All list commands support --format=table (default), --format=json, and
--format=csv:
wp bs db list my-theme/app subscribers --format=jsonRPC
List all functions
wp bs rpc list+-------------------+-------------+--------+----------------+---------+
| block | function | public | capability | methods |
+-------------------+-------------+--------+----------------+---------+
| my-theme/app | subscribe | yes | | POST |
| my-theme/app | stats | | edit_posts | POST |
| my-theme/app | get_status | | | GET,POST|
+-------------------+-------------+--------+----------------+---------+Call a function
wp bs rpc call my-theme/app subscribe --email=user@example.comOutput is JSON:
{
"success": true
}Parameters are passed as --key=value flags:
wp bs rpc call my-theme/app load_more --offset=10 --limit=5Cron
List all jobs
wp bs cron list+-------------------+----------+----------+---------------------+
| block | job | schedule | next_run |
+-------------------+----------+----------+---------------------+
| my-theme/app | cleanup | daily | 2026-03-17 00:00:00 |
| my-theme/app | sync | hourly | 2026-03-16 15:00:00 |
+-------------------+----------+----------+---------------------+Run a job manually
wp bs cron run my-theme/app cleanupThis executes the callback immediately, regardless of the schedule. Useful for testing and debugging.
Settings
Show all settings
wp bs settings listGet a specific setting
wp bs settings get tailwind/enabled
wp bs settings get assets/enqueueTailwind
Compile HTML to CSS
wp bs tailwind compile '<div class="flex items-center p-4">'Compile from file
wp bs tailwind compile --file=template.htmlCache management
wp bs tailwind cache path # show cache directory
wp bs tailwind cache clear # clear compiled cacheSCSS
Compile SCSS to CSS
wp bs scss compile '$color: red; .test { color: $color; }'Compile from file
wp bs scss compile --file=styles.scssCustom Fields
List all registered custom fields
wp bs fields list+-------+----------------+---------------------------+
| name | title | fields |
+-------+----------------+---------------------------+
| hero | Hero Section | heading, description, cta |
| card | Card | title, image, link |
+-------+----------------+---------------------------+Assets
List all assets
wp bs assets listFilter by type
wp bs assets list --type=global
wp bs assets list --type=admin
wp bs assets list --type=editor
wp bs assets list --type=registeredScripting
All commands support --format=json for easy piping:
# Export all subscribers as JSON
wp bs db list my-theme/app subscribers --format=json > subscribers.json
# Count records
wp bs db list my-theme/app subscribers --format=json | jq length
# Batch delete
wp bs db list my-theme/app logs --format=json | \
jq -r '.[].id' | \
xargs -I {} wp bs db delete my-theme/app logs {}