CLI configuration
LPM CLI has built-in routing and authentication for LPM.dev Registry. An .npmrc file gives the same access to npm, pnpm, Yarn 1, and other npm-compatible tools.
This page covers how local and CI tools connect to LPM.dev Registry. For other LPM CLI project and user configuration, see the LPM CLI configuration docs.
LPM CLI session
To use LPM.dev Registry from your terminal, sign in:
lpm login
lpm whoami
LPM CLI stores the session in the operating system keychain. If no keychain is available, it stores the session encrypted in ~/.lpm/.credentials.
The stored session is enough for LPM CLI commands such as these:
lpm install @lpm.dev/acme.private-utils
lpm publish
lpm env pull
lpm tunnel 3000
LPM CLI recognizes @lpm.dev/* without an .npmrc file.
See Authentication and the LPM CLI authentication reference.
Local .npmrc access
If npm-compatible tools on your machine must install @lpm.dev/* packages, generate a project .npmrc:
lpm setup local
The command creates a read-only token that is valid for 30 days. It writes the token to a scoped .npmrc and adds that file to .gitignore.
To set a different validity, pass --days with a value from 1 to 90:
lpm setup local --days 7
Before the token expires, run the command again to replace it.
CI .npmrc access
To generate the .npmrc for a CI job, run:
lpm setup ci npmrc
The command writes a literal token into .npmrc. It takes the token from --token, then LPM_TOKEN, then the stored session. If none of these has a token, the command fails. With --oidc, it exchanges the OIDC token of the CI job for a read-only token instead.
Do not commit or cache the generated file. It contains the token.
LPM CLI reads LPM_TOKEN directly. A project that installs with lpm ci does not need .npmrc. If npm, pnpm, or Yarn 1 needs the file, keep it inside the CI job.
See CI/CD integration and the full lpm setup reference.
Scoped registry routing
Generated .npmrc files use scoped routing:
@lpm.dev:registry=https://lpm.dev/api/registry/
//lpm.dev/api/registry/:_authToken=<token>
Only @lpm.dev/* packages use LPM.dev Registry. Unscoped packages still use npm, or the default registry that .npmrc already sets. Other scopes keep their own mappings.
For example, one project can resolve all three of these dependencies:
{
"dependencies": {
"react": "^19.0.0",
"@my-company/internal-tool": "^2.1.0",
"@lpm.dev/acme.private-utils": "^1.0.0"
}
}
| Package | Registry |
|---|---|
react | npm, or the configured default registry |
@my-company/internal-tool | The @my-company mapping in .npmrc |
@lpm.dev/acme.private-utils | LPM.dev Registry |
LPM.dev Registry does not proxy other npm packages.
See the LPM CLI registries guide for .npmrc precedence, private registries, TLS, and credential isolation.
Registry environment variables
| Variable | Purpose |
|---|---|
LPM_TOKEN | Authenticates the current process to LPM.dev Registry. CI jobs often use it. |
LPM_REGISTRY_URL | Replaces the LPM.dev Registry URL for the current process. Set it only to an endpoint that you trust. |
The --token and --registry flags take precedence over these variables.
For the complete list of environment variables, including local development and diagnostic settings, see cli.lpm.dev/docs/reference/env-vars.
General LPM CLI configuration
Registry access is one part of LPM CLI configuration. The LPM CLI docs describe the other parts:
package.json > lpmfor the linker, dependency resolution, lifecycle scripts, and trustlpm.jsonfor runtimes, tasks, tools, environment identity, and publish settingslpm.tomlfor project defaults~/.lpm/config.tomlfor user defaults.npmrcand registry routinglpm config, the command that shows and changes supported settings
Those pages list the exact keys, precedence, accepted values, and command flags.