Console & CI

redpen/check runs the same rules as the panel, over as much of the site as you point it at, and tells the shell whether it liked what it found.

Pro only. In Lite the command exits with a configuration error.

Usage

php craft redpen/check                                   # everything, summary only
php craft redpen/check --sections=news,blog --verbose     # list every finding
php craft redpen/check --profile=houseStyle --limit=50    # pin a profile, sample the site
php craft redpen/check --fail-on=error                    # exit non-zero if anything is broken
php craft redpen/check --store                            # keep the run as an audit in the CP

Options

OptionAliasNotes
--site-sSite handle to check. Defaults to every site.
--sectionsComma-separated section handles. Defaults to all sections.
--profileProfile handle to apply to everything, instead of per-element resolution.
--limitMaximum entries to check. Useful for sampling a large site.
--fail-on-fExit non-zero if any issue at this severity or worse is found: error, warning or notice.
--verbose-vPrint every finding rather than a summary.
--storeKeep the run as an audit, so it appears in the control panel.

The run happens inline rather than on the queue — a CI job needs the answer before it exits, not a job id.

Exit codes

CodeMeaning
0Finished, and nothing at or above the --fail-on threshold was found. Also the result when --fail-on is omitted.
1Findings at or above the threshold. This is the one your pipeline reacts to.
2Bad usage — an unknown --fail-on value, a section or profile handle that does not exist.
78Configuration problem — most often, running it on Lite.

In a pipeline

The point of --fail-on is that an editorial problem can stop a deploy the same way a failing test does:

# .github/workflows/content.yml
- name: Check content against the style guide
  run: php craft redpen/check --fail-on=error --verbose

Start at --fail-on=error. Since no rule ships at error severity, this fails only on the rules you deliberately promoted — usually the accessibility ones. Tightening to warning on an existing site will fail immediately and loudly; fix the content first, or scope the run with --sections while you work through it.

On a schedule

A nightly run with --store and no --fail-on gives the dashboard widget a trend line without anything ever going red:

0 3 * * * cd /var/www/site && php craft redpen/check --store