- 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.