Skip to content

Environment variables

The Récit commands read a few environment variables: a token or a password that must stay out of a config file and of a shell history, the address of another service, the path of a tool, or a switch for a build. Each one below says which command reads it and what it changes. A flag of the same command wins over its variable when both are set.

Récit sets a few more RECIT_ variables for itself (the mode of recit-site, the sidecar of Récit Studio, its signed release build): they are not listed here, and setting them by hand is not supported.

Account and service

VariableRead byWhat it changes
RECIT_TOKENrecit whoami; recit login and recit logout warn when it is setThe bearer token used before the one recit login saved, for CI. recit logout never revokes or clears it. See Récit account.
RECIT_API_URLrecit login, recit logout, recit whoami, the connector, Récit StudioThe Récit service to call instead of the default one; --api-url wins over it. Plain http:// is refused except on localhost, 127.0.0.1 and [::1].
RECIT_API_TOKENthe connectorThe personal token the connector sends to the service; with RECIT_API_URL, it turns on the tools that call it. See Connector.
RECIT_STRUCTURE_TOKENrecit collections publish, recit-site buildThe structure's write token, from a build secret, never from a flag or the config. See Published collections.

Sites

VariableRead byWhat it changes
RECIT_SITE_PASSWORDrecit-site build, recit export --prebuiltThe password of a site sealed by access.mode: "encrypted", when access.password names no other variable ({ env: "…" }). A wrong or missing one fails the build. See Password.
RECIT_SITE_STRICTrecit-site buildSet to 1, fails the build on a recoverable problem of the config instead of a warning, as --strict does; ignored by recit-site dev.
RECIT_OPEN_BROWSERrecit-site devAny value opens the browser on the site once the server listens, as --open does.
RECIT_BUILD_DEBUGrecit-site dev, recit-site buildAny value writes the code the site's Vite plugins generate to dist/debug/, one file per plugin, to read what a virtual module holds.

A variable whose name starts with RECIT_PUBLIC_ is handed to the pages of a site, in the browser: it may come from the environment or from a .env file next to recit.config.ts. Never put a secret in one. access.password refuses such a name for the same reason.

Stories, renders and prints

VariableRead byWhat it changes
RECIT_MODULESrecit dev, recit buildLends node_modules folders to a project that has none: absolute paths joined by : (; on Windows), searched after the project's own. A relative path or a missing folder is refused. See CLI.
RECIT_FFMPEGrecit render, Récit StudioThe path of the ffmpeg binary that encodes an MP4, instead of the one on the PATH.
RECIT_CHROMIUM_WS_ENDPOINTevery PDF and image printThe WebSocket endpoint of a playwright run-server of the same version: every print is drawn by that Chromium, with its fonts, instead of a local one.
RECIT_APP_TARGET_DIRrecit appMoves Cargo's target folder out of the site, to share the compiled dependencies between sites; an explicit CARGO_TARGET_DIR wins. See App.
RECIT_MCP_ROOTrecit mcpThe only folder the MCP tools may read and write, when the host passes no --root; the working directory otherwise. See MCP.