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]
scan example
$ 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

FlagDefaultUse
--url <url>config.site.urlOverride the site URL for local, preview, or staging scans.
--config <path>cms-lab.config.tsLoad a specific config file.
--jsonfalsePrint ScanResult JSON to stdout with raw document data, URLs, UIDs, and local project paths redacted.
--include-sensitive-outputfalseInclude raw CMS document payloads and local project paths in --json output.
--cifalseUse stable non-color terminal output for pipelines.
--no-colorfalseDisable 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]falseWrite an HTML report. Default path is .cms-lab/report.html.
--markdown [path]falseWrite a Markdown summary. Default path is .cms-lab/summary.md.
--junit [path]falseWrite a JUnit XML report. Default path is .cms-lab/junit.xml.
--slack-webhook <url>nonePost a compact, redacted summary to a Slack incoming webhook.
--notify-on <mode>failureSlack notification mode: always, failure, or diagnostics.
--type <type>allLimit documents by content type. Repeatable and comma-separated.
--only <group>allRun only selected groups: routes, seo, a11y, images, fields.
--skip <group>noneSkip selected check groups.
--timeout <ms>5000Per-route HTTP timeout.
--concurrency <count>8Maximum concurrent route probes.
--retries <count>1Retry transient route probe failures.
--fail-on <level>errorExit threshold: error, warning, or never.
--max-warnings <count>noneFail when warnings exceed this count.
--max-info <count>noneFail when info diagnostics exceed this count.
--strictfalseFail on any warning or info diagnostic. Equivalent to --fail-on warning --max-info 0.

Exit codes

CodeMeaning
0Scan completed under the fail threshold.
1Scan completed with diagnostics at or above the threshold.
2Config, load, validation, or CLI usage error.
3CMS unreachable or authentication failed.
4Site 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 }
}