wp-cli/entity-command
WP-CLI commands for managing WordPress comments, menus, options, posts, sites, terms, and users. Create, update, delete, list, and moderate entities from the command line, with support for metadata, custom fields, and block notes.
Scope correction (material): wp-cli/entity-command is not a Laravel or general-purpose Composer library. It is a WP-CLI command bundle that implements wp comment, wp menu, wp option, wp post, wp site, wp term, and wp user. It has no importable PHP API surface — its only contract is CLI invocation, stdout/stderr, and exit codes. Any Laravel integration is therefore a subprocess integration against a WordPress runtime, not a composer require and a service provider.
Architecture fit
WP_Comment_Query, wp_insert_comment(), and the options/terms/users tables are WordPress core concerns.wp-cli/wp-cli-bundle, so most integrations require zero new dependencies — a significant de-risking factor the raw score does not capture.Integration feasibility
Symfony\Process, using argv arrays (never string concatenation — --comment_content, --comment_author, and --<field>=<value> pass straight into core APIs and are the injection surface).--format=json, --format=ids, --porcelain, and --field= for single values. Table output must be treated as human-only and never parsed.--format values, which lowers integration spec effort. The 6.9+ "note" comment type is a useful capability for editorial workflows but introduces a version dependency.Technical risk
wp comment delete <id>... and wp user delete can partially succeed; a non-zero exit code does not mean nothing happened. Every mutating call needs a post-condition verification read (exists, get, list --field=ID).create has no upsert semantics and no --dry-run on most commands. Retries after timeouts will duplicate records unless callers pass a look-up-first pattern.wp-cli-bundle rather than directly. The real maturity evidence is stronger than the score suggests — CI badge, Codecov, PHPStan, WP_CLI_CS coding standard, and a Behat acceptance suite for every command.Key questions
--url= context on nearly every command)?--force deletes, user/site deletion), and where should that log live?Stack fit
WordPressCli service (Process::timeout(...)->run(['wp', ...])), a typed result object (exit code, decoded JSON, stderr), and per-entity actions (CommentService, UserService, OptionService). Keep it behind an interface so a REST-API implementation can be swapped in later.wp binary available, --path= and --url= supplied explicitly rather than relying on CWD, and a database user with the access WP itself needs.wp db * and other non-entity commands; they are not this package and carry different blast radius.Migration path
wp comment --help and wp --info on the target. No install work in the common case.--format=json / --porcelain and a follow-up verification read.Compatibility
get vs list); decode defensively.--url= context per tenant in config; never infer it from a request parameter without validation.Sequencing
--force deletes come last because they require the audit logging and post-condition checks to already exist.Maintenance
Support
wp failures in stdout/stderr (WP-CLI), HTTP failures on the Laravel side.Scaling
--format=ids piped into a single batched operation, or wp eval-file with a small PHP script for multi-step work that would otherwise be dozens of invocations.Failure modes
--path, missing wp-config.php, DB unreachable — indistinguishable from command failure unless stderr is surfaced verbatim to operators.list operations; mitigation: paginate with --number / --offset and cap batch sizes.--force bypasses trash entirely. Mitigation: forbid --force in application code paths; require an explicit, reviewed code change to enable it, plus audit logging.Ramp-up
--url context) rather than the tooling.--path/--url conventions, the JSON/porcelain-only rule, the verify-after-write pattern, and the --force prohibition. That runbook is the highest-leverage artifact for this integration.Recommendation: proceed only where a WordPress runtime is genuinely in scope, and treat the deliverable as a shell-out adapter with strict output/exit-code discipline — not as a Laravel dependency. The low star count and zero dependents should not block; the real gating risks are WordPress version coupling, non-atomic batch operations, and destructive-command governance.
How can I help you explore Laravel packages today?