Configuration
pcpm.json, environment variables, and feed configuration.
PCPM has three levels of configuration, in increasing order of precedence:
- Workspace
pcpm.json— committed to your repo. Shared with the team. - Environment variables — for machine-local overrides.
- 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
| Field | Type | Default | What it does |
|---|---|---|---|
version | string | "1.0" | Schema version. Bumped on breaking changes. |
store.path | string | null | null (auto-detect) | Override the store location. |
store.auto | boolean | true | Let PCPM choose the store location. |
feeds | FeedConfig[] | [nuget.org] | NuGet feeds to query. |
feeds[].name | string | required | Display name. |
feeds[].url | string | required | NuGet v3 index URL. |
feeds[].credentials | object? | null | Optional auth (see below). |
updateCheck | boolean | true | Check for newer PCPM versions on install. |
lockfile.floating | "pin"|"follow" | "pin" | How to resolve floating version ranges. |
dotnet | string? | null | Path to the dotnet executable. |
msbuild | object? | null | MSBuild 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
| Variable | Equivalent in pcpm.json | Notes |
|---|---|---|
PCPM_STORE_PATH | store.path | Override the store location. |
PCPM_FEED_TOKEN | per-feed credentials.tokenEnv | Default token env name. |
PCPM_DOTNET_PATH | dotnet | Path to the dotnet binary. |
PCPM_NO_UPDATE_CHECK | updateCheck: false | Set 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:
| Flag | Effect |
|---|---|
--no-color | Disable ANSI colour output. |
--quiet / -q | Suppress non-error output. |
--verbose / -v | Print 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.