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
| Flag | Effect |
|---|---|
<package> | The package id to inspect. |
--all-paths | Show every chain, even redundant ones. |
--shortest | Show only the shortest chain. |
--json | Output 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
pcpm list— the full table.- Dependency resolution — how chains are computed.