unipm is an open-source CLI to manage dependencies in Node.js and Deno projects,
automatically using the right package manager (npm, pnpm, yarn, bun, deno)
based on your project. Stop worrying about which command to use in each repo:
unipm detects and runs it for you!
Linux / macOS:
curl -fsSL https://raw.githubusercontent.com/opticalsecurity/unipm/master/scripts/install.sh | bashWindows (PowerShell):
irm https://raw.githubusercontent.com/opticalsecurity/unipm/master/scripts/install.ps1 | iex- Download the latest binary for your platform from GitHub Releases
- Move the binary to a directory in your PATH:
- Linux/macOS:
/usr/local/binor~/.local/bin - Windows:
%LOCALAPPDATA%\unipmor any folder in your PATH
- Linux/macOS:
- Make it executable (Linux/macOS):
chmod +x unipm
Once installed, update to the latest version with:
unipm update-self# Install a dependency
unipm add react
# or shortcut
unipm i react
# Uninstall a dependency
unipm remove react
# or shortcut
unipm r react
# Install all project dependencies
unipm install
# or shortcut
unipm i
# Update dependencies
unipm update
# or shortcut
unipm uDuring any unipm command, press s to open the interactive package-manager switcher. It lets you pick a different package manager for the current run without changing project settings.
unipm automatically detects the package manager of a project with various methods, executed in this order:
- Manual override (from the interactive switcher)
preferredPackageManagerfield inunipm.config.jsonin the current working directorypackageManagerfield in package.json- Any supported lockfiles present
- Any supported package manager installed in the system (Priority: bun > deno > pnpm > yarn > npm)
While a command is running, press s to open a menu where you can temporarily select a different package manager for that invocation. The manual choice only applies to the current run; future commands fall back to the normal detection order unless you switch again.
You can configure unipm per project by adding an unipm.config.json file in the directory where you run the CLI. The file is optional; unipm falls back to auto-detection when a setting is missing.
{
"preferredPackageManager": "pnpm",
"debug": true,
"colors": false,
"ci": true
}preferredPackageManager: Forces unipm to use the specified package manager for the project.debug: Enables debug logging (can also be toggled with theDEBUGenvironment variable, which takes precedence).colors: Controls colored terminal output (overridden byNO_COLORorFORCE_COLORwhen set).ci: Enables CI-safe mode, which disables background update checks and interactive package-manager switching. TheCIenvironment variable wins if set.
Environment variables always take precedence over config values, so you can temporarily override a project's defaults without changing the file.
- When
ciresolves totrue, unipm disables background update checks and interactive package-manager switching to avoid blocking automation. - The effective color setting is applied to both stdout and stderr, following the same rules as chalk:
NO_COLORturns colors off,FORCE_COLORturns them on. - If
debugresolves totrue, unipm setsDEBUG=truefor the current process to surface verbose logging.
| Command | Alias | Description |
|---|---|---|
| add <pkg> | a | Installs a dependency |
| remove <pkg> | r | Uninstalls a dependency |
| install | i | Installs all project dependencies |
| update | u | Updates dependencies |
| run <script> | Runs a script from package.json | |
| exec <cmd> | x | Runs a command using the package manager |
| detect | Detects the current project pm | |
| update-self | self-update | Updates unipm to the latest version |
| help | h, --help, -h | Shows help information |
# Install express
unipm add express
# Uninstall lodash
unipm remove lodash
# Run a script
unipm run build
# Run a command
unipm exec tscThis project uses Semantic Versioning (semver).
Example: 1.0.0
All contributions are welcome!
Open an issue or submit a PR.
See CONTRIBUTING.md for more info.
Made with love by Manu (@opticalsecurity)
La Plata, Buenos Aires 🇦🇷