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/ and backups/ both move. ~ is expanded.
PORT5622The port local-review serves on. --port wins over it. Also used in the URL init prints.
LOCAL_REVIEW_USERgit config user.name, else $USERWho you are: your comments are stored under this name’s id. See The reviewer.
LOCAL_REVIEW_PROJECTS_DIR$LOCAL_REVIEW_HOME/projectsMoves only projects/. For the tests; it turns automatic snapshots 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

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.

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_-]: “Ada Lovelace” becomes ada. 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 are off unless LOCAL_REVIEW_HOME is set as well (they then go to $LOCAL_REVIEW_HOME/backups). 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.

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