User guide · Check

Check your install

stet ships four checks, and three of them run with no network and no database — so they work in CI, on a fork PR with every secret unset, and on a laptop that's offline. Wiring these into CI is one line each — and audit --strict fails the build on drift.

All four take --json when a machine is reading.

01The health check

doctor reports the project's mode, its health, and what is actually serving production. --report prints the full picture.

$ npx stet doctor
descriptor: content/descriptor.json, 11 keys
snapshot: 11 keys declared, 0 missing, 0 stale
values: 11 checked
store: snapshot-only — publish = commit; no database is required or expected

02The committed files

check verifies the descriptor, the snapshot and the generated files agree — offline, no store touched.

$ npx stet check
snapshot: 11 keys declared, 0 missing, 0 stale
generated: content/keys.ts current
generated: content/defaults.ts current
values: 11 checked

03The SEO rules

seo check runs the offline SEO rules over your descriptor and snapshot. It reads two files and opens no connection, so it runs anywhere.

The rules run over the pages you've declared. stet pages scan reads them from your routing convention and proposes the records — --apply declares them and scaffolds their title and description keys, which stay red in seo check until you write the values. A page with no title fails the check, and so does a page with no description. Markdown pages start with the title from their frontmatter.

$ npx stet pages scan --apply
home (/)
  seo: seo_home_title, seo_home_desc — scaffolded empty
declared 1 page(s), scaffolded 2 key(s); next: stet seo check
$ npx stet seo check
error: page "home": its description key "seo_home_desc" resolves to nothing — publish a value or point the reference elsewhere
… write the two values, then:
$ npx stet seo check
seo: 1 pages checked, 0 errors, 0 warnings

04Store drift

audit compares the descriptor against the store: keys registered but not yet editable, rows the code no longer references, drifted targets. It reports and never deletes; --strict exits 1 on any finding.

$ npx stet audit --strict

05Run it on every commit

One command installs a pre-commit hook that runs the same checks before anything lands: check blocks the commit on a broken registry, and scan warns about unkeyed copy without blocking. Set scan.severity: "fail" in stet.config.json if you want the strict gate. On a plain HTML site, the gate also stops a commit where someone edited a marked element by hand. stet hook remove takes a checkout out of the gate, and eject removes the hook with everything else.

$ npx stet hook install