Skip to content
imagewizePublic

About

Pull production into dev in one command, see who is hitting your server, and publish posts — for Trellis WordPress sites. CLI, trellis-cli plugin and MCP server.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

wp-ops wind rose logo

WP OPS

Homebrew Downloads Latest Release License

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 production

What it solves

trellis-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.

1. Get production into development in one step

trellis ops db-pull example.com production      # export, download, import, search-replace
trellis ops files-pull example.com production      # rsync the uploads directory

The 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 db-pull run from a Trellis project: the multisite production database of demo.imagewize.com is backed up, downloaded, verified and imported into development, with URL search-replace and network domains fixed

2. See who is hitting your server

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 IPs

Reads 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.

3. Publish and verify content without opening wp-admin

trellis ops publish-post draft.html example.com production --image featured.jpg
trellis ops verify-post my-post-slug example.com production

Publishes 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.

4. See what an update changed

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 page

Optional, 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.

5. Check that buying still works

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:8025

Walks 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.

6. Hand all of it to Claude

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.

Install

brew install imagewize/tap/wp-ops
wp-ops init      # shell completions (one-time)
wp-ops doctor    # check Ansible, WP-CLI, ssh and friends

Run 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 init

The scripts and playbooks are embedded in the binary — once it's on your PATH you can delete the clone.

Upgrading

brew update && brew upgrade --cask wp-ops

The 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.

Finding your way around

Running wp-ops with no arguments opens an interactive picker of every command:

The wp-ops interactive picker: categories with command counts, descriptions and a trellis/wp/any platform breakdown

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 not

More in Using the CLI and the trellis-cli plugin guide.

Also in the box

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

Requirements

  • 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 doctor tells you what's missing

Wheel of Time Inspiration

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/.

License

MIT License. See LICENSE.md for details.


Copyright © Imagewize

About

Pull production into dev in one command, see who is hitting your server, and publish posts — for Trellis WordPress sites. CLI, trellis-cli plugin and MCP server.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages