| name | bun-package-manager |
| description | Fast JavaScript package management with Bun — install, add, remove, update. Use when installing all deps, adding/removing packages, running `bun update`/`outdated`, managing workspaces, doing a `--frozen-lockfile` CI install, or debugging conflicts. |
| user-invocable | false |
| allowed-tools | Bash, Read, Grep, Glob, TodoWrite |
| created | "2025-12-20T00:00:00.000Z" |
| modified | "2026-05-09T00:00:00.000Z" |
| reviewed | "2025-12-20T00:00:00.000Z" |
Bun Package Manager
When to Use This Skill
| Scenario | Use this skill | Alternative |
|---|
| Installing all project dependencies | Yes | N/A |
| Adding or removing packages | Yes | bun-add for quick single-package additions |
| Updating packages or checking outdated | Yes | N/A |
| Managing workspace dependencies | Yes | N/A |
CI reproducible installs (--frozen-lockfile) | Yes | N/A |
| Running scripts or tests | No - use bun-development | bun-test for quick test runs |
| Publishing packages to npm | No - use bun-publishing | N/A |
| Debugging lockfile conflicts | Yes | bun-lockfile-update for targeted lockfile operations |
Core Expertise
Bun's package manager is significantly faster than npm/yarn/pnpm:
- ~7x faster than npm
- ~4x faster than pnpm
- Native workspace support
- Compatible with npm registry
Essential Commands
Install Dependencies
bun install
bun install --frozen-lockfile
bun install --production
bun install --force
bun install --dry-run
Add Packages
bun add <package>
bun add --dev <package>
bun add -d <package>
bun add --exact <package>
bun add -E <package>
bun add --global <package>
bun add -g <package>
bun add <package> --cwd packages/mylib
Remove Packages
bun remove <package>
bun remove --dev <package>
bun remove --dry-run <package>
Update Packages
bun update
bun update --latest
bun update --interactive
bun update --recursive
Inspect Dependencies
bun outdated
bun why <package>
bun pm ls
bun pm cache
Workspace Management
Configuration
{
"name": "monorepo",
"private": true,
"workspaces": ["packages/*", "apps/*"]
}
Workspace Operations
bun install
bun add express --cwd apps/api
bun run --filter 'package-*' build
bun run --workspaces test
Inter-workspace Dependencies
{
"dependencies": {
"shared-utils": "workspace:*"
}
}
Agentic Optimizations
| Context | Command |
|---|
| CI install | bun install --frozen-lockfile |
| Prod deploy | bun install --production |
| Preview changes | bun add --dry-run <pkg> |
| Exact versions | bun add --exact <pkg> |
| Workspace target | bun add <pkg> --cwd <path> |
| Force refresh | bun install --force |
Quick Reference
| Flag | Short | Description |
|---|
--frozen-lockfile | | Fail if lockfile changes |
--production | -p | Skip devDependencies |
--dev | -d | Add to devDependencies |
--exact | -E | Pin exact version |
--global | -g | Global install |
--dry-run | | Preview without executing |
--force | -f | Force reinstall all |
--cwd <path> | | Target directory |
--latest | | Update to latest version |
--recursive | | Apply across workspaces |
Error Handling
Common Issues
Lockfile mismatch in CI:
bun install --frozen-lockfile
Peer dependency conflicts:
bun install --force
Package not found:
bun why <package>
Environment Variables
| Variable | Description |
|---|
BUN_OPTIONS | Global CLI flags |
BUN_INSTALL | Bun installation directory |