lpm store
Find, verify, or reset the shared package store.
Use lpm store to find, verify, or remove the shared package store on your computer.
lpm store path [--json]
lpm store verify [--deep] [--fix] [--json]
lpm store clean [--json]The --deep and --fix flags must follow verify. LPM CLI rejects --deep and --fix with path or clean.
Quickstart
Run a fast verification of every store version:
lpm store verifyChoose an action
| Action | What it does | Use case |
|---|---|---|
path | Prints the root of the shared store | You need the store path for inspection or a script |
verify | Verifies v1, v2, and v3 store data | An install reports a store error, or you want an integrity check |
clean | Immediately removes all v1, v2, and v3 store data | You need a complete reset and accept new downloads and builds |
What the shared store does
LPM CLI saves package data in ~/.lpm/store/. Projects link to this shared data instead of keeping a separate package cache.
The store reduces repeat downloads and duplicate data across projects. It also contains package security caches and reusable native-build artifacts.
A store version identifies the layout of saved data. It does not identify a package version or the lpm.lock format.
Store versions
| Version | Status | Layout | How to select it | Use case |
|---|---|---|---|---|
| v1 | Legacy | One complete directory for each package name and version | LPM_STORE_VERSION=v1 | Use it only for compatibility with the legacy layout |
| v2 | Default | Shared package objects with dependency layouts for each project graph | No setting is necessary | Use it for normal development and CI |
| v3 | Experimental | Reusable file blobs, package-tree records, and v2-style dependency layouts | LPM_STORE_VERSION=v3 | Use it to test the experimental file-level store |
v1
The v1 store keeps each extracted package under ~/.lpm/store/v1/<name>@<version>/. It reuses matching package names and versions.
v1 is the legacy layout. Select it only for compatibility or downgrade testing.
v2
The v2 store keeps package content in shared objects. It also keeps separate link entries for different dependency graphs.
Two projects can reuse the same package content. Each project can still have the dependency layout that its lockfile requires.
v2 is the current default. An unset or empty LPM_STORE_VERSION value selects v2.
v3
The v3 store divides package trees into reusable file blobs. Tree and source records describe how LPM CLI reconstructs each package.
Identical files can share stored data across different packages. v3 retains the dependency-link model from v2.
v3 is experimental. LPM CLI never selects it automatically.
Select a version for an install
Set LPM_STORE_VERSION for the install command:
LPM_STORE_VERSION=v1 lpm install # use the legacy layout
LPM_STORE_VERSION=v3 lpm install # use the experimental layoutThe values 1, 2, and 3 are aliases for v1, v2, and v3. An unknown value produces a warning and selects v2.
lpm.json cannot select a store version. The LPM_STORE_VERSION environment variable is the only current selector.
The three versions can exist at the same time. lpm store verify and lpm store clean always act on all three versions.
Recipes
Print the store path
lpm store pathIf a diagnostic tool or script needs the active store root, use this command.
Run a fast verification
lpm store verifyThe fast verification examines package directories, manifests, link metadata, object references, and v3 store metadata.
Run a deep verification
Run this command from a project root:
lpm store verify --deepDeep verification parses each package.json. It compares package names and versions with their store entries.
If the current directory contains lpm.lock, deep verification compares its integrity values with the saved values. It also rehashes v3 file blobs.
If lpm.lock is absent, LPM CLI skips the lockfile comparison. If the file is invalid or unreadable, verification fails.
Refresh security caches
lpm store verify --fix--fix implies deep verification. It refreshes missing or stale .lpm-security.json files.
--fix does not restore missing packages or repair manifests and integrity errors. LPM CLI reports these errors for separate recovery.
Use verification in CI
lpm store verify --deep --json > store-report.jsonIf LPM CLI finds corruption, it writes the JSON report and then exits with status 1.
Inspect v3 orphan counts
lpm store verify --jsonRead the cas.orphaned_* fields for unreachable v3 data. Verification reports this data but does not remove it.
Preview orphan removal
lpm cache prune # preview removals
lpm cache prune --apply # apply the removal planlpm cache prune uses project references to retain required store entries. The preview does not remove data.
Verification levels
| Command | Package and link structure | package.json contents | lpm.lock integrity | v3 blob hashes | Security cache |
|---|---|---|---|---|---|
lpm store verify | Verifies | Does not parse | Does not compare | Does not rehash | Does not analyze |
lpm store verify --deep | Verifies | Parses and compares | Compares with the current lockfile | Rehashes | Reports missing or stale caches |
lpm store verify --fix | Verifies | Parses and compares | Compares with the current lockfile | Rehashes | Reports and refreshes missing or stale caches |
JSON output
Use the global --json flag with each action. Each action returns a different JSON object.
path output
lpm store path --json{
"success": true,
"path": "/Users/you/.lpm/store"
}| Field | Type | Meaning |
|---|---|---|
success | Boolean | true after LPM CLI resolves the store path |
path | String | Absolute path to the store root |
verify output
This example shows a successful deep verification:
lpm store verify --deep --json{
"success": true,
"check_kind": "lockfile_marker_consistency",
"legacy_check_kind": "lockfile_marker_consistency",
"bytes_integrity_recomputed": true,
"entries_verified": 32,
"verified": 32,
"unique_coords": 30,
"duplicated_entries": 2,
"corrupted": 0,
"issues": [],
"securityMismatches": 1,
"securityReanalyzed": 0,
"cas": {
"check_kind": "content_hash",
"sources": 8,
"trees": 8,
"blobs": 240,
"blobs_rehashed": 240,
"materialized": 8,
"orphaned_sources": 0,
"orphaned_trees": 0,
"orphaned_blobs": 0,
"orphaned_materialized": 0,
"blob_integrity_recomputed": true
}
}Verification fields
| Field | Type | Meaning |
|---|---|---|
success | Boolean | If issues contains a corruption or write error, this value is false |
check_kind | String | Compatibility alias for legacy_check_kind |
legacy_check_kind | String | presence for fast verification or lockfile_marker_consistency for deep verification |
bytes_integrity_recomputed | Boolean | true after deep verification rehashes at least one v3 blob |
entries_verified | Integer | Number of store entries that completed verification without corruption |
verified | Integer | Compatibility alias for entries_verified |
unique_coords | Integer | Number of unique package name and version pairs |
duplicated_entries | Integer | Entries repeated across store versions or dependency graphs |
corrupted | Integer | Number of corruption or write errors in issues |
issues | String array | Error messages for failed verification work |
securityMismatches | Integer | Missing or stale security caches found by deep verification |
securityReanalyzed | Integer | Security caches that --fix refreshed successfully |
cas | Object | v3 file-store verification results |
securityMismatches and securityReanalyzed appear only during deep verification. A security mismatch alone does not set success to false.
v3 cas fields
| Field | Type | Meaning |
|---|---|---|
check_kind | String | metadata for fast verification or content_hash for deep verification |
sources | Integer | v3 source records examined |
trees | Integer | v3 package-tree records examined |
blobs | Integer | v3 file blobs examined |
blobs_rehashed | Integer | v3 file blobs rehashed during deep verification |
materialized | Integer | Reconstructed v3 package trees examined |
orphaned_sources | Integer | Source records that no live store relationship reaches |
orphaned_trees | Integer | Package-tree records that no live source reaches |
orphaned_blobs | Integer | File blobs that no live package tree reaches |
orphaned_materialized | Integer | Reconstructed package trees that no live source reaches |
blob_integrity_recomputed | Boolean | true after deep verification rehashes at least one v3 blob |
clean output
CAUTION: This command removes all store versions without a confirmation prompt.
lpm store clean --json{
"success": true,
"removed_bytes": 1048576,
"removed": "1.0 MB",
"path": "/Users/you/.lpm/store/v1",
"v1_path": "/Users/you/.lpm/store/v1",
"v2_path": "/Users/you/.lpm/store/v2",
"v3_path": "/Users/you/.lpm/store/v3",
"v1_removed_bytes": 0,
"v2_removed_bytes": 1048576,
"v3_removed_bytes": 0
}| Field | Type | Meaning |
|---|---|---|
success | Boolean | true after the clean action completes |
removed_bytes | Integer | Total bytes removed from v1, v2, and v3 |
removed | String | Formatted value of removed_bytes |
path | String | Compatibility alias for v1_path |
v1_path | String | Absolute path of the removed v1 directory |
v2_path | String | Absolute path of the removed v2 directory |
v3_path | String | Absolute path of the removed v3 directory |
v1_removed_bytes | Integer | Bytes removed from v1 |
v2_removed_bytes | Integer | Bytes removed from v2 |
v3_removed_bytes | Integer | Bytes removed from v3 |
Reset the complete store
CAUTION: If you need a complete reset, use
lpm store clean. The command removes all store versions without a confirmation prompt.
lpm store clean
lpm installThe clean action removes package data, link entries, security caches, and native-build artifacts. It retains the outer ~/.lpm/store/ directory.
The next install downloads or rebuilds the required packages. For normal cleanup, use the reference-aware lpm cache prune command.
If verification reports corruption, first run:
lpm cache prune --apply
lpm installIf the error remains, use lpm store clean for a complete reset.
Concurrent operations
Verification can run with other read-only store operations. If another command changes or removes store data, verification waits.
The clean action waits for installs and other store readers to finish. New store readers wait while a clean action is queued.
After one second, a waiting command prints Waiting for another lpm store operation to finish.... LPM CLI releases its locks automatically.
Flags
| Flag | Applies to | Effect |
|---|---|---|
--deep | verify | Parses manifests, compares lockfile integrity, and rehashes v3 blobs |
--fix | verify | Refreshes missing or stale security caches and implies --deep |
--json | All actions | Prints the action result as JSON |
See the global flags.
See also
lpm cache prune— preview or remove unreferenced store data- Content-addressable store — understand the package storage model
lpm rebuild— reuse or refresh native-build artifactslpm doctor— inspect store health with other project checks