The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Pkgdiet listing page.
Put your node_modules on a diet.
PkgDiet is a proactive dependency governance tool that helps you find unused dependencies, analyze package health, and reduce node_modules size. It doesn't just ask "is it safe?" — it asks "is it optimal?"
Our Vision: PkgDiet's mission is to become an open standard for dependency intelligence in AI-assisted software development. Our goal is simple: whenever a developer, CI pipeline, or compatible AI agent needs to evaluate, install, replace, or audit a dependency, PkgDiet should provide trusted, machine-readable insights through transparent, opt-in integrations.
Run it instantly in any Node.js project (no installation required):
To clean up unused dependencies automatically:
PkgDiet scans your codebase's AST and NPM registry data in seconds to give you a pristine, actionable report:
dayjs instead of moment, picocolors instead of chalk).pkgdiet check <package> to evaluate a library before adding it to your project.npx pkgdiet mcp-installpkgdiet ci to parse package-lock.json diffs in GitHub Actions and block PRs that introduce unhealthy dependencies.PkgDiet works out of the box with zero configuration. However, teams can enforce custom policies by running npx pkgdiet init to generate a .pkgdietrc.json:
By default, PkgDiet writes anonymous, purely local usage metrics to a .pkgdiet-metrics.json file in your repository to track the amount of time and disk space saved. No data is ever sent off your machine. You can disable this local logging entirely by adding "telemetry": false to your .pkgdietrc.json or by setting the PKGDIET_TELEMETRY_DISABLED=1 environment variable.
| Command | Description |
|---|---|
npx pkgdiet | Run full repository audit |
npx pkgdiet --fix | Preview unused dependencies and apply approved removals |
npx pkgdiet check <pkg> | Check health/size of a single package |
npx pkgdiet init | Generate config and GitHub Actions workflows |
npx pkgdiet ci | Run PR gate checks based on lockfile diffs |
npx pkgdiet mcp | Start the JSON-RPC server for AI agents |
npx pkgdiet mcp-install | Auto-configure MCP for Claude Desktop |
MIT © Om Tajne