jasonbaciulis / bedrock-commands
Artisan commands that scaffold, rename and delete page builder blocks and article sets in the Bedrock starter kit
Package info
github.com/jasonbaciulis/bedrock-commands
Type:statamic-addon
pkg:composer/jasonbaciulis/bedrock-commands
Requires
- php: ^8.4
- statamic/cms: ^6.34.1
Requires (Dev)
- driftingly/rector-laravel: ^2.6.2
- larastan/larastan: ^3.12.2
- laravel/pint: ^1.32.1
- orchestra/testbench: ^11.0
- pestphp/pest: ^5.2.1
- pestphp/pest-plugin-laravel: ^5.0.1
- pestphp/pest-plugin-phpstan: ^5.2.1
- pestphp/pest-plugin-rector: ^5.0.4
- pestphp/pest-plugin-type-coverage: ^5.0.2
- phpstan/phpstan: ^2.2.15
- phpunit/phpunit: ^13.3.4
- rector/rector: ^2.6.7
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-25 10:56:08 UTC
README
A Statamic addon with CLI commands that create, rename and delete the page builder blocks and article sets of the Bedrock starter kit. Each command keeps the fieldset, the Antlers view, the parent YAML definition and the entry content in sync.
Requirements
- PHP 8.4+
- Statamic 6.34+
- The Bedrock fieldsets
resources/fieldsets/blocks.yamlandresources/fieldsets/article.yaml
Installation
The Bedrock starter kit installs this addon for you. To add it to an existing Bedrock project:
composer require --dev jasonbaciulis/bedrock-commands
Blocks
Blocks are like LEGO bricks that give you maximum flexibility when you build pages. Blocks are sets of the Blocks field, which is based on the Replicator Fieldtype.
Make
php please make:bedrock-block
- Adds a set to the Blocks field in
resources/fieldsets/blocks.yaml. - Creates a fieldset for the block in
resources/fieldsets/{file_name}.yaml. - Creates a view with default markup in
resources/views/blocks/{file-name}.antlers.html.
Delete
php please delete:bedrock-block
Removes a set from the Blocks field, removes it from all entries and deletes its fieldset and view.
Rename
php please rename:bedrock-block
Renames a block, its fieldset and its view, updates all entries that use it and optionally moves it to another group.
Sets
Sets give you a flexible content editing experience for entries, e.g. blog posts. Sets live in the Article field, which is based on the Bard Fieldtype.
Make
php please make:bedrock-set
- Adds a set to the Article field in
resources/fieldsets/article.yaml. - Creates a fieldset for the set in
resources/fieldsets/{file_name}.yaml. - Creates a view with default markup in
resources/views/sets/{file-name}.antlers.html.
Delete
php please delete:bedrock-set
Removes a set from the Article field, removes it from all entries and deletes its fieldset and view.
Rename
php please rename:bedrock-set
Renames a set, its fieldset and its view, updates all entries that use it and optionally moves it to another group.
Arguments and options
Each command asks for the values that you do not give. <group> must be an existing group handle from blocks.yaml or article.yaml.
| Command | Arguments | Options |
|---|---|---|
make:bedrock-block, make:bedrock-set |
<group> "<Display Name>" |
--instructions="..." sets the editor instructions. --force overwrites existing files. |
delete:bedrock-block, delete:bedrock-set |
<group> <fieldset_handle> |
--keep-files removes the set from the parent fieldset but keeps its fieldset and view. --force skips the confirmation and ignores missing files. |
rename:bedrock-block, rename:bedrock-set |
<group> <current_handle> "<New Display Name>" |
--force skips the confirmation and overwrites existing files. |
Scripts and AI agents
A prompt hangs a non-interactive shell. Always give all arguments, and give --force to the delete and rename commands:
php please make:bedrock-block hero "Hero Simple" --instructions="A simple hero with a title and text." php please delete:bedrock-block hero hero_simple --force php please rename:bedrock-block hero hero_simple "Hero Centered" --force
Tell your AI agents to always use these commands for blocks and sets, and never to create or remove the files by hand. Bedrock's .ai/guidelines/bedrock.md already does this for Laravel Boost.
Configuration
The commands write the views to resources/views/blocks and resources/views/sets. To change these paths, publish the config:
php artisan vendor:publish --tag=bedrock-commands-config
Then edit blocks_views_path and sets_views_path in config/bedrock-commands.php.
Stubs
The make commands create the fieldset and the view from stubs. To change the default markup or fields, publish the stubs:
php artisan vendor:publish --tag=bedrock-commands-stubs
Then edit the files in stubs/bedrock-commands. The commands use a published stub when it exists, and the bundled stub when it does not. {{ name }} is replaced with the display name.
| Stub | Creates |
|---|---|
fieldset_block.yaml.stub |
The fieldset of a new block |
block.antlers.html.stub |
The view of a new block |
fieldset_set.yaml.stub |
The fieldset of a new set |
set.antlers.html.stub |
The view of a new set |
Development
composer install
composer test
composer test runs Pint, Rector, type coverage, PHPStan and the Pest suite with 100% code coverage. The tests use the fixtures in tests/__fixtures__, not the project's fieldsets and content.
License
Bedrock Commands is open-source software licensed under the MIT license.