Skip to content

Environment variables

Local Review needs no configuration. These variables change where it keeps its data, which port it uses and who it thinks you are.

VariableDefaultWhat it does
LOCAL_REVIEW_HOME~/.local-reviewThe data directory: projects/, backups/, examples/, cache/ and logs/ all move. ~ is expanded. --data-dir <path> sets it for one command.
PORT5622The port local-review serves on. --port wins over it. Also used in the URL init prints. Not used by service install.
LOCAL_REVIEW_USERgit config user.name, else $USERWho you are: your comments are stored under this name’s id. See The reviewer.
NO_COLOR, FORCE_COLORcolour on a terminalThe startup banner’s colours. See Colour.
XDG_CONFIG_HOME~/.configLinux only, for service: the systemd user unit goes in $XDG_CONFIG_HOME/systemd/user if it’s an absolute path.
LOCAL_REVIEW_PROJECTS_DIR$LOCAL_REVIEW_HOME/projectsMoves only projects/. For the tests; it turns automatic snapshots and the git cache off unless LOCAL_REVIEW_HOME is set too.

Point it at a throwaway directory to try Local Review, or run a second instance, without touching your real reviews:

Terminal window
LOCAL_REVIEW_HOME=/tmp/lr-demo npx local-review --port 5050

npx local-review --data-dir /tmp/lr-demo --port 5050 does the same. Snapshots then go to /tmp/lr-demo/backups/. Everything under it is described in Where your data lives.

PORT=5050 npx local-review is the same as npx local-review --port 5050; if both are given, --port wins. serve rejects a value that isn’t an integer from 0 to 65535 rather than silently using the default.

local-review service install ignores PORT, so a PORT exported for something else can’t end up in the service: give it --port <n> instead.

A service started by launchd or systemd gets almost none of your shell’s environment, so local-review service install writes what Local Review needs into the service’s file: PATH (cleaned up, with git on it), HOME, and LOCAL_REVIEW_HOME (made absolute) and LOCAL_REVIEW_USER if they’re set when you install. A reinstall keeps the last two if they aren’t set then; to drop one, run local-review service uninstall first. Nothing else is passed on: set the others in the service’s file only if you know you need them, and expect service install to rewrite it.

Your comments are stored as author: <id>, and only yours can be edited or deleted in the UI (an agent’s, author: claude, never are). The name comes from LOCAL_REVIEW_USER, else git config user.name, else $USER. The id is its first word, lowercased and reduced to [a-z0-9_-], at most 32 characters: “Ada Lovelace” becomes ada. claude is the agent’s id, so a reviewer who would get it (or an empty id) is reviewer instead. GET /api/me returns both.

If your comment files were written under some id, set LOCAL_REVIEW_USER to that id to keep them yours:

Terminal window
LOCAL_REVIEW_USER=ada npx local-review

Moves just the projects/ directory. It’s meant for the test suite: it isn’t a data home, so automatic snapshots and the git cache (cache/) are off unless LOCAL_REVIEW_HOME is set as well (they then go to $LOCAL_REVIEW_HOME/backups and $LOCAL_REVIEW_HOME/cache). Prefer LOCAL_REVIEW_HOME.

These only matter when you run Local Review from a checkout with npm run dev (see Contributing):

VariableDefaultWhat it does
LOCAL_REVIEW_WEB_PORT5622The port Vite serves the UI on.
LOCAL_REVIEW_API_PORT5623The port of the API server Vite proxies /api to.
LOCAL_REVIEW_DEVunsetSet by npm run dev for the API server: it doesn’t serve the built UI (Vite does), and its default port is 5623.

Change both to run a dev instance next to a live one.

Only local-review’s startup banner is coloured, and it follows Node’s own rules (getColorDepth):

  • NO_COLOR (any non-empty value, no-color.org): the banner without colour.
  • FORCE_COLOR: colour, and the banner, even when the output isn’t a terminal (the banner goes to stderr, so it’s stderr that counts). FORCE_COLOR=1, 2 and 3 pick 16, 256 or 16 million colours; FORCE_COLOR=0 turns colour off. If both are set, FORCE_COLOR wins, as in Node and at force-color.org.
  • Otherwise: colour on a terminal that has it (COLORTERM, TERM; Windows 10 and later), none on TERM=dumb, and no banner at all when stderr isn’t a terminal.

--quiet leaves the banner out whatever these say.