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.
run a command
Section titled “run a command”You can invoke wp over SSH without holding a session open:
ssh acme-store@ssh.managed.dev "wp plugin list --status=active"Or open a shell and work interactively:
~/acme-store ❯ ssh acme-store@ssh.managed.dev acme-store ❯ wp plugin list –status=active –field=name woocommerce wordpress-seo ✓ 2 active plugins
targeting branch vs production
Section titled “targeting branch vs production”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.
ssh acme-store@ssh.managed.dev "wp cache flush"ssh acme-store+feature-checkout@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.
worked examples
Section titled “worked examples”wp plugin list --fields=name,status,version,updatewp search-replace 'staging.example.com' 'example.com' --dry-run --all-tablesDrop the --dry-run once the report looks right.
wp db export - | gzip > acme-store-$(date +%F).sql.gzStreaming to stdout (-) lets you pipe the dump straight off the gateway to your
machine in a single command.
wp cron event listwp cron event run woocommerce_scheduled_subscription_paymentswp transient delete --allwp rewrite flusha .forge-term session, end to end
Section titled “a .forge-term session, end to end”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:
~ ❯ 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
common recipes
Section titled “common recipes”| 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 |