Site CLI
A Récit site (its pages, its recit. and its styles.css) is run and built by the
recit-site command. It reads the site of the current folder. The recit command of @recit/cli
works on stories: its reference is the CLI page.
Bash
Every command accepts --help, which lists its options, and --version. A boolean option whose
default is on is turned off by its --no- form (--no-ssr).
recit-site dev
Runs the site on a local server, renders the pages on request and reloads them on every change of a page, of the config or of a story.
| Option | Default | What it does |
|---|---|---|
--port | port of the config, or 3000 | The port of the local server; a busy port moves to the next free one and says so. |
--open | off | Opens the browser on the site once the server listens. |
--ssr | on | Renders each page on the server; --no-ssr serves the client application alone. |
recit-site build
Builds the static site in dist/ (.vercel/ on Vercel): one HTML page per page, its
assets, the search index and the sitemap.
| Option | Default | What it does |
|---|---|---|
--preview | off | Serves the build once it is written, as recit- does; --preview 4100 picks the port (4000 otherwise). |
--strict | off | Fails the build on a recoverable problem of the config (a folder directory that does not exist) instead of a warning. |
--pdf | off | Then exports the site's PDFs into the build (recit export --); needs @recit/cli and Chromium, and does not apply to --experimental-. |
--pdf-store | on | Copies the prebuilt PDF store (recit-pdf/) into the build; --no- leaves it out. See Prebuilt PDFs. |
--strict-pdf | off | Fails when a PDF of the prebuilt store is older than its sources, instead of a warning. |
--experimental- | off | Builds for rendering on a server instead of static pages (experimental). |
--adapter | node | With --experimental-, the server the build targets: node, cloudflare, vercel or lambda. |
recit-site preview
Serves dist/ on a local server as a host would: the 404.html page with the status 404 for an
unknown address, the security headers and the trailingSlash redirect of the config.
| Option | Default | What it does |
|---|---|---|
--port | 4000 | The port of the local server. |
recit-site check
Reads the built site and reports every broken link, missing anchor and missing data file, and the
axe violations with --a11y; it exits with the code 1 on a problem. The whole guide is
Check a built site.
| Option | Default | What it does |
|---|---|---|
--out | dist/, or .vercel/ | The build folder to read. |
--base-path | basePath of the config | The site's basePath, stripped from root addresses (/docs). |
--links | on | Checks that every page, asset and data file pointed to exists; --no-links skips. |
--anchors | on | Checks that every #fragment names an id of its page; --no-anchors skips. |
--a11y | off | Runs axe on every page; Playwright and axe-core must be installed in the site. |
--json | off | Prints the report as JSON on the standard output. |
recit-site hash-password
Asks for a password and prints the hash to write in access., so that the password itself
never sits in the config. The whole guide is Password.
| Option | Default | What it does |
|---|---|---|
--salt | a salt drawn at random | Prints the older form sha256:<hex>, salted by this value (set access.salt to it); without it the salt is written in the hash. |