omz-plugin-pnpm

February 15, 2025 ยท View on GitHub

oh-my-zsh aliases for common pnpm commands.

Installation

Oh My Zsh

  1. Clone the repository:
git clone --depth=1 https://github.com/ntnyq/omz-plugin-pnpm.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/pnpm
  1. Include it in your ~/.zshrc:
plugins=(... pnpm)

Zinit

Add script bellow to your ~/.zshrc

zinit light ntnyq/omz-plugin-pnpm

Others

PRs are always welcome!

Global scripts directory

This feature is copied from omz-plugin-yarn

Adding pnpm global scripts dir (commonly ~/Library/pnpm) to the $PATH.

To disable this feature, set the following style in your .zshrc:

zstyle ':omz:plugins:pnpm' global-path no

Aliases

AliasCommandDescription
ppnpmThe pnpm command
pexpnpm execExecute a shell command in scope of a project
pdxpnpm dlxFetch a package without installing, hotload and run it's command
papnpm addInstall a package in dependencies (package.json)
padpnpm add --save-devInstall a package in devDependencies (package.json)
prmpnpm removeRemove installed packages
plspnpm listList installed packages
pappnpm add --save-peerInstall a package in peerDependencies (package.json)
pgapnpm add --globalInstall packages globally on your operating system
pglspnpm list --globalList global installed packages
pgrmpnpm remove --globalRemove global installed packages from your OS
pgupnpm update --globalUpgrade packages installed globally to their latest version
pipnpm initInteractively creates or updates a package.json file
pinpnpm installInstall dependencies defined in package.json
pinfpnpm install --frozen-lockfileInstall dependencies defined in package.json without touching lockfile
prpnpm runRun a defined package script
prunpnpm runRun a defined package script
pstpnpm startRun the start script defined in package.json
plnpnpm run lintRun the lint script defined in package.json
pdocspnpm run docsRun the docs script defined in package.json
pfmtpnpm run formatRun the format script defined in package.json
pbpnpm run buildRun the build script defined in package.json
pdpnpm run devRun the dev script defined in package.json
psvpnpm run serveRun the serve script defined in package.json
ptpnpm testRun the test script defined in package.json
ptcpnpm test --coverageRun the test script defined in package.json with coverage
pupnpm updateUpdate packages to their latest version based on the specified range
puipnpm update --interactivePrompt for which outdated packages to their latest version based on the specified range
puilpnpm update --interactive --latestPrompt for which outdated packages to upgrade to the latest available version
pcpnpm createCreate a project from a create-* start kit
ppubpnpm publishPublish a package to the registry
pabpnpm approve-buildsApprove dependencies for running scripts during installation
pfpnpm -r --filterUse filter in monorepo root directory

CHANGELOG

2025-02-15

  • New aliases
    • pab for pnpm approve-builds

2024-05-23

  • New aliases
    • pinf for pnpm install --frozen-lockfile

2024-04-13

  • Features
    • Set PNPM_HOME environment variable to global bin dir

2024-03-13

  • New aliases
    • pui for pnpm update --interactive

2023-08-14

  • New aliases
    • pfmt for pnpm run format

2023-03-15

  • Features
    • Add pnpm global scripts dir to $PATH

2022-12-16

  • New aliases
    • pr for pnpm run

2022-09-24

  • New aliases
    • pf for pnpm -r --filter

2022-07-15

  • Removed aliases
    • pun for pnpm uninstall. Use prm instead.
    • px for pnpx. It's deprecated. Use pex and pdx instead.
    • pui for pnpm update --interactive. Use pu and puil instead.
    • pdoc for pnpm run doc. Maybe rename your scripts to docs and use pdocs instead.
    • psv for pnpm server.
    • ph for pnpm help.
    • pout for pnpm outdated.
    • pau for pnpm audit.
    • pwhy for pnpm why.
  • Changed aliases
    • pup for pnpm update has been renamed to pu.
    • ps for pnpm run serve has been renamed to psv. See issue #6
  • New aliases
    • pex for pnpm exec.
    • pdx for pnpm dlx.