Audience: Operator / ConfigurationLast verified against repo: 2026-11-28
Environment Variables
Every configuration variable supported by apps/api/.env and apps/web/.env.local, generated from the repository's .env.example templates.API Service variables (apps/api/.env)
These 12 variables configure the local API service, workspace scanner defaults, command timeouts, and the 3-tier data directory. Note that values saved inside settings.json (via the in-app Settings page) override the corresponding environment variables at runtime.Backend API Variables (apps/api/.env)
| Variable | Default | Required | What it does |
|---|---|---|---|
SCAN_ROOT_PATHS | "*" | Yes | Comma-separated absolute folders to scan (for example D:\Workspaces,C:\Projects) or * to scan all local fixed drives on Windows. |
MAX_SCAN_DEPTH | 0 | Optional | Maximum folder depth when scanning. 0 or empty means unlimited depth; positive integers limit how many nested directory levels are traversed. |
SCAN_TIMEOUT_MS | Empty (no timeout) | Optional | Maximum time in milliseconds for a scan before it stops and returns partial results with timedOut: true. |
HOST | "127.0.0.1" | Yes (Loopback only) | Loopback listen address for the API service. Must be 127.0.0.1, localhost, or ::1. Non-loopback addresses are rejected for safety. |
PORT | 24681 | Yes | TCP port for the local API service (default 24681). |
MODE | "development" | Yes | Runtime mode for the API service ("development" for local dev or "production" before running pnpm build && pnpm start). |
LIST_ORIGIN_CORS | "http://localhost:24680" | Yes | Comma-separated allowed browser origins for the Web UI. |
GLOBAL_PREFIX | "api" | Optional | URL path prefix for API routes (default "api"). |
VERSION | "1" | Optional | API route version segment (default "1", forming /api/v1). |
EXPORT_SWAGGER_API_JSON | true | Optional | Whether to expose the local OpenAPI specification endpoint in development mode. |
NPM_COMMAND_TIMEOUT_MS | Empty (300000 ms) | Optional | Timeout in milliseconds for package manager commands (defaults to 300,000 ms / 5 minutes when empty). |
PKGSTEWARD_DATA_DIR | Empty (3-tier auto) | Optional | Custom folder for logs, cache/last-scan.json, and settings.json. When empty, falls back to PkgStewardLog (in a .git checkout or portable mode) or %LOCALAPPDATA%\PkgSteward. |
Web UI variables (apps/web/.env.local)
These 3 variables control the Web UI listen address and the server-side proxy target to the local API service.Web UI Variables (apps/web/.env.local)
| Variable | Default | Required | What it does |
|---|---|---|---|
API_BASE_URL | http://127.0.0.1:24681/api/v1 | Yes | Server-side proxy target pointing the Web UI to the local API service (/api/pkgsteward/* forwards here). |
PORT | Empty (24680) | Optional | Web UI listen port (defaults to 24680 when empty). |
HOST | Empty (localhost) | Optional | Web UI bind hostname (defaults to localhost when empty). |
Last verified against repo: 2026-11-28 (
apps/api/README.md)View source doc on GitHub(opens in new tab)