spm and let it figure out the rest.
π Report a Bug Β· β¨ Request a Feature
Table of Contents
Ever joined a project and had to check which package manager it uses before running anything? Yeah, me too. π
spm detects your project's package manager automatically and translates your commands on the fly. Just type spm install, spm add react, or spm dev β it handles the rest.
- π Auto-detection via lock files (
package-lock.json,yarn.lock,pnpm-lock.yaml,bun.lock) - π Directory walk-up β works from any subdirectory in your project
- π Flag pass-through β unknown flags (e.g.
--legacy-peer-deps) are forwarded to the underlying package manager - π Command translation β maps commands to the correct syntax for each package manager
- π― Interactive script runner β
spm runlets you pick a script from package.json - π¬ Interactive prompt when multiple lock files are detected or no lock file exists
- π Dry-run mode to preview commands without executing them
- π΅ Vibes mode β play background music while installing dependencies (
--vibes) - π Notification sounds β get notified when the command finishes (
--notify) - π Project init β
spm initscaffolds a new project with the package manager of your choice - π Security audit β
spm auditruns a dependency audit and normalizes output across npm/yarn/pnpm - β¬οΈ Self-upgrade β
spm upgradeupdates spm to the latest release from GitHub - π Interactive search β
spm addwith no args lets you search and pick a package from the npm registry - π Package details β press Enter on a search result to view metadata (license, downloads, stars, repo) and pick a specific version to install
- β¨ Progress TUI β
spm installshows a live spinner with elapsed time and scrolling logs (use--rawfor raw output)
- Go
- Cobra
- Charmbracelet (lipgloss, huh, bubbletea)
- Beep
brew install decampsrenan/tap/spmThe fastest way to get started:
curl -fsSL https://raw.githubusercontent.com/decampsrenan/spm/main/scripts/install.sh | bashWant to install to a custom directory? No problem:
INSTALL_DIR=~/.local/bin curl -fsSL https://raw.githubusercontent.com/decampsrenan/spm/main/scripts/install.sh | bashWant to try the latest unreleased features? Install the most recent alpha:
curl -fsSL https://raw.githubusercontent.com/decampsrenan/spm/main/scripts/install.sh | bash -s -- --alphaOr with Go:
go install github.com/decampsrenan/spm@v0.3.0-alpha.1 # replace with the desired alpha tagAlpha builds are published automatically on every push to main.
Requires Go 1.25+.
go install github.com/decampsrenan/spm@latest# Install dependencies (auto-detects npm/yarn/pnpm/bun)
spm install
# Pass flags through to the underlying package manager
spm install --legacy-peer-deps
spm install --frozen-lockfile
# Add a package
spm add react
# Search and pick a package interactively
spm add
# Add a dev dependency
spm add vitest --save-dev
# Remove a package
spm remove react
# Run a script defined in package.json
spm dev
spm test
spm build
# Pick a script interactively from package.json
spm run
# Remove artifact directories (e.g. node_modules)
spm clean
# Remove artifact directories and the lock file
spm clean --lock
# Skip the confirmation prompt (useful in CI)
spm clean --yes
# Initialize a new project (interactive PM selection)
spm init
# Initialize with a specific package manager
spm init npm
spm init yarn
# Preview the init command without running it
spm init npm --dry-run
# Preview what would run without executing
spm dev --dry-run
# Install with background music πΆ
spm install --vibes
# Play a sound when the command finishes
spm install --notify
# Combine vibes and notification
spm install --vibes --notify
# Show raw package manager output (skip progress TUI)
spm install --raw
# Run a security audit on dependencies
spm audit
# Audit only production dependencies
spm audit --prod-only
# Output audit results as JSON
spm audit --json
# Only report high and critical vulnerabilities
spm audit --severity high
# Preview the audit command without running it
spm audit --dry-run
# Upgrade spm to the latest version
spm upgrade
# Upgrade to the latest alpha/pre-release
spm upgrade --alpha
# Reinstall even if already up to date
spm upgrade --force
# Preview upgrade without downloading
spm upgrade --dry-run
# Show version
spm --version
spm -v| spm command | npm | yarn | pnpm | bun |
|---|---|---|---|---|
spm init |
npm init -y |
yarn init -y |
pnpm init |
bun init |
spm install |
npm install |
yarn install |
pnpm install |
bun install |
spm add foo |
npm install foo |
yarn add foo |
pnpm add foo |
bun add foo |
spm add |
(interactive search) | (interactive search) | (interactive search) | (interactive search) |
spm run |
(interactive) | (interactive) | (interactive) | (interactive) |
spm remove foo |
npm uninstall foo |
yarn remove foo |
pnpm remove foo |
bun remove foo |
spm clean |
Removes artifact directories (and lock file with --lock) |
|||
spm audit |
npm audit --json |
yarn audit --json |
pnpm audit --json |
|
spm upgrade |
Self-updates spm via GitHub Releases | |||
spm dev |
npm run dev |
yarn dev |
pnpm dev |
bun dev |
Contributions are welcome! π Please read the contributing guide to get started.
Got a question or found something weird? Don't hesitate to open an issue β I'm happy to help! π¬
Distributed under the MIT license.
Big thanks to these awesome projects that make spm possible:
- Cobra β CLI framework
- Charmbracelet β terminal styling, prompts, and spinner (lipgloss, huh, bubbletea, bubbles)
- Beep β audio playback for vibes & notifications
- go-isatty β TTY detection