en

pcpm why

Show why a package is in the lockfile.

pcpm why <package> [options]

pcpm why answers a simple question: “Why is this package in my lockfile?” It walks the lockfile, finds every path that leads to <package>, and prints the chain of parents.

What it shows

For each direct dependency, pcpm why prints a tree:

Serilog@3.1.1
└─ apps/web/Api.csproj  (direct)
   └─ apps/web/Infrastructure/Logging.cs  (via using)

If the package is brought in transitively, the tree starts with a direct dependency and walks down.

Options

FlagEffect
<package>The package id to inspect.
--all-pathsShow every chain, even redundant ones.
--shortestShow only the shortest chain.
--jsonOutput as JSON.

Examples

# A surprising transitive bump
pcpm why System.Text.Json

# A package that was removed but is still in the lockfile
pcpm why Newtonsoft.Json

See also