en

Configuration

pcpm.json, environment variables, and feed configuration.

PCPM has three levels of configuration, in increasing order of precedence:

  1. Workspace pcpm.json — committed to your repo. Shared with the team.
  2. Environment variables — for machine-local overrides.
  3. CLI flags — for one-off invocations.

pcpm.json

A typical pcpm.json looks like this:

{
  "version": "1.0",
  "store": {
    "path": null,
    "auto": true
  },
  "feeds": [
    {
      "name": "nuget.org",
      "url": "https://api.nuget.org/v3/index.json"
    }
  ],
  "updateCheck": true,
  "lockfile": {
    "floating": "pin"
  }
}

Schema

FieldTypeDefaultWhat it does
versionstring"1.0"Schema version. Bumped on breaking changes.
store.pathstring | nullnull (auto-detect)Override the store location.
store.autobooleantrueLet PCPM choose the store location.
feedsFeedConfig[][nuget.org]NuGet feeds to query.
feeds[].namestringrequiredDisplay name.
feeds[].urlstringrequiredNuGet v3 index URL.
feeds[].credentialsobject?nullOptional auth (see below).
updateCheckbooleantrueCheck for newer PCPM versions on install.
lockfile.floating"pin"|"follow""pin"How to resolve floating version ranges.
dotnetstring?nullPath to the dotnet executable.
msbuildobject?nullMSBuild integration options.

Feed authentication

For private feeds, set credentials per feed:

{
  "feeds": [
    {
      "name": "private",
      "url": "https://pkgs.contoso.com/v3/index.json",
      "credentials": {
        "username": "ci-bot",
        "tokenEnv": "PCPM_FEED_TOKEN"
      }
    }
  ]
}

tokenEnv is the name of an environment variable that holds the token. The token is read at runtime; it is never written to pcpm.json or to the lockfile.

Environment variables

VariableEquivalent in pcpm.jsonNotes
PCPM_STORE_PATHstore.pathOverride the store location.
PCPM_FEED_TOKENper-feed credentials.tokenEnvDefault token env name.
PCPM_DOTNET_PATHdotnetPath to the dotnet binary.
PCPM_NO_UPDATE_CHECKupdateCheck: falseSet to 1 to disable.
PCPM_LOG_LEVEL(none)quiet, normal, verbose.
PCPM_COLOR(none)auto, always, never.

CLI flags

Most commands support a small set of one-off flags:

FlagEffect
--no-colorDisable ANSI colour output.
--quiet / -qSuppress non-error output.
--verbose / -vPrint every resolver decision.
--cwd <path>Run as if pcpm was invoked from <path>.
--config <path>Use a different pcpm.json file.

Per-project overrides

For most workspaces, pcpm.json is enough. For unusual layouts — e.g. a single repo that contains two workspaces — you can put a pcpm.json in any subdirectory. PCPM walks up from the current working directory until it finds one.

Validation

pcpm config validate checks your pcpm.json against the schema and reports any issues. Run it after a hand edit.

Migrating from an older version

When PCPM’s pcpm.json schema changes, the migration is automatic: on pcpm install, the loader upgrades your file in place. If the upgrade is non-trivial (a field was removed, the shape changed), the loader writes a .bak first and prints a warning. Read the warning, commit the new file, push.