Run WP-CLI Command
wp_cli_runExecute WP-CLI commands on Local by Flywheel WordPress sites to manage plugins, options, core, and users. Write operations require WPCLI_ALLOW_WRITES=true; eval, eval-file, and shell are blocked.
Instructions
Execute a WP-CLI command against a Local by Flywheel WordPress site. Commands like "plugin list", "option get siteurl", "core version" are always allowed. Write commands require WPCLI_ALLOW_WRITES=true. Commands "eval", "eval-file", and "shell" are blocked for security.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"command": "<command>"
},
"name": "wp_cli_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Additional arguments to pass to the command | |
| site | No | Site name, ID, or domain to target. Uses SITE_NAME/SITE_ID env var if not specified. | |
| format | No | Output format (e.g., "json" for structured data). Only applies to commands that support it (list, get, search). Do not use with write commands like create, update, delete. | |
| command | Yes | WP-CLI subcommand to run (e.g., "plugin list", "option get siteurl", "core version", "user list") |