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

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

Manage WordPress comments, menus, options, posts, sites, terms, and users.

Frequently asked questions about Entity Command
How do I install wp-cli/entity-command with Composer?
Install it as a WP-CLI package inside the WordPress environment, typically with composer require wp-cli/entity-command, or add it to the WP-CLI packages directory so the wp command loads it automatically. It requires a working WP-CLI installation and a bootstrapped WordPress site, because the commands rely on WordPress core internals such as WP_Comment_Query and WP_User_Query. It is not a standalone Laravel library and will not function outside a WordPress codebase.
Can I use wp-cli/entity-command in a Laravel application?
Not natively. The package is built on WP-CLI and WordPress core APIs, so it needs a WordPress installation to bootstrap. A Laravel app can only use it indirectly, for example by shelling out to wp on a WordPress host or by exposing those operations through the WordPress REST API and consuming them with Laravel's HTTP client. Budget for an integration layer either way.
How do I call WP-CLI entity commands from an Artisan command?
The common proof-of-concept is running wp comment list --format=json through shell_exec or the Symfony Process component inside an Artisan command, then decoding the JSON. Always use Process with escaped arguments rather than string concatenation, because unescaped user input creates a command injection risk. This approach is fragile in production and is best confined to migration scripts or developer tooling.
Which WordPress entities does this package let me manage?
It provides the wp comment, wp menu, wp option, wp post, wp site, wp term, and wp user command groups. Each group supports create, update, delete, list, and get style operations where applicable, plus related metadata subcommands. Comments also support moderation actions such as trash, spam, and approve.
Does it support custom fields and post meta?
Yes. The post, user, term, and comment command groups include meta subcommands for adding, updating, deleting, and listing metadata, and the post commands accept custom fields. This makes it practical to script bulk metadata changes or seed content in CI environments. Values are passed as positional arguments or flags, so quoting matters when content contains spaces.
What is the block notes feature in wp comment?
On WordPress 6.9 and later, comments can be created with --comment_type=note to attach editorial notes to a specific block or post. You can list notes with wp comment list --type=note --post_id=15, reply to a note via --comment_parent, and mark it resolved by adding _wp_note_status metadata through wp comment meta add. On older WordPress versions these flags will not behave as expected, so check the core version first.
Which Laravel and WordPress versions is this compatible with?
The package targets WordPress and WP-CLI, not Laravel, so there is no Laravel version constraint to satisfy. Some features, such as block notes, require recent WordPress core releases, and the package tracks WP-CLI's own PHP and WordPress support matrix. Laravel compatibility is entirely determined by whatever bridge you build, such as an HTTP client or a queued job calling a WordPress endpoint.
How do I run entity commands against a multisite network?
WP-CLI supports the --url and --site flags to target a specific site within a multisite install, and the wp site command group manages the network's sites directly. You can also use --network or iterate over site IDs in a shell loop for bulk operations. In a Laravel integration, pass the target URL explicitly per invocation rather than relying on ambient configuration.
Is shelling out to wp from Laravel safe in production?
It carries real risk. Command injection, missing WordPress bootstrap, filesystem permissions, and opaque error handling are the usual failure modes, and shell_exec bypasses Laravel's process supervision and logging. Prefer the WordPress REST API behind authentication, or a dedicated service, when the operation must run in production. Reserve direct CLI calls for migrations, seeding, and one-off admin tasks.
What are the alternatives and how is the package maintained?
Alternatives include the WordPress REST API (wp-json/wp/v2), direct PDO access to WordPress tables, or a custom WP-CLI command of your own. The package is maintained under the wp-cli organization with CI testing and code coverage reported on GitHub Actions, and it ships as part of the standard WP-CLI bundle. Because it tracks WordPress core changes, pin versions and retest after WordPress upgrades.
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.
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
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels