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

Entity Command Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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

  • Fits only if the target environment already runs, or can run, a WordPress installation with WP-CLI. In a pure Laravel application there is no data model this package can act on: WP_Comment_Query, wp_insert_comment(), and the options/terms/users tables are WordPress core concerns.
  • Where it fits well: back-office tooling, content migration, seeded demo environments, CI fixtures, and scheduled content hygiene (spam/trash pruning, orphaned meta cleanup) for a WordPress site that a Laravel app administers or reports on.
  • It is almost certainly already installed: this package ships inside 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

  • High feasibility, low code volume: wrap invocations in a thin Laravel service class over 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).
  • Machine-readable output is supported and should be mandated: --format=json, --format=ids, --porcelain, and --field= for single values. Table output must be treated as human-only and never parsed.
  • The command surface is broad and well documented per-command, with per-option defaults and allowed --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

  • Version coupling to WordPress core is the primary risk: behavior and available fields depend on the installed WP version (comment notes require 6.9+), and WP-CLI must be kept aligned with WP and PHP.
  • Non-atomic batch operations: 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).
  • Non-idempotent creates: 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.
  • Signals are weak in aggregate: 0 declared dependents and 105 stars look poor, but both are artifacts of the package being consumed transitively via 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.
  • Data hygiene flag: the recorded last release of 2026-11-02 is in the future and should be treated as a metadata error until confirmed against the repository's tags.
  • License is MIT — no legal friction.

Key questions

  1. Which WordPress version(s) and PHP version(s) are in scope, and is multisite involved (which forces --url= context on nearly every command)?
  2. Does the WordPress instance and WP-CLI live in the same network/host as the Laravel app, or does this become an SSH/remote-execution integration?
  3. Who owns the WordPress runtime — same team, or a separate content/platform group?
  4. Is there an audit requirement on destructive operations (--force deletes, user/site deletion), and where should that log live?
  5. Why subprocess rather than the WP REST API for the read-heavy cases? REST is usually the better fit for request-path reads; this package is better for bulk and admin operations.
  6. What is the acceptable invocation latency budget per operation, given a full WordPress bootstrap per call?

Integration Approach

Stack fit

  • Laravel side: a dedicated 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.
  • WordPress side: a running install with the wp binary available, --path= and --url= supplied explicitly rather than relying on CWD, and a database user with the access WP itself needs.
  • Explicitly scope out wp db * and other non-entity commands; they are not this package and carry different blast radius.

Migration path

  • Phase 1: discover that the bundle is already present; verify wp comment --help and wp --info on the target. No install work in the common case.
  • Phase 2: build the wrapper and prove out the three highest-value operations with --format=json / --porcelain and a follow-up verification read.
  • Phase 3: move scheduled/one-off scripts (spam pruning, meta backfills, seeded fixtures) onto the wrapper and retire ad-hoc shell scripts.
  • Phase 4: assess REST API overlap for any read path that sits in a user request; keep the CLI path for bulk and privileged writes.

Compatibility

  • Pin the WP-CLI bundle version alongside the WordPress version in the deployment manifest; treat upgrades of either as a coordinated change with a smoke test over every command the app calls.
  • Normalize output before parsing: JSON is stable, but empty result sets and single-object vs list shapes vary by command (get vs list); decode defensively.
  • Multisite: encode the --url= context per tenant in config; never infer it from a request parameter without validation.

Sequencing

  • Do the wrapper and one read command first, then one mutating command with verification, then batch/generate operations. Batch operations and --force deletes come last because they require the audit logging and post-condition checks to already exist.

Operational Impact

Maintenance

  • Two upgrade tracks to own: the WordPress core version and the WP-CLI bundle version. Both are driven by upstream release cadence, not by this repo alone.
  • The package itself is low-churn relative to core, but it is a moving part on every WP/WP-CLI upgrade; budget a re-verification pass per upgrade rather than expecting stability by default.

Support

  • Support burden lands on whoever owns the WordPress runtime, not the Laravel team, unless ownership is negotiated up front. Debugging splits cleanly: wp failures in stdout/stderr (WP-CLI), HTTP failures on the Laravel side.
  • The Behat suite gives us a reference for expected behavior but not a contract for our pinned versions; our own smoke tests are the real safety net.

Scaling

  • Per-invocation cost is a full WordPress bootstrap — typically hundreds of milliseconds to seconds. Do not put this on a hot request path; do not loop one subprocess per entity (classic N+1).
  • Prefer bulk shapes: --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.
  • Concurrency: parallel invocations against the same install are generally safe for reads but contend on writes; serialize mutating batches per site.

Failure modes

  • Bootstrap failures: wrong --path, missing wp-config.php, DB unreachable — indistinguishable from command failure unless stderr is surfaced verbatim to operators.
  • Partial success on multi-ID operations; non-zero exit with real state change. Mitigation: verify post-state, and treat "unknown" as a required resolution step rather than retrying blindly.
  • Timeouts and truncated output on large list operations; mitigation: paginate with --number / --offset and cap batch sizes.
  • Irreversible deletes: --force bypasses trash entirely. Mitigation: forbid --force in application code paths; require an explicit, reviewed code change to enable it, plus audit logging.
  • Argument injection through free-text fields; mitigation: argv-only invocation, no shell, no string interpolation.
  • Version drift producing missing fields or unsupported types (e.g., notes on pre-6.9); mitigation: gate such calls on a checked WP version.

Ramp-up

  • Low for anyone with WordPress CLI familiarity; moderate for a Laravel-only team, whose main learning curve is WordPress's schema quirks (comment types, meta serialization, multisite --url context) rather than the tooling.
  • Enablement needs: a short runbook covering --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.

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.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel