Skip to content

Site CLI

A Récit site (its pages, its recit.config.ts 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.

TerminalBash
recit-site dev # the site on a local server, rebuilt on every change recit-site build # the static site in dist/ recit-site preview # dist/ served as a host would recit-site check # the links, anchors and data files of dist/

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.

OptionDefaultWhat it does
--portport of the config, or 3000The port of the local server; a busy port moves to the next free one and says so.
--openoffOpens the browser on the site once the server listens.
--ssronRenders each page on the server; --no-ssr serves the client application alone.

recit-site build

Builds the static site in dist/ (.vercel/output/static on Vercel): one HTML page per page, its assets, the search index and the sitemap.

OptionDefaultWhat it does
--previewoffServes the build once it is written, as recit-site preview does; --preview 4100 picks the port (4000 otherwise).
--strictoffFails the build on a recoverable problem of the config (a folder directory that does not exist) instead of a warning.
--pdfoffThen exports the site's PDFs into the build (recit export --to pdf --site); needs @recit/cli and Chromium, and does not apply to --experimental-ssr.
--pdf-storeonCopies the prebuilt PDF store (recit-pdf/) into the build; --no-pdf-store leaves it out. See Prebuilt PDFs.
--strict-pdfoffFails when a PDF of the prebuilt store is older than its sources, instead of a warning.
--experimental-ssroffBuilds for rendering on a server instead of static pages (experimental).
--adapternodeWith --experimental-ssr, 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.

OptionDefaultWhat it does
--port4000The 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.

OptionDefaultWhat it does
--outdist/, or .vercel/output/staticThe build folder to read.
--base-pathbasePath of the configThe site's basePath, stripped from root addresses (/docs).
--linksonChecks that every page, asset and data file pointed to exists; --no-links skips.
--anchorsonChecks that every #fragment names an id of its page; --no-anchors skips.
--a11yoffRuns axe on every page; Playwright and axe-core must be installed in the site.
--jsonoffPrints the report as JSON on the standard output.

recit-site hash-password

Asks for a password and prints the hash to write in access.password, so that the password itself never sits in the config. The whole guide is Password.

OptionDefaultWhat it does
--salta salt drawn at randomPrints the older form sha256:<hex>, salted by this value (set access.salt to it); without it the salt is written in the hash.