cms-lab scan
Fetch CMS documents, resolve configured routes, probe your running site, run content checks, and return a CI-friendly exit code.
Run a scan
This is the basic command. Add flags when you need JSON, a local HTML report, stricter CI behavior, or a different config file.
npx @cms-lab/cli scan [options]
$ npx @cms-lab/cli scan --ci --only routes,fields cms-lab project next app documents 6 info CMS-ROUTE-UNMAPPED - Document settings has no configured route mapping summary errors 0 warnings 0 info 2 scan passed
Flags
| Flag | Default | Use |
|---|---|---|
--url <url> | config.site.url | Override the site URL for local, preview, or staging scans. |
--config <path> | cms-lab.config.ts | Load a specific config file. |
--json | false | Print ScanResult JSON to stdout with raw document data, URLs, UIDs, and local project paths redacted. |
--include-sensitive-output | false | Include raw CMS document payloads and local project paths in --json output. |
--ci | false | Use stable non-color terminal output for pipelines. |
--no-color | false | Disable ANSI color in terminal output. Color is also disabled when NO_COLOR is set, TERM=dumb, stdout is not a terminal, or --ci is used. |
--report [path] | false | Write an HTML report. Default path is .cms-lab/report.html. |
--markdown [path] | false | Write a Markdown summary. Default path is .cms-lab/summary.md. |
--junit [path] | false | Write a JUnit XML report. Default path is .cms-lab/junit.xml. |
--slack-webhook <url> | none | Post a compact, redacted summary to a Slack incoming webhook. |
--notify-on <mode> | failure | Slack notification mode: always, failure, or diagnostics. |
--type <type> | all | Limit documents by content type. Repeatable and comma-separated. |
--only <group> | all | Run only selected groups: routes, seo, a11y, images, fields. |
--skip <group> | none | Skip selected check groups. |
--timeout <ms> | 5000 | Per-route HTTP timeout. |
--concurrency <count> | 8 | Maximum concurrent route probes. |
--retries <count> | 1 | Retry transient route probe failures. |
--fail-on <level> | error | Exit threshold: error, warning, or never. |
--max-warnings <count> | none | Fail when warnings exceed this count. |
--max-info <count> | none | Fail when info diagnostics exceed this count. |
--strict | false | Fail on any warning or info diagnostic. Equivalent to --fail-on warning --max-info 0. |
Exit codes
| Code | Meaning |
|---|---|
0 | Scan completed under the fail threshold. |
1 | Scan completed with diagnostics at or above the threshold. |
2 | Config, load, validation, or CLI usage error. |
3 | CMS unreachable or authentication failed. |
4 | Site URL unreachable. |
JSON
Use --json for custom scripts or annotations. Raw document payloads, URLs, UIDs, and local project paths are redacted by default, and HTML, Markdown, JUnit, or Slack outputs can be produced at the same time without changing stdout.
Slack webhook messages are intentionally smaller than local files: they include counts and diagnostic codes, not raw CMS payloads, local paths, webhook URLs, or full diagnostic JSON.
{
"project": {
"framework": "next",
"router": "app",
"rootDir": "[redacted: pass --include-sensitive-output to emit raw project paths]"
},
"documents": [
{
"id": "Yabc",
"type": "page",
"status": "published",
"data": "[redacted: pass --include-sensitive-output to emit raw CMS data]"
}
],
"diagnostics": [
{
"severity": "error",
"code": "CMS-ROUTE-404",
"message": "Route /about returned 404",
"path": "/about",
"source": "prismic:page#Yabc"
}
],
"summary": { "errors": 1, "warnings": 0, "info": 0 }
}