pnpm Cheat Sheet
A fast, disk-efficient package manager with strict dependency resolution and great monorepo support.
Build & Package3 sections · 19 commands
⌘K
Installing
8pnpm installInstall with a frozen lockfile when present
pnpm add PACKAGEAdd a dependency
pnpm add -D PACKAGEDev dependency
pnpm dlx PACKAGERun without installing (npx-like)
pnpm listInstalled tree (depth by flag)
pnpm why PACKAGEWhy is a package here
pnpm pruneRemove unused store entries
pnpm store pruneGlobal store cleanup
Workspaces
6pnpm -r buildRun a script in all packages
pnpm --filter app buildOne workspace only
pnpm --filter app --filter lib testMultiple filters
pnpm -r --filter './packages/**' testFilter by glob
pnpm add PACKAGE --filter appAdd into one package
pnpm allShorthand for -r
Scripts
5pnpm runList scripts
pnpm run buildRun a script
pnpm devShortcut for a dev script
pnpm env use --global 20Install a Node version
pnpm approve-buildsAccept postinstall scripts