LPM CLI

lpm migrate

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

lpm migrate

Detects which package manager a project currently uses, parses the foreign lockfile, converts it to lpm.lock plus lpm.lockb when the graph fits the binary format, optionally configures .npmrc, runs lpm install against the new lockfile, and (optionally) verifies that build + test scripts still pass.

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.

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 lpm.lock and, when supported by the binary format, lpm.lockb. Back up the source lockfile, the existing lpm.lock / lpm.lockb (if any), .gitattributes, and — when the pnpm.* translations have entries to apply — package.json plus any patch destinations the migration is about to clobber.
  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 lpm install against the new lockfile (lockfile fast-path, no re-resolution). 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.

See also