trellis ops: the commands you reach for between Trellis deploys.Pull production into development, check traffic after a launch, publish and verify a post.
An add-on for trellis-cli, also usable as
wp-ops and through Claude and other MCP clients.
brew install imagewize/tap/wp-ops # adds `trellis ops` to trellis-cli
trellis ops db-pull example.com productiontrellis-cli provisions and deploys. The work
that happens between deploys — getting a fresh copy of production, checking traffic
after a launch, pushing a post live — is left to you, usually as a string of ssh,
wp db export, rsync and wp search-replace commands. wp-ops turns each of those
into one command, and trellis ops puts them next to trellis deploy and trellis vm.
Sections 1 to 3 are written as trellis ops <command>. The wp-ops <command> form is
identical and also runs outside a Trellis project, for the commands that don't need one.
Not on Trellis? Sections 4 and 5 work on any site. Database backups
(wp-db-backup), malware scans (malware-scan) and admin recovery
(admin-user-create) work on any WordPress host with SSH and WP-CLI, shared hosting
included (--host user@host --path ...). Run wp-ops list --platform wordpress to
see them all.
trellis ops db-pull example.com production # export, download, import, search-replace
trellis ops files-pull example.com production # rsync the uploads directoryThe database is exported on the server, imported into development, and every
production URL is rewritten to your .test domain. Your current development database
is backed up to database_backup/ first, so a pull is never a one-way trip.
db-push and files-push go the other way, and back up the remote first. db-push
rewrites URLs while it exports, so the remote never serves your .test URLs, and puts
the backup straight back if the import fails.
trellis ops quick-status example.com production # status codes, errors, services at a glance
trellis ops traffic-report example.com production # real visitors vs. bots, landing pages, referrals
trellis ops security-scan example.com production # wp-login/xmlrpc abuse, high-volume IPsReads the site's Nginx logs on the server — no analytics plugin, no third-party service. Pair it with the fail2ban setup to block what the scan finds.
trellis ops publish-post draft.html example.com production --image featured.jpg
trellis ops verify-post my-post-slug example.com productionPublishes an HTML draft with block markup (create or --update), uploads the featured
image, then checks that the blocks, JSON-LD and links survived the write and render on
the live page.
wp-ops update-snapshot http://example.test --out=snapshots/before --pages-file=pages.txt
# ...update plugins, theme or core...
wp-ops update-snapshot http://example.test --out=snapshots/after --pages-file=pages.txt
wp-ops update-compare snapshots/before snapshots/after # % changed per page + compare pageOptional, for update rounds. Screenshots the same pages at desktop and mobile before and after an update, then writes a before/after/diff compare page and exits non-zero if any page changed. Pages are scrolled and images decoded before capture, so an unchanged page diffs at 0%, not "1–3%, probably fine". Setup and the full round (local before/after, then production against local): scripts/updates/README.md.
wp-ops checkout-check https://shop.example.com # read-only, safe on production
wp-ops checkout-check http://shop.test --place-order --payment=cod --mailpit=http://shop.test:8025Walks shop, category, product, add to cart, cart and checkout in a real browser and
reports pass, fail or skip per step with timings (cart and checkout skip the page cache,
so they double as an uncached speed number). The cart totals are checked against the
WooCommerce Store API, and block and classic checkouts both work. Exits 2 when a step
fails, so it can run before and after an update round. With --place-order it also
places a marked test order with an offline payment method, checks the confirmation page
and email, and with --cleanup deletes the order again. That mode only runs on local and
staging hosts unless you pass --allow-production. Details:
scripts/README.md.
Every command above is also an MCP tool, so Claude can run it for you. The same operations are exposed as MCP tools —
db_pull, files_pull, monitor, publish_post, verify_post, security_scan and
more — so you can ask "pull production into dev and tell me if anything looks off in
yesterday's traffic" and let the assistant run it. Setup and the full tool list:
mcp-server/README.md.
brew install imagewize/tap/wp-ops
wp-ops init # shell completions (one-time)
wp-ops doctor # check Ansible, WP-CLI, ssh and friendsRun it from your Trellis project (the project root or its trellis/ folder) or point it at one with TRELLIS_DIR. db-push, database-push and files-push always ask before using a project found from the current directory.
Homebrew also installs trellis-ops, a second name for the same binary. trellis-cli
finds any trellis-* program on your PATH and turns it into a subcommand, which is how
every command becomes trellis ops <...>. This needs trellis-cli v1.19.0 or later. See
wp-ops as a trellis-cli plugin.
Build from source instead (Go 1.26+)
git clone https://github.com/imagewize/wp-ops.git && cd wp-ops
go build -o wp-ops ./go
sudo mv wp-ops /usr/local/bin/ # or anywhere on your PATH
wp-ops initThe scripts and playbooks are embedded in the binary — once it's on your PATH you can delete the clone.
brew update && brew upgrade --cask wp-opsThe cask is called wp-ops. trellis-ops is a second binary inside it, not a
package of its own, so brew upgrade trellis-ops fails. Upgrading wp-ops
updates both. A source build upgrades with git pull and the same go build.
Running wp-ops with no arguments opens an interactive picker of every command:
wp-ops search webp # find a command by name or description
wp-ops backup --help # every command in one category
wp-ops list --platform wordpress # only what works on any WordPress site, Trellis or notMore in Using the CLI and the trellis-cli plugin guide.
Beyond the core workflows above, the catalog carries the rest of the toolkit these sites are run with:
| Area | What's there | Docs |
|---|---|---|
| Trellis | Trellis updates by three-way merge, keeping local customizations (trellis-updater; --dry-run first) |
guide |
| Backups | Timestamped database and uploads backups from any environment | → |
| Monitoring | AI-crawler traffic, error surfacing, traffic by country, cron-scheduled reports | → |
| Security | Malware scanners with checksum verification and AbuseIPDB lookups; the posts cover fail2ban and the Nginx deny list | routine · scanners |
| Content & SEO | Page creation, block pattern validation, redirect/schema/orphan-page audits | pages · SEO |
| Nginx | WebP/AVIF serving, browser caching and redirect templates for Trellis nginx-includes/ images · caching · redirects |
|
| Bedrock | Testing unreleased packages via Composer path repos, standard wp-cli.yml |
packages · wp-cli.yml |
| Scripts | Theme sync, PR helpers, emergency admin creation | scripts · admin recovery |
- Core: Git, Bash (macOS's built-in 3.2 is enough), rsync, SSH access to your Trellis servers
- Most Trellis commands: Ansible (already present if you use Trellis)
- Tool-specific: WP-CLI, ImageMagick,
cwebp, Node —wp-ops doctortells you what's missing
Imagewize's projects take their names from The Wheel of Time. wp-ops keeps a plain, descriptive name because it has to be typed, and takes its mark — an original wind rose — from the Windfinders, the Sea Folk channelers who find the wind and bring the ship to port. The reasoning and the alternates considered are in assets/logos/.
MIT License. See LICENSE.md for details.
Copyright © Imagewize

