CLI overview
Every PCPM command at a glance, with its purpose and most common flags.
PCPM exposes a small set of verbs. Each one has a focused job; the descriptions here are one-paragraph summaries, with full details on the dedicated page.
Workspace lifecycle
pcpm init— Initialise a workspace (pcpm.json,Directory.Packages.props).pcpm convert— Migrate an existing solution (with or without CPM) into a PCPM workspace.
Dependencies
pcpm add <pkg>— Add a direct dependency. Writes the version toDirectory.Packages.props, adds<PackageReference />to one or more.csprojfiles, and (by default) runspcpm install.pcpm install— Resolve the transitive graph, materialise packages into the store, hardlink to~/.nuget/packages, and rundotnet restore.pcpm remove <pkg>— Remove a direct dependency. Inverse ofpcpm add.pcpm list— Pretty-printpcpm.lockas a Spectre.Console table.pcpm why <pkg>— Show the chains of dependents that pulled<pkg>into the lockfile.
Maintenance
pcpm outdated— Query the feed for newer versions, report the bump type (major / minor / patch).pcpm audit— Scan the resolved graph against known vulnerability advisories.pcpm doctor— Diagnose common environment issues — store integrity, dotnet SDK detection, feed reachability.
Store
pcpm store status— Disk usage of the global content-addressable store.pcpm store path— Print the store path.pcpm store prune(reserved for a future release) — drop hashes that aren’t referenced by any lockfile.
CI
pcpm ci— Strict, fail-fast install — refuses ifpcpm.lockis stale or missing.
Common flags
Most commands accept a small set of flags:
| Flag | Effect |
|---|---|
--cwd <path> | Run as if pcpm was invoked from <path>. |
--config <path> | Use a different pcpm.json file. |
--quiet / -q | Suppress non-error output. |
--verbose / -v | Print every resolver decision. |
--no-color | Disable ANSI colour output. |
--help / -h | Show command-specific help. |
Conventions
<pkg>is a placeholder for a package id (e.g.Serilog).<version>is a placeholder for a version range, in the same syntax as<PackageReference />in CPM. e.g.3.1.1,[3.0.0, 4.0.0),3.0.*.- Commands are case-insensitive in their first word
(
PCPM initandpcpm initare the same). - Flags can be combined after a single
--. e.g.pcpm add Serilog --version 3.1.1 --no-install.
Exit codes
PCPM uses a small set of exit codes:
| Code | Meaning |
|---|---|
| 0 | Success. |
| 1 | Resolution or installation error. |
| 2 | Invalid arguments or configuration. |
| 3 | Network error (feed unreachable). |
| 4 | Lockfile validation error (used by pcpm ci). |
| 64 | Internal error (please open an issue). |
dotnet run propagates these. CI scripts can rely on them.