wp-cli/rewrite-command
WP-CLI package for managing WordPress rewrite rules and permalinks from the command line. Flush rules, inspect the current rewrite list, and update permalink structure without leaving your terminal, making migrations and debugging faster.
Verdict up front: this is not a Laravel package. wp-cli/rewrite-command is a WP-CLI bundle command for WordPress — it manipulates $wp_rewrite, flushes rewrite rules, and updates the permalink_structure option. It requires a bootstrapped WordPress core and the WP_CLI runtime. There is no service provider, no facade, no config publish, and no Laravel-facing API. Any Laravel "integration" is really a subprocess wrapper around wp rewrite.
Architecture fit
composer.json — pulling it in gives you dead weight in vendor/ and a transitive WP-CLI dependency tree.Symfony\Process → wp rewrite flush --path=... --allow-root on a target WP root.Integration feasibility
wp-cli/wp-cli-bundle, which is the normal consumption path. Prefer that over a direct pin — direct pins of individual bundle commands are a known drift source.Technical risk
wp-cli/rewrite-command under the WP-CLI GitHub org) and treat the version string as unreliable until checked.wp rewrite structure and hard flushes mutate live permalink state. A mis-scoped command run against production can break URLs across a site until rules are regenerated. This needs guardrails, not just a wrapper..htaccess; multisite requires --network semantics; caching plugins and object caches can mask or staleness-skew results.Key questions
Stack fit
wp:rewrite-flush --site=...) invoking WP-CLI via Symfony\Component\Process\Process, with explicit --path, --url for multisite, and structured logging of stdout/stderr and exit code.flush_rewrite_rules() directly. Bootstrapping WP core into a Laravel request lifecycle creates global-state collisions ($wpdb, $wp_filter, $current_user) that are painful to unwind.Migration path
Compatibility
Sequencing
--hard gating and a confirmation prompt for structural changes.Maintenance
wp-cli/wp-cli-bundle; the WP-CLI org maintains it. The wrapper command you write is yours forever — realistically 100–200 lines, low churn.Support
.htaccess state, plugin interference). This is not a Laravel-debuggable failure surface.Scaling
Failure modes
--path, or when permissions deny .htaccess writes on hard flush.--allow-root or elevated execution is baked into the wrapper without restriction.Ramp-up
Recommendation: reject as a Laravel dependency; adopt conditionally as an externally-invoked operational tool only if a WordPress install is confirmed in scope and its ownership is assigned. The package itself is credible — the framing is not.
How can I help you explore Laravel packages today?