LPM-cli

Your first install

A two-minute walkthrough — install a package, look around, run a script.

This page assumes you have LPM installed. It will walk through installing a real package and getting a feel for how LPM lays things out.

A new project from scratch

mkdir hello-lpm && cd hello-lpm
lpm init -y

lpm init -y creates a minimal package.json. Without -y it prompts for name, version, and a few defaults.

Install a dependency

lpm install zod
Output
  ● Resolved  1 dep, 0 transitive  (88 ms)
  ● Linked    hoisted layout        (12 ms)

  + zod  ^4.3.6

Open package.jsonzod is now under dependencies with a caret range:

{
  "dependencies": {
    "zod": "^4.3.6"
  }
}

LPM's save policy writes ^resolvedVersion by default. To save exact, append --exact (or set save-exact = true in ~/.lpm/config.toml).

Two new files appear next to your package.json:

  • lpm.lock — human-readable, git-diffable lockfile. Commit this.
  • lpm.lockb — binary mmap of the same data, for zero-parse warm starts. Commit this too.

node_modules/ starts hoisted by default (npm-style flat). Workspaces auto-flip to isolated (pnpm-style symlinks), and default installs with incompatible peer requirements auto-switch to isolated. Override per-invocation with --linker=isolated|hoisted.

Install everything from a manifest

If you cloned a project that already has a package.json:

lpm install

Resolves and installs every dep declared in package.json. If lpm.lock exists and is consistent with the manifest, the install is reproducible — the lockfile pins every transitive version and integrity hash.

Run a script

Add a script to package.json:

{
  "scripts": {
    "hello": "echo 'hi from lpm'"
  }
}
lpm run hello
# hi from lpm

Or just lpm hellolpm falls through to scripts as a top-level command, like npm run shorthand.

Look around the global store

Every package LPM downloads goes into a single content-addressable store at ~/.lpm/store/. Subsequent installs across other projects reuse the same on-disk copy via clonefile (macOS) or hardlinks (Linux), so a fresh lpm install of the same dep set is essentially free in disk and time.

lpm store verify        # fast structural check (pass --deep for lockfile-backed SRI verify)
lpm cache prune         # preview orphan entries no project references
lpm cache prune --apply # actually remove them

See Content-addressable store for the design.

What now