Skip to content

WP-CLI

WP-CLI is available on every plan, against every environment, through the SSH gateway. It’s the upstream wp you already know — there’s no managed.dev-specific dialect to learn and nothing to install on the server. You connect to an environment and run wp exactly as you would anywhere else, with the session scoped to that environment’s isolated database and files.

This page assumes you’ve added an SSH key. If you only need a quick command, run it inline; for a sequence of commands, open an interactive shell.

You can invoke wp over SSH without holding a session open:

Inline against production
ssh acme-store@ssh.managed.dev "wp plugin list --status=active"

Or open a shell and work interactively:

acme-store — wp-cli
~/acme-store ❯ ssh acme-store@ssh.managed.dev
acme-store ❯ wp plugin list –status=active –field=name
woocommerce
wordpress-seo
✓ 2 active plugins

The environment is chosen at connection time by qualifying the username — there’s no --url gymnastics and no risk of running against the wrong database, because each environment is fully isolated.

Production
ssh acme-store@ssh.managed.dev "wp cache flush"

The suffix after + is the branch route name with slashes normalised to dashes, so feature/checkout becomes feature-checkout. See preview environments for how a pushed branch becomes an addressable environment in the first place.

Inventory plugins and their update state
wp plugin list --fields=name,status,version,update
Preview a domain swap without changing anything
wp search-replace 'staging.example.com' 'example.com' --dry-run --all-tables

Drop the --dry-run once the report looks right.

Export the database for a local copy
wp db export - | gzip > acme-store-$(date +%F).sql.gz

Streaming to stdout (-) lets you pipe the dump straight off the gateway to your machine in a single command.

Run a stuck WP-Cron event by hand
wp cron event list
wp cron event run woocommerce_scheduled_subscription_payments
Regenerate the search index after a content import
wp transient delete --all
wp rewrite flush

A typical “fix it on a branch, then promote” loop looks like this — work on the preview, verify, and let git deploy carry it to production:

acme-store — search-replace on a preview
~ ❯ ssh acme-store+feature-rebrand@ssh.managed.dev
acme-store ❯ wp search-replace ‘Old Brand’ ‘New Brand’ –dry-run
+————+–––––––+–––––––+——+
| Table      | Column       | Replacements | Type |
+————+–––––––+–––––––+——+
| wp_posts   | post_content | 34           | PHP  |
+————+–––––––+–––––––+——+
acme-store ❯ wp search-replace ‘Old Brand’ ‘New Brand’
✓ Made 34 replacements.acme-store ❯ wp cache flush
✓ The cache was flushed.https://acme-store-feature-rebrand-a1b2c3.preview.managed.dev
Goal Command
List users with roles wp user list --fields=ID,user_login,roles
Reset a password wp user update admin --user_pass='…'
Check core / plugin versions wp core version · wp plugin list
Activate a plugin wp plugin activate woocommerce
Inspect an option wp option get blogname
Flush rewrite rules wp rewrite flush
Clear all caches wp cache flush