# lpm remove (/docs/packages/remove)



```bash
lpm remove <package>   # alias: lpm rm
```

Cleans up the on-disk artifacts of an [`lpm add`](/docs/packages/add) invocation by reading the project-local `.lpm/added-sources.json` manifest that `lpm add` writes. Exact tracked files are removed from whatever path they were copied to, then LPM CLI cleans up any package skills it installed.

This is the &#x2A;*reverse of [`lpm add`](/docs/packages/add)** for source-delivered packages on LPM.dev Registry, npm, or a private registry routed via `.npmrc`. To remove a runtime dependency from `package.json` and `node_modules`, use [`lpm uninstall`](/docs/packages/uninstall).

## Scope [#scope]

`lpm remove` accepts the same package identity you passed to [`lpm add`](/docs/packages/add): bare npm names (`lodash.merge`), scoped registry packages (`@scope/private-pkg`), and LPM.dev Registry packages (`@lpm.dev/owner.ui-kit`). For legacy LPM.dev Registry cleanup, the short remove-only form (`owner.ui-kit`) still works too.

```bash
lpm remove lodash.merge
lpm remove @scope/private-pkg
lpm remove @lpm.dev/owner.ui-kit
lpm rm owner.ui-kit                 # short form
```

## What it removes [#what-it-removes]

For a tracked package, the command:

1. Removes the exact file paths recorded in `.lpm/added-sources.json` when `lpm add` copied the source files.
2. Prunes now-empty parent directories under the project root.
3. Removes `.lpm/skills/<owner>.<name>/` if the add installed package-published skills. Current installs do not create editor links for package skills; cleanup also removes links left by older LPM CLI versions.

That manifest-backed path means custom `--path` installs are reversible now — if you ran `lpm add source-pkg --path ./src/vendor`, `lpm remove source-pkg` removes the tracked files from `src/vendor` rather than guessing from framework defaults.

For older projects added before `.lpm/added-sources.json` existed, `lpm remove` falls back to the legacy heuristic scan of canonical directories such as `components/`, `src/components/`, `lib/`, `src/lib/`, `Sources/`, and `Packages/LPMComponents/Sources/`. That fallback can still miss custom pre-manifest installs.

There is still no dedicated `--dry-run` or "show me the tracked paths" flag. If you need to inspect what a manifest-backed remove will target, read `.lpm/added-sources.json` in the project root.

The command exits successfully even when no files were found, with a warning naming the package — useful for idempotent CI cleanup, but it also means a typo'd name fails silently.

## See also [#see-also]

* [`lpm add`](/docs/packages/add) — the forward direction
* [`lpm uninstall`](/docs/packages/uninstall) — remove a runtime dependency
