FleetWP is live. Read the launch announcement
FleetWP Docs
Developers

CLI

Manage your WordPress fleet from the terminal or CI with the zero-dependency fleetwp CLI.

@fleetwp/cli is a zero-dependency Node CLI (Node 18+) that wraps the REST API.

Install

npm install -g @fleetwp/cli

Or run it directly without installing:

npx @fleetwp/cli sites list

Configure

Set two environment variables:

export FLEETWP_URL="https://app.fleetwp.io"   # optional, this is the default
export FLEETWP_TOKEN="fwp_your_token_here"

Commands

fleetwp <command> [args] [--json]

  sites list                       List all sites
  sites get <site>                 Show one site
  sites rename <site> "<name>"     Rename a site
  sites features <site> [--enable a,b] [--disable c]   Show or turn features on/off
  backup list <site>               List a site's backups
  backup create <site> [--type full|db|files]
  backup cancel <site> <backup-id> Stop a queued or running backup
  backup schedule <site> [--schedule off|daily|weekly] [--hour N] [--timezone TZ] [--keep N]
                                   Show or set automatic backups
  restore <site> <backup-id> [--location X]   Restore a backup (destructive)
  update <site> [--plugins a,b] [--themes x,y] [--core]
                                   Update plugins (names or files, e.g. akismet
                                   or akismet/akismet.php), themes and/or core
  update <site> --pending          Update everything that has an update
  versions <site> <plugin>         WordPress.org versions a plugin can roll back to
  rollback <site> <plugin> <version> [--backup-first]   Install an earlier version
  plugins <site> activate|deactivate|install <a,b>
  themes <site> install <a,b> | activate <theme>
  lock <site> <plugin> [--theme] [--reason T]   Hold an item at its version
                                   (unlock in the FleetWP dashboard)
  login <site>                     Print a one-click admin login URL
  inventory <site>                 Live plugin/theme/core list + updates
  security [site]                  Open findings (omit site for whole fleet)
  scan <site> security|performance|links|updates|domain|server|database   Run a fresh scan
  connector update <site>          Install the latest FleetWP connector
  visual list <site> [--limit N]   Recent visual checks (screenshots before/after updates)
  visual show <site> <check-id> [--links]   One check's pages and what changed
  server <site>                    Server health: disk, PHP, OPcache, scheduled tasks, caching
  database <site>                  Database health: size, largest tables, autoload, clutter
  database clean <site> --categories a,b [--keep N] [--no-backup]   Clean up database clutter
  reports list <site> [--kind K]   Saved reports and their schedules
  reports create <site> site|security|performance [--days 7|30|90]
  reports schedule <site> <kind> [--schedule S] [--hour N] [--day N] [--month N] [--timezone TZ]
  ignore <site> errors <key> | links <url> | security "<title>" | domain <check>
                                   Stop scans, reports and alerts raising a known issue
  unignore <site> <kind> <item>    Bring an ignored issue back
  ignore list <site> <kind>        What's ignored (kinds: errors, links, security, domain)
  domain [site]                    Domain, SSL and email health
  tweaks <site>                    Security hardening fixes (list current state)
  tweaks <site> --apply a,b [--revert c]   Apply/revert hardening fixes
  performance <site>               Latest performance sample + trend
  uptime <site> [--limit N]        Recent uptime checks
  errors <site> [--limit N]        Deduped PHP error log
  links <site>                     Currently-broken links
  jobs list [--site X] [--status Y] [--limit N]  Recent async operations
  jobs get <job-id>                Poll one operation to completion
  activity [--limit N] [--site X]  Recent activity (workspace, or one site)
  log <site> "<summary>" [--notes T] [--category C] [--at ISO] [--by NAME] [--internal]
                                   Log maintenance done outside FleetWP

<site> can be the full site id, the short id sites list prints, or the site's exact name. Short backup and job ids work the same way, and so does the short error key errors prints.

Many sites at once

backup create, update, scan and connector update take --all (every connected site) or --sites a,b instead of a single site. Sites run one at a time and each is reported as it finishes; one failing doesn't stop the rest, and the command exits with code 1 if any site failed.

Scans and reports are limited per site over the API (each scan type once every 5 to 15 minutes, each report kind once every 10). A repeat inside that window is refused with how long to wait; in a batch run that site is skipped, not counted as a failure.

fleetwp update --all --pending              # every update on every site
fleetwp update --sites shop,blog --plugins woocommerce
fleetwp scan --all security
fleetwp connector update --all

Add --json to any command for machine-readable output, handy in CI. Writes made with an approval-only agent's token are queued for approval rather than run, and the CLI says so. fleetwp --version prints the installed version.

Examples

# List sites as a table
fleetwp sites list

# Back up every site (nightly cron job)
fleetwp backup create --all

# Update only two plugins on one site
fleetwp update 1a2b3c --plugins akismet,woocommerce

# Update a theme and WordPress core too
fleetwp update 1a2b3c --themes twentytwentyfive --core

# Find a good version, then roll a plugin back (backing up first)
fleetwp versions 1a2b3c woocommerce
fleetwp rollback 1a2b3c woocommerce 9.4.0 --backup-first

# Run a fresh security scan and wait on its job
fleetwp scan 1a2b3c security

# Save this month's client report and print its link
fleetwp reports create 1a2b3c site --days 30

# Stop alerting on a finding the client has accepted
fleetwp ignore 1a2b3c security "Default \"wp_\" database table prefix"

# Get a login URL as JSON
fleetwp login 1a2b3c --json

# Record work done by hand so it shows in the client report
fleetwp log 1a2b3c "Replaced the contact form and tested delivery" --category fix

Batch commands (--all, --sites) catch per-site errors so one failing site doesn't abort the run.

On this page