Skip to content

cwp bricks audit

shipped 1.0.0
cwp bricks audit [env] [flags]

Acts on the local site unless an environment is named.

ArgumentWhat it isDefault
[env]environment to audit (omit for the local site)
FlagWhat it doesDefault
--scope <scope>narrow the scan (all | orphans | unused | theme-styles | palettes)
--severity <level...>show only these (error, warning, info)
--fastskip the post scan — much faster, and unused findings go absentoff

Plus the shared flags --json, --verbose and --dry-run.

What it does

Says what in the design system is broken, and what can go.

Read-only: no confirmation, no backup, no protected-environment refusal, and it behaves the same against a remote as against the local site.

Three kinds of finding, in Bricks’ own words:

SeverityWhat it means
errorAn orphan reference — elements point at a global class id that no longer exists. Invisible in the builder and on the page.
warningA theme style with no conditions, applying everywhere.
infoAn unused class, variable or colour, and palette fragmentation.

--scope narrows the scan on the server: all, orphans, unused, theme-styles, palettes. --severity filters what is printed and may be repeated.

--fast is a trap with a warning attached. It skips the pass over posts and templates — but “unused” is computed from that pass, so a fast run reports no unused resources on a site where nothing was checked. cwp says so on every --fast run: those findings are absent, not zero.

The exit code stays 0 even with errors. This reports on your site; it does not pass judgement on your command. Gate on the counts in --json if you want a build to fail on orphans.

Example

cwp bricks audit                     # the local site
cwp bricks audit prod                # a remote, unguarded because nothing is written
cwp bricks audit --scope unused      # only the "what can go" half
cwp bricks audit --severity error    # only what is actually broken

What it does not do

It deletes nothing, fixes nothing and touches nothing. It is the answer to a question, and acting on that answer is a separate command you have to type.