lpm migrate
Convert a project from npm, pnpm, yarn, or bun to LPM CLI.
lpm migrateDetects 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 filesThe 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
- Pre-flight — confirm
package.jsonexists; refuse iflpm.lockalready exists (unless--forceor--dry-run). - Detect + parse + convert — identify source PM (npm / pnpm / yarn / bun), read its lockfile, convert to LPM CLI format.
- Translate
pnpm.*blocks — auto-translatepnpm.overrides,pnpm.patchedDependencies, andpnpm.peerDependencyRulesinto the matchinglpm.*fields. Patch translations also addlpm.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 originalpnpm.*block stays in place after migration so a parallelpnpm installkeeps working during the transition. See Migrating from pnpm for per-block details. - Write — emit
lpm.lockand, when supported by the binary format,lpm.lockb. Back up the source lockfile, the existinglpm.lock/lpm.lockb(if any),.gitattributes, and — when thepnpm.*translations have entries to apply —package.jsonplus any patch destinations the migration is about to clobber. .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:registryscope. Skip the whole step with--no-npmrc.- Install — run
lpm installagainst the new lockfile (lockfile fast-path, no re-resolution). Skip with--no-install. - Verify — run
build+testscripts to confirm nothing broke. Skip with--skip-verify. - CI template — print a hint pointing at a CI workflow template, or generate one with
--ci. Suppress with--no-ci. - 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 --rollbackWalks the backups created by the previous migration and restores them in place. Safe to run repeatedly.
Flags
| Flag | Effect |
|---|---|
--dry-run | Parse and convert only — write nothing |
--force | Overwrite an existing lpm.lock |
-y, --yes | Reserved. The flow is non-interactive today, so this flag is a no-op. It does NOT imply --force. |
--no-install | Don't run lpm install after conversion |
--skip-verify | Skip the build/test verification step |
--no-npmrc | Don't touch .npmrc |
--ci | Generate a CI workflow template for the detected platform |
--no-ci | Suppress the CI template hint |
--rollback | Restore files from .backup copies created by a previous migration |
Plus the global flags.
See also
- Migrating from npm
- Migrating from pnpm
- Migrating from Yarn
- Migrating from Bun
lpm install— runs after conversion to materializenode_modules- Lockfile —
lpm.lockandlpm.lockbformats