# @cms-lab/cli

> Catch CMS bugs before deploy.

Latest version **1.2.6** (published 2026-05-26) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @cms-lab/cli
pnpm add @cms-lab/cli
yarn add @cms-lab/cli
bun add @cms-lab/cli
```

Provides the command `cms-lab`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.2.6 |
| Published | 2026-05-26 |
| First published | 2026-05-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=20.10 |
| Dependencies | 11 |
| Unpacked size | 65.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| Author | Afaq Rashid |
| Maintainers | afaqrashid |
| Keywords | cms, contentful, nextjs, prismic, sanity, strapi, directus, wordpress, cli, testing |

## Links

- npm: https://www.npmjs.com/package/@cms-lab/cli
- Repository: https://github.com/i-afaqrashid/cms-lab
- Homepage: https://cmslab.afaqrashid.com
- Issues: https://github.com/i-afaqrashid/cms-lab/issues
- npm.io page: https://npm.io/package/@cms-lab/cli

## Dependencies (11)

- [commander](https://npm.io/package/commander.md) ^14.0.2
- [picocolors](https://npm.io/package/picocolors.md) ^1.1.1
- [@cms-lab/core](https://npm.io/package/@cms-lab/core.md) 1.2.6
- [@cms-lab/next](https://npm.io/package/@cms-lab/next.md) 1.2.6
- [@cms-lab/sanity](https://npm.io/package/@cms-lab/sanity.md) 1.2.6
- [@cms-lab/strapi](https://npm.io/package/@cms-lab/strapi.md) 1.2.6
- [@cms-lab/prismic](https://npm.io/package/@cms-lab/prismic.md) 1.2.6
- [@cms-lab/directus](https://npm.io/package/@cms-lab/directus.md) 1.2.6
- [@cms-lab/reporter](https://npm.io/package/@cms-lab/reporter.md) 1.2.6
- [@cms-lab/wordpress](https://npm.io/package/@cms-lab/wordpress.md) 1.2.6
- [@cms-lab/contentful](https://npm.io/package/@cms-lab/contentful.md) 1.2.6

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.2.6 (latest) — 2026-05-26
- 1.2.5 — 2026-05-26
- 1.2.4 — 2026-05-26
- 1.2.3 — 2026-05-26
- 1.2.2 — 2026-05-26
- 1.2.1 — 2026-05-26
- 1.2.0 — 2026-05-26
- 1.1.0 — 2026-05-26
- 1.0.10 — 2026-05-26
- 1.0.9 — 2026-05-25
- 1.0.8 — 2026-05-25
- 1.0.6 — 2026-05-25
- 1.0.5 — 2026-05-25
- 1.0.4 — 2026-05-24
- 1.0.3 — 2026-05-24
- … 1 more at https://npm.io/package/@cms-lab/cli/versions

## README

# cms-lab

CLI for catching CMS-driven Next.js failures before deploy.

```sh
npx @cms-lab/cli scan
```

## Commands

```sh
cms-lab init
cms-lab init --cms strapi --router pages
cms-lab init --cms directus --router pages
cms-lab doctor
cms-lab doctor --debug --verbose 2
cms-lab scan --report
cms-lab scan --report --share-report
cms-lab scan --markdown
cms-lab scan --junit
cms-lab scan --slack-webhook "$CMS_LAB_SLACK_WEBHOOK"
cms-lab scan --debug
cms-lab scan --json
cms-lab scan --json --include-sensitive-output
cms-lab scan --max-warnings 0
cms-lab scan --strict
cms-lab agent-context
cms-lab agent-context --mode cms-only
cms-lab agent-context --preset all
cms-lab agent-context --preset claude
cms-lab agent-context --preset gemini
cms-lab agent-context --preset copilot
cms-lab agent-context --force
cms-lab explain CMS-ROUTE-404
```

## Scope

cms-lab supports Next.js App Router and Pages Router projects using Prismic,
Strapi, Directus, WordPress, Contentful, and Sanity. It validates configured CMS
route mappings, route reachability, UID gaps, SEO metadata, image alt text, and
project-specific required fields and relationship minimums.

`cms-lab init --cms strapi --router pages` writes a Strapi starter config with
collections, single types, route examples, and the Strapi relation route helper.
`cms-lab init --cms directus --router pages` writes a Directus starter config
with branch, menu item, category, and non-routable pricing collection examples.
Use `site.healthPath` or `site.healthUrl` in config when the app root is not the
right page for the initial health probe.

Debug logs use stderr and support `--debug` plus `--verbose <0|1|2|3>`, so JSON
scan output remains clean on stdout. Raw CMS document `data` is redacted from
`--json` output, along with document URLs, UIDs, and absolute project paths,
unless `--include-sensitive-output` is passed explicitly.

CI strictness can be raised with `--fail-on warning`, `--max-warnings <count>`,
`--max-info <count>`, or `--strict`.

Exports include local HTML (`--report`), share-safe local HTML
(`--report --share-report`), Markdown (`--markdown`), JUnit XML (`--junit`),
and redacted Slack incoming webhook summaries (`--slack-webhook <url>`).
Terminal, JSON, Markdown, and HTML outputs include repeated-finding summaries
when many documents hit the same content type/template issue.
Share-safe HTML redacts CMS source IDs and local project paths while keeping
diagnostic codes, severity, route paths, and field paths visible. Slack
notifications send counts and diagnostic codes only, never raw CMS payloads,
local paths, or webhook URLs.

`cms-lab agent-context` writes safe handoff files so coding agents can read the
cms-lab docs, package links, route mappings, and safe project facts before
attempting fixes. The default preset writes `AGENTS.md` plus shared files in
`.cms-lab/`. Tool-specific presets can write `CLAUDE.md`, `GEMINI.md`, Copilot
instructions, and a reusable Copilot prompt. Existing files are not overwritten
unless `--force` is passed. Use `--mode cms-only` in backend-only CMS projects;
the generated context will state that no frontend was detected and that route
scans need a running app.

## Config

Create `cms-lab.config.ts` in the target Next.js project. Import
`defineConfig` from `@cms-lab/core`.

See the repository README for full setup, CI, and live Prismic testing.

## Release History

See the repository [changelog](https://github.com/i-afaqrashid/cms-lab/blob/main/CHANGELOG.md)
and [GitHub Releases](https://github.com/i-afaqrashid/cms-lab/releases) for
version-by-version notes.

## Open Source

MIT licensed. See the repository [license](https://github.com/i-afaqrashid/cms-lab/blob/main/LICENSE), [contributing guide](https://github.com/i-afaqrashid/cms-lab/blob/main/CONTRIBUTING.md), and [support guide](https://github.com/i-afaqrashid/cms-lab/blob/main/SUPPORT.md).

---
_Source: https://npm.io/package/@cms-lab/cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
