If you work with WordPress locally, WP-CLI is usually the next tool you reach for. WP Staging CLI has you covered: the wp command runs any WP-CLI command inside the PHP container of one of your local sites and prints the result in your terminal.
Basic Usage
Put wpstaging wp in front of the command, and name the site first:
wpstaging wp mysite.local plugin list
wpstaging wp mysite.local option get siteurlYou do not install WP-CLI in the container or call docker exec yourself — WP Staging CLI runs it with the right user, path, and WordPress installation.
Query the Database
wpstaging wp mysite.local db query "SELECT COUNT(*) FROM wp_posts"Target a Multisite Subsite
For networks, pass the subsite URL with WP-CLI’s --url flag:
wpstaging wp mynetwork.local --url=blog.mynetwork.local plugin listUse It in Scripts
WP-CLI’s --format=json and WP Staging CLI’s own --json both parse cleanly, so a few lines of shell give you an inventory of every local site:
for site in $(wpstaging list --json | jq -r ".sites[].hostname"); do
echo "$site: $(wpstaging wp $site core version)"
doneWith a custom --env-path, point the command at environments stored outside the default folder:
wpstaging wp --env-path /custom/path mysite.local core versionRequirements
- A registered WP Staging CLI license (Developer or Agency).
- The site exists and its containers are running — start them with
wpstaging start mysite.local.
Next Steps
- Switch PHP and WordPress Versions – switch versions and check what runs where
- Automate WP Staging CLI With JSON Output – machine-readable CLI output