Automate WP Staging CLI With JSON Output

WP Staging CLI is built to be driven by other programs. Add --json and a command answers with stable, machine-readable data instead of terminal text — the same data powers the WP Staging Desktop app.

JSON Everywhere

wpstaging list --json
wpstaging status mysite.local --json

The site list carries everything a script needs: hostnames, status, PHP and WordPress versions, container names, the WordPress path inside the container, and a fresh magic login link per site.

Paginate Large Lists

Long lists are paginated so a parser never chokes. The default page holds 100 items:

wpstaging list --json --page=2 --page-size=25

See More With JSON

  • wpstaging sync-status --json reports the file-sync state of a fast-mode site.
  • The update notice in JSON output carries the current and latest version as separate fields.
  • wpstaging list --filter=shop --filter=status:stopped narrows output by any repeated search term — and works with --json.

Deterministic Sites for CI and AI Agents

Because add takes a version and a backup URL, a pipeline — or an AI coding agent — can create an identical local copy of a client site, work in it, and throw it away:

wpstaging add agent-run-a.local --from=https://example.com/backup.wpstg --php=8.3
wpstaging add agent-run-b.local --from=https://example.com/backup.wpstg --php=8.3
wpstaging wp agent-run-a.local plugin list --format=json

Commands exit non-zero on failure, so a script or pipeline notices a broken restore instead of continuing quietly.

Next Steps

Updated on October 29, 2026

Rene Hermenau

Author: Rene Hermenau

About the author: René Hermenau is the founder of WP STAGING. He works on WordPress backups, staging, migrations, database handling, and safe deployment workflows.