Documentation menu

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"
  • --user is the administrator running the command. --agent is the agent whose policy applies.
  • Supported commands run as their matching ability. For example, post list runs as agentwarden/list-posts, and post update as agentwarden/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.