LPM CLI

lpm migrate

Convert a project from npm, pnpm, yarn, or bun to LPM CLI.

lpm migrate

Detects the current package manager and converts its lockfile to a version 12 LPM staging lockfile. The staging graph can include lpm.lockb.

By default, the command then runs an online lpm install. This install resolves exact package-instance identities and writes the current version 13 TOML lockfile.

lpm migrate is non-destructive: every file it touches is backed up first (package-lock.json.backup, .npmrc.backup, etc.), and --rollback restores them.

Examples

lpm migrate                  # default — non-interactive
lpm migrate --dry-run        # parse + convert, write nothing
lpm migrate --force          # overwrite an existing lpm.lock
lpm migrate --no-install     # convert lockfile only, don't install
lpm migrate --skip-verify    # skip the build/test verification step
lpm migrate --no-npmrc       # don't touch .npmrc
lpm migrate --ci             # also generate a CI workflow template
lpm migrate --rollback       # restore from .backup files

The flow is non-interactive — there are no prompts to skip and -y is reserved for a future interactive mode. Pass --force if you want to overwrite an existing lpm.lock.

Input limits and supported formats

lpm migrate reads one fixed snapshot of the selected source lockfile. It rejects malformed files and unsupported versions.

The command supports npm lockfile versions 1, 2, and 3. It supports pnpm lockfile major versions 5, 6, and 9.

Each source lockfile has these limits:

  • The file size limit is 64 MiB.
  • The package-entry limit is 200,000.

npm lockfiles have these additional limits:

  • The package-path limit is 32 KiB.
  • The package nesting limit is 256 levels.
  • The dependency limit for one package is 10,000.
  • The total dependency-edge limit is 1,000,000.

For bun.lockb, LPM CLI copies the selected file before conversion. The Bun converter has these limits:

  • The time limit is 30 seconds.
  • The converted output limit is 64 MiB.
  • The diagnostic-output limit is 64 KiB.

If a file or conversion exceeds a limit, migration stops before it changes the project.

What runs, in order

  1. Pre-flight — confirm package.json exists; refuse if lpm.lock already exists (unless --force or --dry-run).
  2. Detect + parse + convert — identify source PM (npm / pnpm / yarn / bun), read its lockfile, convert to LPM CLI format.
  3. Translate pnpm.* blocks — auto-translate pnpm.overrides, pnpm.patchedDependencies, and pnpm.peerDependencyRules into the matching lpm.* fields. Patch translations also add lpm.lock > [patches] checksum records. Validation runs up-front: range parse errors, conflicting keys / ranges, unsupported value shapes, missing patch integrity bindings — all surface BEFORE any disk mutation. The original pnpm.* block stays in place after migration so a parallel pnpm install keeps working during the transition. See Migrating from pnpm for per-block details.
  4. Write — emit a version 12 staging lpm.lock. Emit lpm.lockb only when the graph fits the binary format. Back up all files before replacement.
  5. .npmrc — optionally append @lpm.dev:registry=https://lpm.dev/api/registry/ to .npmrc (or create one). Backs up the original on touch. No-op if the file already declares an @lpm.dev:registry scope. Skip the whole step with --no-npmrc.
  6. Install — run an online lpm install. This step resolves exact identities, writes version 13, and removes the staging binary file. Skip with --no-install.
  7. Verify — run build + test scripts to confirm nothing broke. Skip with --skip-verify.
  8. CI template — print a hint pointing at a CI workflow template, or generate one with --ci. Suppress with --no-ci.
  9. Completion — print a compact status transcript: detected source + backup reminder, converted lockfile outputs, any install/verify phases, then Done · migration completed successfully.

Rollback

If anything goes wrong (or the migration was a mistake), restore in one command:

lpm migrate --rollback

Walks the backups created by the previous migration and restores them in place. Safe to run repeatedly.

Flags

FlagEffect
--dry-runParse and convert only — write nothing
--forceOverwrite an existing lpm.lock
-y, --yesReserved. The flow is non-interactive today, so this flag is a no-op. It does NOT imply --force.
--no-installDon't run lpm install after conversion
--skip-verifySkip the build/test verification step
--no-npmrcDon't touch .npmrc
--ciGenerate a CI workflow template for the detected platform
--no-ciSuppress the CI template hint
--rollbackRestore files from .backup copies created by a previous migration

Plus the global flags.

--no-install leaves the version 12 staging lockfile in place. Run lpm install before an offline or frozen install.

See also