Audience: End UserLast verified against repo: 2026-11-28
Configuration
Copy the two example environment files and set your scan roots. Default ports and loopback addresses work out of the box.Create your local environment files in two commands
PkgSteward uses two environment files: apps/api/.env for the local API service and apps/web/.env.local for the Web UI.01
Run Copy-Item in Windows PowerShell from the repository root.1. Copy apps/api/.env.example to apps/api/.env
powershellCopy-Item apps/api/.env.example apps/api/.env
Expected result: apps/api/.env is created with HOST=127.0.0.1, PORT=24681, and SCAN_ROOT_PATHS=*. You can narrow SCAN_ROOT_PATHS to specific folders such as D:\Workspaces if desired.
02
Create the Web UI configuration file pointing to the local API service.2. Copy apps/web/.env.example to apps/web/.env.local
powershellCopy-Item apps/web/.env.example apps/web/.env.local
Expected result: apps/web/.env.local is created with API_BASE_URL=http://127.0.0.1:24681/api/v1.
Keep HOST on a loopback address
HOST in apps/api/.env must remain 127.0.0.1, localhost, or ::1. The API service executes local file operations and package commands and refuses non-loopback network bindings.Most important settings at a glance
Every setting in apps/api/.env and apps/web/.env.local is listed below with its default value and purpose. You can also adjust scan roots and visual preferences later inside the in-app Settings page (/settings).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)
| 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 (
README.md)View source doc on GitHub(opens in new tab)