en

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 to Directory.Packages.props, adds <PackageReference /> to one or more .csproj files, and (by default) runs pcpm install.
  • pcpm install — Resolve the transitive graph, materialise packages into the store, hardlink to ~/.nuget/packages, and run dotnet restore.
  • pcpm remove <pkg> — Remove a direct dependency. Inverse of pcpm add.
  • pcpm list — Pretty-print pcpm.lock as 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 if pcpm.lock is stale or missing.

Common flags

Most commands accept a small set of flags:

FlagEffect
--cwd <path>Run as if pcpm was invoked from <path>.
--config <path>Use a different pcpm.json file.
--quiet / -qSuppress non-error output.
--verbose / -vPrint every resolver decision.
--no-colorDisable ANSI colour output.
--help / -hShow 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 init and pcpm init are 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:

CodeMeaning
0Success.
1Resolution or installation error.
2Invalid arguments or configuration.
3Network error (feed unreachable).
4Lockfile validation error (used by pcpm ci).
64Internal error (please open an issue).

dotnet run propagates these. CI scripts can rely on them.