pnpm plugin

February 10, 2024 ยท View on GitHub

Zsh aliases for common pnpm commands.

Installation

Oh My Zsh

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

Zinit

Add script bellow to your ~/.zshrc

zinit light ntnyq/omz-plugin-pnpm

Other

PRs are welcome!

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
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
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
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
pfpnpm -r --filterUse filter in monorepo root directory
prepnpm run previewRun the preview script defined in package.json
prpnpm run releaseRun the release script defined in package.json

CHANGELOG

2022-12-10

  • New aliase
    • pw* for workspace action

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.