Environment variables
Configure authentication, installation, publishing, runtimes, remote caching, and diagnostics for one process.
Environment variables configure LPM CLI for one process.
Use them for CI credentials, temporary overrides, and diagnostics. Use lpm config for persistent user defaults.
LPM_AUDIT_AFTER_INSTALL=true lpm install
LPM_NO_AUTO_INSTALL=1 lpm run build
LPM_REMOTE_CACHE_READ_ONLY=true lpm run build
lpm config list --jsonThese examples use POSIX shell syntax. In PowerShell, set $env:NAME = "value" before the command.
Each variable has its own parser and precedence. Empty values do not have one universal meaning.
Run and exec commands remove inherited credentials and runtime injection variables from child processes. Dependency lifecycle scripts use a restricted environment.
Auth and routing
LPM CLI supports npm-compatible registries, private registries, and LPM.dev Registry.
Only @lpm.dev/* packages always route through LPM.dev Registry. See Registry configuration.
| Variable | Behavior |
|---|---|
LPM_TOKEN | LPM.dev Registry credential. A nonempty --token wins, then a nonempty environment value, then the stored registry-scoped credential. |
LPM_REGISTRY_URL | LPM.dev Registry endpoint override. --registry takes precedence. Direct remote HTTP requires --insecure. HTTPS redirects cannot downgrade to HTTP. |
NPM_TOKEN | Nonempty token for the default npm registry. Takes precedence over its stored token and .npmrc credential. |
GITHUB_TOKEN | GitHub Packages credential before gh auth and stored credentials. Also authenticates GitHub release lookups. |
GH_TOKEN | Fallback for CLI and plugin release lookups when GITHUB_TOKEN is absent or blank. Skill downloads prefer GH_TOKEN. |
GITLAB_TOKEN, CI_JOB_TOKEN | Default GitLab registry credentials, in that order, before glab auth and stored credentials. Custom hosts require exact stored credentials. |
LPM_DISABLE_HOST_CLI_AUTH | Exact 1, true, or TRUE disables gh and glab credential discovery. Environment and stored credentials remain available. |
LPM_KEY_PASSPHRASE | Nonempty passphrase for an encrypted registry client key. Takes precedence over the terminal prompt. Non-interactive commands require this value. |
Release lookups send GitHub tokens only to the canonical GitHub API origin.
A token alias does not apply to every GitHub feature. NODE_AUTH_TOKEN is not a direct substitute for NPM_TOKEN.
See Authentication for registry scopes and credential storage.
npm configuration paths
| Variable | Behavior |
|---|---|
NPM_CONFIG_USERCONFIG, npm_config_userconfig | Select the user .npmrc. Nonempty uppercase takes precedence over lowercase. |
NPM_CONFIG_GLOBALCONFIG, npm_config_globalconfig | Select the global .npmrc, with the same alias precedence. |
NPM_CONFIG_PREFIX, npm_config_prefix, PREFIX | Help locate the global npm configuration. They do not change LPM_HOME. |
Path overrides support home expansion.
For global npm configuration, the prefix order is the npm environment override, eligible user configuration, PREFIX, then the detected Node prefix.
See npm compatibility for .npmrc support.
OIDC credentials
Blank OIDC token and GitHub runtime values act as absent. Nonblank tokens retain their original bytes. A selected provider failure stops the operation instead of trying another identity.
| Workflow | Token order | Required audience |
|---|---|---|
| LPM.dev Registry exchange | LPM_OIDC_TOKEN, GitHub Actions runtime, LPM_GITLAB_OIDC_TOKEN | https://lpm.dev |
| npm Trusted Publishing | NPM_ID_TOKEN, GitHub Actions runtime | npm:registry.npmjs.org |
| Generated Sigstore provenance | GitHub Actions runtime, SIGSTORE_ID_TOKEN, LPM_GITLAB_OIDC_TOKEN | sigstore |
GitHub Actions supplies ACTIONS_ID_TOKEN_REQUEST_URL and ACTIONS_ID_TOKEN_REQUEST_TOKEN with permissions: id-token: write.
Both values must be nonblank. LPM CLI requests the audience for the selected workflow and preserves other endpoint query parameters.
LPM_OIDC_TOKEN does not supply Sigstore provenance or npm Trusted Publishing.
| Variable | Behavior |
|---|---|
LPM_OIDC_POLICY_ID | Policy UUID for lpm env pull --oidc. --policy-id takes precedence. The value must be a UUIDv4. Blank or invalid values fail. |
LPM_VAULT_ID | Project ID for lpm env pull --oidc only. A trimmed, nonblank value overrides lpm.json > vault. Blank values use the local field. |
Other environment commands ignore LPM_VAULT_ID.
See CI setup, package publishing, and environment project identity.
npm publish and provenance
lpm publish and lpm stage publish read these npm-compatible aliases:
| Variable | Behavior |
|---|---|
NPM_CONFIG_PROVENANCE, npm_config_provenance | Exact lowercase true requests generated provenance. Empty acts as absent. Other nonempty values mean false. Conflicting aliases fail. |
NPM_CONFIG_PROVENANCE_FILE, npm_config_provenance_file | Path to an existing Sigstore bundle. Relative paths start at the project directory. Conflicting aliases fail. |
CLI provenance flags and package.json > publishConfig take precedence over environment values.
Empty provenance-file values fail. Relative paths cannot contain .. or escape the selected project.
A provenance file cannot combine with a Boolean provenance setting.
Provenance files attach to npm-compatible targets. lpm publish rejects them when an LPM.dev Registry target is active.
Filesystem layout
| Variable | Behavior |
|---|---|
LPM_HOME | Changes the LPM home from ~/.lpm. It holds user configuration, login state, local env secrets, stores, caches, global packages, the local root certificate authority, security approvals, and tunnel pins. A relative path starts at the current directory. |
A home other than ~/.lpm keeps its own entries in the OS credential store, so it has its own login, local env secrets, and security approvals.
lpm doctor warns with lpm_home_default_state_unused when ~/.lpm still holds login or env files that the selected home doesn't use.
LPM_HOME does not move OS-managed security policy, or the state of lpm self-update, which stays in .lpm in your OS account's home directory.
Project env values cannot set LPM_HOME for scripts: LPM CLI drops it from .env files and stored env values, as it does HOME and PATH.
Don't point LPM_HOME at a project's .lpm directory. Commands that write project state refuse a project whose .lpm is the LPM home.
For temporary CI isolation:
LPM_HOME="$PWD/.lpm-ci" lpm install --frozen-lockfileA fresh home has no saved login. Supply LPM_TOKEN for private @lpm.dev/* packages. LPM CLI keeps a home inside a repository out of Git with a .gitignore of its own, and lpm publish never packs it.
See Files LPM CLI creates for the layout.
Install pipeline
| Variable | Accepted values and precedence |
|---|---|
LPM_LINKER | hoisted or isolated. CLI flag, user configuration, nonempty environment value, project value, then automatic selection. Unknown selected values fail. Empty acts as absent. |
LPM_VERIFY_REGISTRY_SIGNATURES | 1, true, yes, on enable verification. 0, false, no, off disable it. Invalid values use saved signatures, then false. |
LPM_AUDIT_AFTER_INSTALL | The same Boolean values. CLI flags win, then a valid environment value, saved audit-after-install, then false. Findings do not fail installation. |
LPM_NPM_FIREWALL | off, monitor, or enforce. report aliases monitor. Can tighten the user mode but cannot weaken it. Blank or invalid values fail. |
LPM_V2_OBJECT_INTEGRITY | source, sri, tarball, or empty select source checks. tree and unknown nonempty values select expanded-file checks. Overrides saved integrity. |
LPM_CONCURRENT_DOWNLOADS | Integer from 1 to 256 for install and lpm fetch. Default 24. Invalid values warn and use the default. Whitespace is not trimmed. |
LPM_WORKSPACE_CONCURRENCY | Positive integer for recursive workspace installs. The CLI flag wins. Whitespace is trimmed. Invalid or zero values use automatic selection. |
Signature, audit, Firewall, and integrity values accept whitespace and case variations.
An explicit linker value disables automatic peer-conflict isolation.
Workspace installation concurrency is separate from the saved concurrency for workspace scripts, tests, and benchmarks.
See lpm install and user configuration.
CI detection
For frozen-lockfile defaults, installs read CI, GITHUB_ACTIONS, GITLAB_CI, BUILDKITE, and CIRCLECI.
Empty, 0, and case-insensitive false values mean false after whitespace removal. Other values mean true.
A detected CI environment enables frozen mode when an LPM CLI lockfile exists.
Other features have separate CI checks. Setting CI=false does not universally enable interactive prompts.
Runtimes and built-in tools
| Variable | Behavior |
|---|---|
LPM_NO_AUTO_INSTALL | Exact 1 or true disables automatic runtime installation. |
LPM_NODE_DIST_BASE_URL | Base URL for Node archives and checksum files. Does not replace the version index. Requires HTTPS or HTTP loopback, without URL credentials. |
LPM_MANAGED_TOOL_NPM_REGISTRY | Nonblank npm registry override for managed tool packages. Does not change project dependency routing. |
LPM_FORCE_TOOL_INSTALL | Exact 1 or true forces managed plugin download again. |
LPM_PLUGIN_QUIET | Exact 1 or true hides plugin installation status. Warnings and errors remain visible. |
LPM_NO_UPDATE_CHECK | Any presence, including empty or 0, disables the background CLI update check. |
LPM_SANDBOX_HELPER | Windows sandbox helper path, which must be absolute: LPM CLI starts the helper outside the sandbox, so it refuses a relative path, which would resolve against the directory it runs in. An existing file it names takes precedence over the helper beside the executable. Without either, LPM CLI runs lifecycle scripts only with the sandbox off: --no-sandbox, or [sandbox] mode = "none". |
LPM_MSVC_TARGET | Windows vcvarsall target for native builds. Defaults to the host architecture. |
See Node version pinning, built-in tools, and lpm self-update.
Security and recovery overrides
| Variable | Behavior |
|---|---|
LPM_PROVENANCE_ENFORCE | deny, warn, or off. Overrides the provenance posture. Weaker values still require security approval. Unknown values fail. |
LPM_STRICT_SANDBOX | 1, true, yes, or on requests strict containment, with whitespace and case variations. False or invalid values do not weaken saved mode. CLI flags win. |
LPM_ALLOW_UNVERIFIED_PLUGINS | 1 or case-insensitive true, without trimming, permits a managed plugin without available checksums. The plugin records this exception. Every reuse requires the same override. |
LPM_OSV_URL | OSV batch endpoint for audits. Default https://api.osv.dev/v1/querybatch. Requires HTTPS or HTTP loopback. Invalid values warn and use the default. |
LPM_BINARY_PATH | npm launcher only. Runs this native executable instead of the installed platform package. |
See security approval and plugin verification. Debug and acceptance-test storage switches are not supported release configuration.
Standalone installer
The shell installer reads these values. The installed CLI does not use them.
| Variable | Behavior |
|---|---|
LPM_INSTALL_CHANNEL | stable by default, or nightly. The installer checks this value even with an explicit version. |
LPM_INSTALL_VERSION | Exact release tag, including v. Skips channel lookup. |
LPM_INSTALL_INSECURE | Exact 1 skips download integrity checks. |
LPM_INSTALL_MIN_VERSION_OVERRIDE | Exact 1 bypasses the minimum-version floor. Integrity checks remain active unless separately disabled. |
The normal installer checks SHA-256 against the downloaded manifest.
When cosign and a release bundle are available, it also checks the manifest signature and stops on failure.
See Installation.
Remote task cache
lpm.json > remoteCache supplies persistent project configuration.
| Variable | Behavior |
|---|---|
LPM_REMOTE_CACHE | Valid Boolean values override remoteCache.enabled. Invalid values use the file. |
LPM_REMOTE_CACHE_READ_ONLY | A true environment value or true remoteCache.readOnly blocks uploads. False cannot cancel the file value. |
LPM_REMOTE_CACHE_URL | Nonblank endpoint override before the project URL and active registry. LPM CLI appends /v8 unless already present. |
LPM_REMOTE_CACHE_TOKEN | Nonblank bearer token. Only same-origin cache endpoints can fall back to registry credentials. |
LPM_REMOTE_CACHE_TEAM | Nonblank organization slug before remoteCache.team. Without either value, the token selects the namespace. |
LPM_REMOTE_CACHE_SIGNATURE_KEY | Nonempty artifact-signing key. Required for remoteCache.signature = true and third-party cache origins. |
Cache Booleans accept 1, true, yes, on, 0, false, no, and off, with whitespace and case variations.
Endpoints require HTTPS or HTTP loopback. HTTPS redirects cannot downgrade to HTTP.
Third-party cache origins require both an explicit token and a signing key.
See Remote task cache.
Triage advisor cache
The advisor cache reuses verdicts for matching package content, scripts, prompts, provider, and provider configuration. Ollama model and endpoint changes request a new verdict.
| Variable | Behavior |
|---|---|
LPM_TRIAGE_OLLAMA_MODEL | Ollama model name. Default llama3.2. |
LPM_L4_CACHE | Enabled when absent. Case-insensitive 1, true, yes, or on enables it. Every other value disables it. Whitespace is not trimmed. |
LPM_L4_CACHE_PATH | Literal cache path override. Default cache/l4-verdicts.json in the LPM home: $LPM_HOME when set, else ~/.lpm. |
LPM_L4_CACHE_TTL_SECS | Unsigned integer seconds. Default 30 days. Invalid values use the default. Zero expires entries immediately. |
Tunnel
| Variable | Behavior |
|---|---|
LPM_TUNNEL_RELAY | Nonblank trimmed URL before saved tunnel.relay-url, then wss://relay.lpm.fyi/connect. Requires wss:// or loopback ws://. |
LPM_HOSTS_FILE | Nonempty hosts-file path override. Otherwise uses the system hosts file. |
LPM_PROXY_SERVICE_DRY_RUN | Exact 1, true, yes, or on previews proxy service operations without applying them. |
An invalid selected relay URL warns and uses the default. It does not retry the saved URL.
Relay pins use $LPM_HOME/relay-pins/<host>.
See lpm tunnel, lpm hosts, and lpm proxy.
Script context
LPM CLI supplies these values to package scripts, explicit tasks, root install hooks, and dependency lifecycle scripts:
| Variable | Value |
|---|---|
npm_lifecycle_event | Script phase or task name. |
npm_lifecycle_script | Declared command, without extra CLI arguments. |
npm_package_name, npm_package_version | Current package fields, or empty when absent. |
npm_package_json | Absolute path to the current package manifest. |
INIT_CWD | Directory where the CLI command started. |
Generated values replace inherited values. Workspace and dependency scripts retain the original INIT_CWD.
See npm script execution.
Terminal output
| Variable | Behavior |
|---|---|
FORCE_COLOR | Exact 0 or false disables color. Other nonempty values enable it. Empty acts as absent. |
NO_COLOR | Any nonempty value disables color unless FORCE_COLOR or a CLI color flag overrides it. |
The order is CLI color mode, FORCE_COLOR, NO_COLOR, then terminal detection.
Resolver (advanced)
These diagnostic controls also work in release builds. Their behavior can change between releases.
| Variable | Behavior |
|---|---|
LPM_RESOLVER | Exact pubgrub selects the alternative resolver. Otherwise uses greedy-fusion. |
LPM_GREEDY_FUSION | Exact 0 disables fused resolution. |
LPM_WALKER | Exact stream selects streaming dependency traversal. Other values use breadth-first traversal. |
LPM_NPM_FANOUT | Positive integer limit for concurrent metadata requests, capped at 512. Invalid values use the selected pipeline default. |
LPM_NPM_ROUTE | Diagnostic direct or proxy routing override. Use .npmrc for normal registry configuration. |
LPM_DEEP_FOLLOWUP | Default enabled. A value that starts with 0 disables deeper resolver follow-up. This is a toggle, not a numeric depth. |
Diagnostic / experimental
LPM_TIMING_DETAIL=trace lpm install --json| Variable | Behavior |
|---|---|
LPM_TIMING | Adds install timing. Empty, 0, false, and off disable it after trimming. Other values enable it. |
LPM_TIMING_DETAIL | Any value enables detailed install timing. Case-insensitive trace adds slow-package and duplicate-metadata details. |
LPM_HTTP | Exact h1-pool selects HTTP/1 pooling instead of the build's default transport. |
LPM_STREAM_FETCH | Exact 0 disables streaming fetch. |
LPM_SERIAL_LINK | Exact 1 disables parallel linking. |
LPM_MAX_BLOCKING_THREADS | Positive integer cap for blocking runtime threads. Zero or invalid values use the runtime default. |
LPM_STORE_VERSION | Empty, 2, or v2 selects the default. 3 or v3 selects experimental file-level storage. 1 or v1 selects the legacy layout. Unknown values warn and use v2. |
LPM_TYPOSQUAT_GUARD | Diagnostic suspicious-name toggle, subject to saved settings and security floors. Prefer lpm config typosquat. |
LPM_EXPERIMENT_NPM_FIREWALL | Legacy alias for LPM_NPM_FIREWALL. The canonical variable takes precedence by presence. |
LPM_EXPERIMENT_NPM_FIREWALL_LOOKUP | integrity, strict, package-and-integrity, or package_and_integrity requests integrity-sidecar lookups. Matching trims whitespace and ignores case. Otherwise uses package-only lookups. |
LPM_EXPERIMENT_NPM_FIREWALL_CHUNK_SIZE | Positive verdict batch size. Default 64. Invalid values use the default. |
Store-version values accept whitespace and case variations.
Timing Boolean words are case-insensitive. LPM_TIMING_DETAIL=0 still enables detail.
Precedence reminder
Environment variables do not override every project or user value.
For example, saved linker beats LPM_LINKER, and saved read-only caching remains active with LPM_REMOTE_CACHE_READ_ONLY=false.
Use the rules in each section and lpm config list --json for supported effective values.