pcpm install
Resolve, materialise, hardlink, restore.
pcpm install is the workhorse command. It runs after every
change to the workspace and is the right command to reach for
when in doubt.
pcpm install [options]
What it does
- Reads
Directory.Packages.propsand every.csprojin the workspace. Builds the union of direct dependencies. - Resolves the transitive graph with the algorithm described in Dependency resolution. Pure BFS with union-of-constraints.
- For each resolved package, queries the feed and downloads the
.nupkg(if not already in the store). - Hashes the package, moves it into the content-addressable store under its SHA-256.
- Hardlinks the extracted package tree from the store into
~/.nuget/packages/<id>/<version>/. - Updates
pcpm.lockwith the resolved graph and content hashes. - Runs
dotnet restoreagainst the materialised layout.
Options
| Flag | Effect |
|---|---|
--frozen | Don’t update pcpm.lock; fail if it’s stale. |
--no-restore | Skip the dotnet restore step at the end. |
--no-hardlink | Copy instead of hardlink (useful for debugging). |
--parallel <n> | Number of concurrent feed downloads. Default: 8. |
--offline | Don’t hit the network. Fail if the store is missing anything. |
--force | Re-resolve and rewrite pcpm.lock even if it looks current. |
Examples
# The everyday command — warm restore
pcpm install
# Cold install (no network)
pcpm install --offline
# CI build that doesn't need dotnet restore at the end
pcpm install --no-restore
Performance
The first pcpm install against a clean store downloads every
package and hashes it. Subsequent runs are bounded by:
- Feed queries (one HTTP request per package, but with caching).
- Hardlink creation (microseconds per package).
dotnet restore(unchanged from a non-PCPM workflow).
On a 50-project solution with 200 unique packages:
| Scenario | Time |
|---|---|
| Cold (empty store) | 30-60s |
| Warm (everything cached) | 2-4s |
| Warm + small change | 2-3s |
The “warm” case is what CI gets when the store is cached between runs. See CI integration for the cache configuration.
Exit codes
pcpm install exits with:
0on success.1on resolution conflict (see Dependency resolution).3on network error (feed unreachable).4on lockfile validation error (only with--frozen).
See also
pcpm ci— strict CI variant.- Content-addressable store — the storage layer that makes this fast.