en

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

  1. Reads Directory.Packages.props and every .csproj in the workspace. Builds the union of direct dependencies.
  2. Resolves the transitive graph with the algorithm described in Dependency resolution. Pure BFS with union-of-constraints.
  3. For each resolved package, queries the feed and downloads the .nupkg (if not already in the store).
  4. Hashes the package, moves it into the content-addressable store under its SHA-256.
  5. Hardlinks the extracted package tree from the store into ~/.nuget/packages/<id>/<version>/.
  6. Updates pcpm.lock with the resolved graph and content hashes.
  7. Runs dotnet restore against the materialised layout.

Options

FlagEffect
--frozenDon’t update pcpm.lock; fail if it’s stale.
--no-restoreSkip the dotnet restore step at the end.
--no-hardlinkCopy instead of hardlink (useful for debugging).
--parallel <n>Number of concurrent feed downloads. Default: 8.
--offlineDon’t hit the network. Fail if the store is missing anything.
--forceRe-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:

ScenarioTime
Cold (empty store)30-60s
Warm (everything cached)2-4s
Warm + small change2-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:

  • 0 on success.
  • 1 on resolution conflict (see Dependency resolution).
  • 3 on network error (feed unreachable).
  • 4 on lockfile validation error (only with --frozen).

See also