Source code delivery

Own the code you install

lpm add copies a package's source files into your project. Pick the options the author offers, then edit the code like your own.

npm install -g @lpm-registry/cli
Read the docs

Two commands, two jobs

lpm add copies files that you then own. lpm install adds a dependency that the resolver manages.

Copy it with lpm add

The files land in your project, where you edit them. To take a new version, you run lpm add again and review the changes.

Depend on it with lpm install

The package goes to node_modules as a dependency, and the resolver manages its versions. To change it, you wrap it, configure it or fork it.

Options you choose before any file is written

Authors declare options in lpm.config.json, such as a styling framework or a set of components. The LPM CLI asks for each one.

Styling framework
Components
The commandlpm add "@lpm.dev/acme.ui-kit?component=button,dialog&styling=panda"The files it copies
src/components/ui/+button.tsx+dialog.tsx+theme/recipes.ts+lib/cn.ts
The dependencies it adds
@pandacss/dev

Try a package's options

Pick a styling framework and the components you want. The command, the files and the dependencies follow your answers.

In a terminal
lpm add asks for each option that the command doesn't set.
In one line
Put the answers in the package spec to skip the prompts, or pass --yes to use the author's defaults.
Files
The LPM CLI copies only the files that match your answers.
Dependencies
It adds the matching ones to package.json and installs them. --no-install-deps leaves package.json alone.
Read the source delivery docs

Code that fits your project

lpm add takes a package from where it is published and writes it the way your project is set up.

From any registry

lpm add copies a package from the LPM.dev Registry, npm, or a private registry in your .npmrc. A public npm package needs no LPM account.

Imports rewritten

The LPM CLI rewrites the author's import alias and relative imports to fit your project. --alias sets the alias yourself.

A plain copy, too

A package without lpm.config.json gets a plain copy. The LPM CLI lists the external imports the code uses, so you can check that your project has them.

Undone if it fails

If the copy, the package.json change or the dependency install fails, the LPM CLI puts your files, package.json and lockfiles back as they were.

Updates on your terms

Delivered files don't update on their own. You decide when to take a new version.

Take a new version when you choose

Run lpm add for the package again. --dry-run shows what would change before anything is written.

Files you left alone
The LPM CLI replaces them with the new version.
Files you edited
They stay as they are. In a terminal, the LPM CLI asks whether to keep or overwrite each one, and can show you the diff first.
Your call
--force overwrites existing files without asking.
Read the source delivery docs

Take a package out

lpm-sources.json records the files each add wrote, so lpm remove knows which files belong to the package.

Files you edited
They stay in your project.
The record
Commit lpm-sources.json with your project.
Read the lpm remove reference

For authors

One lpm.config.json at the root of your package tells the LPM CLI what to ask, which files to copy and which dependencies to add.

One package, many variants

Put a condition on a file rule, and the LPM CLI skips the file when the answers don't match. Ship a variant for each provider, styling framework or feature.

Dependencies that follow the answers

List the packages each answer needs, from npm, the LPM.dev Registry or a private registry. Only the matching ones reach package.json.

Private, Free, Pool or Marketplace

A source package can use any distribution mode. Sell a UI kit on the Marketplace, put it in the Pool, or keep it private for your organization.

Learn more

Frequently asked questions

How is lpm add different from lpm install?

lpm install resolves a package and links it into node_modules as a dependency. lpm add copies the package's files into your project. Use lpm install for libraries you use as they are, and lpm add for code you want to change and review.

How are updates handled?

Delivered files don't update on their own. Run lpm add for the package again to take a new version, and add --dry-run to preview the changes first. The LPM CLI replaces the files you haven't edited and keeps the ones you have, unless you choose to overwrite them.

Can I change the delivered code?

Yes. The files are part of your project. The LPM CLI records what it delivered in lpm-sources.json, so lpm remove keeps every file you edited.

What if a package has no lpm.config.json?

lpm add makes a plain copy of the package's files and lists the external imports the code uses. It does not install dependencies.

Can I sell source packages?

Yes. A source package can be on the Marketplace or in the Pool. A buyer needs a current license to download a Marketplace source package, and lpm add copies its files into their project.

What about Swift packages?

Use lpm install for a Swift library. It adds the package to Package.swift or to your Xcode project, and Swift Package Manager resolves it.

Try it on a package you already use

Install the LPM CLI and run lpm add on any package. Add --dry-run to see the files first.

npm install -g @lpm-registry/cli
Read the docs