Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Scaffold Command

Scaffold Command Laravel Package

wp-cli/scaffold-command

WP-CLI scaffold command generates starter code for WordPress post types, taxonomies, blocks, plugins, and child themes. Includes commands for building themes from Underscores with options for activation, SASS, and WooCommerce support.

View on GitHub
Deep Wiki
Context7

Generates code for post types, taxonomies, blocks, plugins, child themes, etc.

Frequently asked questions about Scaffold Command
Can I use wp-cli/scaffold-command in a Laravel application?
No. It is a WP-CLI subcommand bundle that writes WordPress starter files to disk, with no service class, facade, or service provider, so there is nothing for Laravel to boot or resolve. The only overlap with a Laravel codebase is a handful of transferable patterns such as the PHPUnit bootstrap, the .phpcs.xml.dist ruleset, and CI configuration skeletons. Treat it as a WordPress toolchain accelerator, not a runtime dependency.
How do I install wp-cli/scaffold-command with Composer?
In practice you usually do not install it directly, because the package ships bundled inside WP-CLI and is already available on every wp scaffold invocation. Adding it as a standalone Composer dependency only makes sense in niche setups where you want the command files without the full WP-CLI binary. If you must control the version, use wp package install with the repository URL, which introduces a git dependency into your build path.
How do I generate a custom post type with WP-CLI scaffold?
Run wp scaffold post-type movie --label=Movie together with either --theme or --plugin to control where the file lands. The command emits a register_post_type() call complete with label and i18n boilerplate, which is exactly the tedious and error-prone block that benefits from deterministic generation. The same pattern applies to wp scaffold taxonomy for register_taxonomy() calls.
Is wp scaffold block deprecated?
Yes. The block command carries a hard deprecation warning in its own documentation, and the package README states that scaffolding plugins and themes is no longer recommended for modern WordPress development. The recommended replacement for block work is @wordpress/create-block. If you maintain existing sites that were scaffolded this way, grandfather them rather than adding new usage.
Does wp scaffold overwrite existing files, and is there a dry-run option?
There is no documented dry-run flag. The --force option overwrites silently, and generating into a populated directory is destructive and unguarded. Automation should pre-check target paths before invoking the command and should only pass --force when the target is known to be disposable.
Does wp scaffold underscores need network access?
Yes. wp scaffold _s fetches the theme scaffold from the Underscores project, and wp scaffold child-theme also downloads a template. Air-gapped or rate-limited CI environments will fail without a mirrored copy of that template. Plan for a local mirror or vendor the generated files if your build pipeline has no egress.
How do I test the generated scaffold output in CI?
The upstream project uses Behat to assert real files on disk, real exit codes, and real STDOUT and STDERR content, which is exactly the contract you should script against. Run the command into a temporary directory and assert the emitted file tree and exit status rather than unit testing internals. That approach survives upstream refactors far better than checking implementation details.
Is wp-cli/scaffold-command still maintained?
Yes. It is MIT licensed, actively released, and tested through GitHub Actions with PHPUnit, Behat, PHPStan, and PHPCS under WordPress Coding Standards. However, the maintainers have published a soft sunset signal for plugin and theme scaffolding, so it is best treated as a stable but declining utility. Scope any dependency to legacy WordPress maintenance and post type or taxonomy registration.
What are the alternatives to wp scaffold for modern WordPress development?
@wordpress/create-block is the recommended replacement for block and modern theme scaffolding. For plugin boilerplate, community generators or your own house templates fill the gap. wp scaffold remains reasonable for quickly generating register_post_type() and register_taxonomy() files in legacy projects.
How do I pin the version of wp-cli/scaffold-command?
Because the command ships inside WP-CLI, the effective version is whatever WP-CLI binary you installed, so pin WP-CLI itself in your provisioning image or dev dependencies. Overriding the bundled copy requires wp package install pointing at a git repository, which adds a git plus SSH dependency to the build path. A pinned container image with a known WP-CLI release is usually the simpler and safer choice.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log