Pastoralist gives you more control over your dependencies by giving you more control and security over them. It does this by managing your project's overrides with context. Pastoralist stores when overrides were added, why they are there, and what still depends on them.
Packages you install bring dependencies of their own. Overrides let you set a different version of a packageβfor example, to address a security issue.
This project depends on express, which depends on qs. Running npx pastoralist adds the lines marked with +:
{
"name": "shepherd-cli",
"dependencies": {
"express": "4.18.2"
},
"overrides": {
"qs": "6.11.2"
+ },
+ "pastoralist": {
+ "appendix": {
+ "qs@6.11.2": {
+ "dependents": {
+ "shepherd-cli": "qs (required by express)"
+ },
+ "ledger": {
+ "addedDate": "2026-10-16"
+ }
+ }
+ }
}
}Install Pastoralist as a dev dependency and run it from your project root.
npm install pastoralist --save-dev
npx pastoralist doctor
npx pastoralistdoctor previews changes. Running pastoralist updates the appendix.
Install the bundled agent skill with npx pastoralist init agent-skill.
Use npx pastoralist --setup-hook to add it to postinstall.
See the setup guide for install hooks and workspace settings.
Use npx pastoralist with a project install, or install the CLI globally with
npm install --global pastoralist. See the CLI reference for all commands and options.
In an npm project, reads overrides from package.json and updates the appendix.
Use --dry-run to preview the changes.
pastoralist --dry-runPrints CLI help or the installed package version.
pastoralist --help
pastoralist --version # -vOpens an interactive radio menu for exploring the Pastoralist DX components
without reading or changing project configuration. Use the arrow keys and Enter
to choose a demo. In the prompt demo, Space toggles choices, a selects all,
n selects none, and Esc cancels.
pastoralist --styleguidePreviews the appendix update and prints a summary.
pastoralist doctor
pastoralist doctor --outputFormat jsonStarts the config wizard. The wizard can save config to package.json or an
external config file, configure workspace paths, and set up security scanning.
pastoralist initInstalls the bundled Pastoralist agent skill into
.agents/skills/pastoralist. Existing unmanaged skill files are preserved.
pastoralist init agent-skillPastoralist detects the project manifest by default. Use --path to select one.
pastoralist --path packages/app/package.json # -p packages/app/package.jsonType:
string option
Sets the root directory used to resolve relative paths, config files, lockfiles, patches, and workspace globs.
pastoralist --root ../my-project # -r ../my-projectType:
string[] option
Scans additional package manifests for monorepo dependency context. Values are collected until the next flag.
pastoralist --depPaths "packages/*/package.json" # -d "packages/*/package.json"Type:
string[] option
Excludes package manifests from --depPaths matching.
pastoralist --ignore "**/node_modules/**"Enables debug logging for CLI execution.
pastoralist --debugPreviews changes to project files. Security providers may still write caches.
pastoralist --dry-runType:
"text" | "json" optionDefault:"text"
Selects terminal output or a single machine-readable JSON result.
pastoralist --dry-run --outputFormat jsonJSON output includes result status, findings, applied overrides, and metrics.
{
"success": true,
"updated": false,
"overrideCount": 1
}Prints the metrics table after a text-mode run.
pastoralist --summarySuppresses normal text output for CI. Security findings make the command exit
with code 1; clean security checks exit with code 0.
pastoralist --quiet --checkSecurity # -q --checkSecurityAdds pastoralist to the target manifest's postinstall script. Existing
postinstall scripts are appended with && pastoralist.
pastoralist --setup-hookKeeps the appendix current after package installs:
{
"scripts": {
- "postinstall": "build"
+ "postinstall": "build && pastoralist"
}
}Removes verified unused override entries from the active override source and
appendix. Preview first with --dry-run.
pastoralist --remove-unusedRuns vulnerability scanning before the appendix update. Fixable security findings can add override data and security ledger fields.
pastoralist --checkSecurityApply fixes with --interactive or --forceSecurityRefactor.
Type:
"osv" | "github" | "snyk" | "npm" | "socket" | "spektion" | string[] option
Chooses one or more security providers. OSV is the default when security is enabled and no provider is set.
pastoralist --checkSecurity --securityProvider osvType:
string option
Passes a provider token for a single run. Prefer provider environment variables
for CI: GITHUB_TOKEN, SNYK_TOKEN, SOCKET_SECURITY_API_KEY, or
SPEKTION_API_KEY.
pastoralist --checkSecurity --securityProvider github --securityProviderToken "$GITHUB_TOKEN"pastoralist --checkSecurity --interactive # Scans for vulnerabilities and asks which fixes to apply.
pastoralist --checkSecurity --forceSecurityRefactor --strict # Applies available transitive fixes automatically and fails if vulnerabilities remain or a provider denies access.
pastoralist --checkSecurity --hasWorkspaceSecurityChecks # Scans root and workspace dependencies for vulnerabilities.Direct dependency updates require interactive approval. Forced transitive fixes may cross major versions and parent ranges. Overrides select the lowest known patched version resolving the advisories. Reinstall dependencies and rescan after fixes.
Type:
string | number | boolean options
Controls provider cache behavior. --cache-dir changes the cache directory,
--cache-ttl sets TTL seconds, --no-cache bypasses reads and writes, and
--refresh-cache bypasses reads while writing fresh data.
pastoralist --checkSecurity --cache-dir .cache/pastoralist
pastoralist --checkSecurity --cache-ttl 3600
pastoralist --checkSecurity --no-cache
pastoralist --checkSecurity --refresh-cacheTo preview the appendix from a script, pass your parsed manifest and its path to update().
import { resolveJSON, update } from "pastoralist";
const path = "./package.json";
const config = resolveJSON(path);
if (!config) throw new Error(`Could not read ${path}`);
const { finalAppendix } = update({ config, path, dryRun: true, outputFormat: "json" });
process.stdout.write(JSON.stringify(finalAppendix ?? {}, null, 2) + "\n");See the Node.js API reference for more options and exports.
| Package manager | Install in your project | Where Pastoralist reads overrides |
|---|---|---|
| pnpm | pnpm add -D pastoralist |
overrides in pnpm-workspace.yaml (the default for pnpm 11+), or pnpm.overrides in package.json |
| Yarn | yarn add --dev pastoralist |
resolutions in package.json |
| Bun | bun add --dev pastoralist |
overrides in package.json |
For a standalone CLI, Homebrew users can run brew install yowainwright/tap/pastoralist.
In a standalone Python project, Pastoralist reads uv overrides
from pyproject.toml. This one pins urllib3 to version 2.8.0.
[tool.uv]
override-dependencies = ["urllib3==2.8.0"]Run pastoralist --dry-run to preview the appendix. If uv.lock shows that
requests depends on urllib3, running pastoralist records
urllib3 (required by requests) in .pastoralistrc.
If the repo also has a package.json, use pastoralist --path pyproject.toml to
track the Python overrides. With a JavaScript config file, set appendixSource
to a separate JSON file for the appendix.
uv tracking supports one global override per package. Workspace and scoped overrides, security scanning, automatic fixes, and removal are currently unsupported for uv.
Shout out to Mardin for the conversation, insight, and pairing around this topic.
Made by @yowainwright. MIT, 2022-2026.