Run agents through WP-CLI
Automation that already uses WP-CLI can run commands as an agent, under its policy:
sh
wp agentwarden run --agent=3 --user=admin -- post update 42 --post_title="New title"
--useris the administrator running the command.--agentis the agent whose policy applies.- Supported commands run as their matching ability. For example,
post listruns asagentwarden/list-posts, andpost updateasagentwarden/update-post. Every other command is refused. - Every run is logged in Activity like an MCP or REST call, and can be undone.
A command only runs if WP-CLI is ticked under Client types when the agent is created. All three client types are ticked by default.
Other administration commands (agents, policy, log, undo, pause-all, and more) are listed in the WP-CLI reference.