Quickstart
This guide walks you through the most common Better PM workflows. After completing it, you’ll understand how to install dependencies, add packages, and navigate your monorepo efficiently.Make sure you’ve completed the installation and set up shell integration before continuing.
Your First Commands
Let’s start with the basics in any project with a lockfile.Install Dependencies
Better PM automatically detects your package manager and runs the appropriate install command.pnpm installif you havepnpm-lock.yamlbun installif you havebun.lockbnpm installif you havepackage-lock.json
Both
pm i and pm install work — use whichever you prefer.Add a Dependency
Add a package to your project:-D flag:
Remove a Dependency
Remove a package:Monorepo Workflows
Better PM shines in monorepo environments. Let’s explore the key features.List Workspace Packages
View all packages in your monorepo as a tree:The command is
pm pls (package list) to distinguish it from pm ls, which is a proxy for your package manager’s ls command (e.g., pnpm ls for listing installed dependencies).Navigate to a Package
Jump to any workspace package:Tab completion works for package names! Type
pm cd @my and press Tab to see suggestions.Scoped Installs
When you’re inside a workspace package,pm i automatically installs only that package:
pnpm install --filter "@myapp/web..."(pnpm)bun install --filter "@myapp/web"(bun)npm install --workspace @myapp/web(npm)
Root Install Safety
At the monorepo root,pm i shows a warning before installing everything:
Additional Commands
Better PM includes several proxy commands that pass through to your package manager.Run Scripts
Run a package.json script:Execute Packages
Run a package with npx/pnpx/bunx:Update Dependencies
Update packages interactively:Check Dependency Usage
See why a package is installed (pnpm/bun only):Other Proxy Commands
These commands work exactly like their package manager equivalents:pm ls— List installed dependencies (not workspace packages)pm link— Link a packagepm unlink— Unlink a package
Example Workflow
Here’s a complete workflow for working on a feature in a monorepo:Common Patterns
Install All Packages in CI
Add the Same Dependency to Multiple Packages
Clean Install a Specific Package
Next Steps
You now know the core Better PM commands! Here are some resources to explore:Commands Reference
Detailed documentation for every command
Monorepo Guide
Advanced monorepo workflows and best practices
Shell Integration
Set up shell completions and navigation
GitHub
View source code and contribute