LPM CLI

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 --json

These 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.

VariableBehavior
LPM_TOKENLPM.dev Registry credential. A nonempty --token wins, then a nonempty environment value, then the stored registry-scoped credential.
LPM_REGISTRY_URLLPM.dev Registry endpoint override. --registry takes precedence. Direct remote HTTP requires --insecure. HTTPS redirects cannot downgrade to HTTP.
NPM_TOKENNonempty token for the default npm registry. Takes precedence over its stored token and .npmrc credential.
GITHUB_TOKENGitHub Packages credential before gh auth and stored credentials. Also authenticates GitHub release lookups.
GH_TOKENFallback for CLI and plugin release lookups when GITHUB_TOKEN is absent or blank. Skill downloads prefer GH_TOKEN.
GITLAB_TOKEN, CI_JOB_TOKENDefault GitLab registry credentials, in that order, before glab auth and stored credentials. Custom hosts require exact stored credentials.
LPM_DISABLE_HOST_CLI_AUTHExact 1, true, or TRUE disables gh and glab credential discovery. Environment and stored credentials remain available.
LPM_KEY_PASSPHRASENonempty 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

VariableBehavior
NPM_CONFIG_USERCONFIG, npm_config_userconfigSelect the user .npmrc. Nonempty uppercase takes precedence over lowercase.
NPM_CONFIG_GLOBALCONFIG, npm_config_globalconfigSelect the global .npmrc, with the same alias precedence.
NPM_CONFIG_PREFIX, npm_config_prefix, PREFIXHelp 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.

WorkflowToken orderRequired audience
LPM.dev Registry exchangeLPM_OIDC_TOKEN, GitHub Actions runtime, LPM_GITLAB_OIDC_TOKENhttps://lpm.dev
npm Trusted PublishingNPM_ID_TOKEN, GitHub Actions runtimenpm:registry.npmjs.org
Generated Sigstore provenanceGitHub Actions runtime, SIGSTORE_ID_TOKEN, LPM_GITLAB_OIDC_TOKENsigstore

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.

VariableBehavior
LPM_OIDC_POLICY_IDPolicy UUID for lpm env pull --oidc. --policy-id takes precedence. The value must be a UUIDv4. Blank or invalid values fail.
LPM_VAULT_IDProject 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:

VariableBehavior
NPM_CONFIG_PROVENANCE, npm_config_provenanceExact lowercase true requests generated provenance. Empty acts as absent. Other nonempty values mean false. Conflicting aliases fail.
NPM_CONFIG_PROVENANCE_FILE, npm_config_provenance_filePath 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

VariableBehavior
LPM_HOMEChanges 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-lockfile

A 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

VariableAccepted values and precedence
LPM_LINKERhoisted 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_SIGNATURES1, true, yes, on enable verification. 0, false, no, off disable it. Invalid values use saved signatures, then false.
LPM_AUDIT_AFTER_INSTALLThe same Boolean values. CLI flags win, then a valid environment value, saved audit-after-install, then false. Findings do not fail installation.
LPM_NPM_FIREWALLoff, monitor, or enforce. report aliases monitor. Can tighten the user mode but cannot weaken it. Blank or invalid values fail.
LPM_V2_OBJECT_INTEGRITYsource, sri, tarball, or empty select source checks. tree and unknown nonempty values select expanded-file checks. Overrides saved integrity.
LPM_CONCURRENT_DOWNLOADSInteger from 1 to 256 for install and lpm fetch. Default 24. Invalid values warn and use the default. Whitespace is not trimmed.
LPM_WORKSPACE_CONCURRENCYPositive 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

VariableBehavior
LPM_NO_AUTO_INSTALLExact 1 or true disables automatic runtime installation.
LPM_NODE_DIST_BASE_URLBase 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_REGISTRYNonblank npm registry override for managed tool packages. Does not change project dependency routing.
LPM_FORCE_TOOL_INSTALLExact 1 or true forces managed plugin download again.
LPM_PLUGIN_QUIETExact 1 or true hides plugin installation status. Warnings and errors remain visible.
LPM_NO_UPDATE_CHECKAny presence, including empty or 0, disables the background CLI update check.
LPM_SANDBOX_HELPERWindows 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_TARGETWindows 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

VariableBehavior
LPM_PROVENANCE_ENFORCEdeny, warn, or off. Overrides the provenance posture. Weaker values still require security approval. Unknown values fail.
LPM_STRICT_SANDBOX1, 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_PLUGINS1 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_URLOSV 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_PATHnpm 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.

VariableBehavior
LPM_INSTALL_CHANNELstable by default, or nightly. The installer checks this value even with an explicit version.
LPM_INSTALL_VERSIONExact release tag, including v. Skips channel lookup.
LPM_INSTALL_INSECUREExact 1 skips download integrity checks.
LPM_INSTALL_MIN_VERSION_OVERRIDEExact 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.

VariableBehavior
LPM_REMOTE_CACHEValid Boolean values override remoteCache.enabled. Invalid values use the file.
LPM_REMOTE_CACHE_READ_ONLYA true environment value or true remoteCache.readOnly blocks uploads. False cannot cancel the file value.
LPM_REMOTE_CACHE_URLNonblank endpoint override before the project URL and active registry. LPM CLI appends /v8 unless already present.
LPM_REMOTE_CACHE_TOKENNonblank bearer token. Only same-origin cache endpoints can fall back to registry credentials.
LPM_REMOTE_CACHE_TEAMNonblank organization slug before remoteCache.team. Without either value, the token selects the namespace.
LPM_REMOTE_CACHE_SIGNATURE_KEYNonempty 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.

VariableBehavior
LPM_TRIAGE_OLLAMA_MODELOllama model name. Default llama3.2.
LPM_L4_CACHEEnabled when absent. Case-insensitive 1, true, yes, or on enables it. Every other value disables it. Whitespace is not trimmed.
LPM_L4_CACHE_PATHLiteral cache path override. Default cache/l4-verdicts.json in the LPM home: $LPM_HOME when set, else ~/.lpm.
LPM_L4_CACHE_TTL_SECSUnsigned integer seconds. Default 30 days. Invalid values use the default. Zero expires entries immediately.

Tunnel

VariableBehavior
LPM_TUNNEL_RELAYNonblank trimmed URL before saved tunnel.relay-url, then wss://relay.lpm.fyi/connect. Requires wss:// or loopback ws://.
LPM_HOSTS_FILENonempty hosts-file path override. Otherwise uses the system hosts file.
LPM_PROXY_SERVICE_DRY_RUNExact 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:

VariableValue
npm_lifecycle_eventScript phase or task name.
npm_lifecycle_scriptDeclared command, without extra CLI arguments.
npm_package_name, npm_package_versionCurrent package fields, or empty when absent.
npm_package_jsonAbsolute path to the current package manifest.
INIT_CWDDirectory 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

VariableBehavior
FORCE_COLORExact 0 or false disables color. Other nonempty values enable it. Empty acts as absent.
NO_COLORAny 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.

VariableBehavior
LPM_RESOLVERExact pubgrub selects the alternative resolver. Otherwise uses greedy-fusion.
LPM_GREEDY_FUSIONExact 0 disables fused resolution.
LPM_WALKERExact stream selects streaming dependency traversal. Other values use breadth-first traversal.
LPM_NPM_FANOUTPositive integer limit for concurrent metadata requests, capped at 512. Invalid values use the selected pipeline default.
LPM_NPM_ROUTEDiagnostic direct or proxy routing override. Use .npmrc for normal registry configuration.
LPM_DEEP_FOLLOWUPDefault 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
VariableBehavior
LPM_TIMINGAdds install timing. Empty, 0, false, and off disable it after trimming. Other values enable it.
LPM_TIMING_DETAILAny value enables detailed install timing. Case-insensitive trace adds slow-package and duplicate-metadata details.
LPM_HTTPExact h1-pool selects HTTP/1 pooling instead of the build's default transport.
LPM_STREAM_FETCHExact 0 disables streaming fetch.
LPM_SERIAL_LINKExact 1 disables parallel linking.
LPM_MAX_BLOCKING_THREADSPositive integer cap for blocking runtime threads. Zero or invalid values use the runtime default.
LPM_STORE_VERSIONEmpty, 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_GUARDDiagnostic suspicious-name toggle, subject to saved settings and security floors. Prefer lpm config typosquat.
LPM_EXPERIMENT_NPM_FIREWALLLegacy alias for LPM_NPM_FIREWALL. The canonical variable takes precedence by presence.
LPM_EXPERIMENT_NPM_FIREWALL_LOOKUPintegrity, 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_SIZEPositive 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.

See also