User guide · Check

Check your install

stet ships five checks, and four of them need 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 five 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 reads your pages and checks what search engines and screen readers need: a title and a description on every page, alt text on every image, a label on every form field and a language on the page. It opens no connection, so it runs anywhere.

The rules run over the pages you've declared. stet pages scan --apply finds them from your routing or your HTML files and links each one to its title and description keys.

$ npx stet pages scan --apply
home (/)
  title: bound to home_page_title
declared 1 page, bound 1 field

$ npx stet seo check
seo: 1 pages checked, 1 errors, 0 warnings
error: page "home" declares no SEO description

04Score your pages

audit lighthouse runs Google Lighthouse on your pages and prints the four scores. Each failing audit says who fixes it: copy is words you write, fix is an edit stet makes for you, and host is your own code or hosting.

A plain HTML site is audited straight from your files. For a JavaScript site, add --build to build and serve it, or --url to audit a running one.

$ npx stet audit lighthouse
index.html  Performance 100 · Accessibility 77
            Best Practices 92 · SEO 82
  fix   index.html has no lang
  fix   index.html has no doctype
  copy  <img src="dock.png"> has no alt
  copy  index.html has no description
  host  /favicon.ico answered 404

1 page · 5 failing audits · stet fixes 4 · the host owns 1

05Apply the fixes

--fix lists the edits stet would make to each page's head, and --fix --write makes them and runs the audit again. Set language in stet.config.json first, so every page gets its lang.

What's left is words: the description and the alt text. Write them in the dashboard or in content/defaults.json, then run the audit once more.

$ npx stet audit lighthouse --fix --write
index.html: 5 edits applied
  the head, after:
+ <!DOCTYPE html>
+ <html lang="en">
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="description" data-stet-content="home_meta_description">

… write the description and the alt text, then:
$ npx stet audit lighthouse
index.html  Performance 100 · Accessibility 100
            Best Practices 100 · SEO 100

06Store 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

07Run 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, seo check blocks it on a missing title, description or label, 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