Operations

WP-CLI commands

All commands are under wp keep-it-peace. Their output is always in English so that scripts can parse it.

CommandDescription
wp keep-it-peace scan [--checks=<ids>] [--no-notify] [--format=table|json]Runs a scan to completion (continues a running scan if there is one). --checks: comma-separated check IDs. --no-notify: no notifications for this scan.
wp keep-it-peace status [--format=json]Open issues by severity and the last completed scan.
wp keep-it-peace findings [--status=open] [--severity=high] [--category=…] [--check=…] [--fields=…] [--format=…]Lists findings. --status: new, acknowledged, ignored, resolved, open (default) or all. --severity: minimum severity. --format: table, csv, json, yaml, count or ids.
wp keep-it-peace export [--scan=<id>] [--pretty]The scan result as JSON (by default the latest completed scan).
wp keep-it-peace baseline approve (--scope=<scope> | --all) [--yes]Approves the current files as the baseline, using the state recorded by the last scan.
wp keep-it-peace checksLists the checks and their IDs.
wp keep-it-peace targetsLists the scan targets and their scopes.

Examples

# From the server cron (no output unless something fails)
wp keep-it-peace scan --quiet

# Only the external checks, without e-mail
wp keep-it-peace scan --checks=external.tls,external.headers --no-notify

# After a deployment
wp keep-it-peace scan --no-notify && wp keep-it-peace baseline approve --all --yes

# High and critical findings
wp keep-it-peace findings --severity=high

# Dependency findings as JSON
wp keep-it-peace findings --category=dependency --format=json

# Report of the latest scan
wp keep-it-peace export --pretty > report.json

The report contains file paths and URLs of your site. Store it safely.