Installation
Better PM can be installed via Homebrew (recommended) or npm. After installation, you’ll set up shell integration to enable features likepm cd.
System Requirements
- Operating System: macOS (arm64/x64) or Linux (x64/arm64)
- Shell: zsh or bash (for shell integration)
- Node.js: Not required for Homebrew install; v16+ required for npm install
Install with Homebrew
Recommended: Homebrew installs a native binary, so shell completions resolve in ~60ms. The npm version uses Node.js and is slightly slower.
0.3.3 or later.
Install with npm
If you prefer npm or don’t have Homebrew:The npm installation includes optional native binaries for your platform (
better-pm-darwin-arm64, better-pm-linux-x64, etc.) to improve performance.Shell Integration
Shell integration is required forpm cd to work properly. The pm activate command outputs shell wrapper functions and completions.
Generate shell integration code
Run the activate command for your shell:This outputs shell code that wraps the
pm command and adds completions.What the Shell Wrapper Does
Thepm activate command generates a shell function that intercepts pm cd commands:
pm cd.
Verify Installation
Confirm everything is working:Test package manager detection
Navigate to any project with a lockfile and run:Better PM should detect your package manager automatically.
Troubleshooting
Permission Issues
If you getEACCES errors with npm global install:
Completion Conflicts
If completions don’t work, check for conflicts with other completion systems:Next Steps
Quickstart Guide
Learn the basic commands and try your first workflow