
Bun Package Manager
- 97 installs
- 202 repo stars
- Updated August 4, 2026
- secondsky/claude-skills
Helps with ai & agent building tasks during AI-assisted development.
About
bun package manager is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- bun package manager
- AI & Agent Building
- AI-coding skill
Bun Package Manager by the numbers
- 97 all-time installs (skills.sh)
- Ranked #4,488 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/secondsky/claude-skills --skill bun-package-managerAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 97 |
|---|---|
| repo stars | ★ 202 |
| Last updated | August 4, 2026 |
| Repository | secondsky/claude-skills ↗ |
What it does
Helps with ai & agent building tasks during AI-assisted development.
Files
Bun Package Manager
Bun's package manager is a dramatically faster replacement for npm, yarn, and pnpm. Up to 25x faster than npm install.
Quick Start
# Install all dependencies
bun install
# Add packages
bun add react react-dom
bun add -D typescript @types/react
# Remove packages
bun remove lodash
# Update packages
bun update
# Run package binaries
bunx create-next-appCore Commands
| Command | Description |
|---|---|
bun install | Install all dependencies |
bun add <pkg> | Add dependency |
bun add -D <pkg> | Add dev dependency |
bun add -O <pkg> | Add optional dependency |
bun add --peer <pkg> | Add peer dependency |
bun remove <pkg> | Remove dependency |
bun update [pkg] | Update dependencies |
bunx <pkg> | Run package binary |
bun pm cache rm | Clear cache |
Installation Flags
# Production mode (no devDependencies)
bun install --production
# Frozen lockfile (CI/CD)
bun install --frozen-lockfile
bun ci # shorthand
# Dry run
bun install --dry-run
# Verbose/Silent
bun install --verbose
bun install --silent
# Force reinstall
bun install --force
# Global packages
bun install -g cowsayLockfile
Bun uses bun.lock (text-based since v1.2):
# Generate text lockfile
bun install --save-text-lockfile
# Upgrade from binary bun.lockb
bun install --save-text-lockfile --frozen-lockfile --lockfile-only
rm bun.lockbWorkspaces (Monorepos)
{
"name": "my-monorepo",
"workspaces": ["packages/*", "apps/*"]
}Run commands across workspaces:
# Run in matching packages
bun run --filter 'pkg-*' build
# Run in all workspaces
bun run --filter '*' test
# Install for specific packages
bun install --filter 'pkg-a'Lifecycle Scripts
Bun does not run lifecycle scripts from dependencies by default (security). Whitelist trusted packages:
{
"trustedDependencies": ["my-trusted-package"]
}# Skip all lifecycle scripts
bun install --ignore-scripts
# Concurrent scripts
bun install --concurrent-scripts 5Overrides & Resolutions
Force specific versions for nested dependencies:
{
"overrides": {
"lodash": "4.17.21"
}
}Yarn-style resolutions also supported:
{
"resolutions": {
"lodash": "4.17.21"
}
}Non-npm Dependencies
{
"dependencies": {
"dayjs": "git+https://github.com/iamkun/dayjs.git",
"lodash": "git+ssh://github.com/lodash/lodash.git#4.17.21",
"zod": "github:colinhacks/zod",
"react": "https://registry.npmjs.org/react/-/react-18.2.0.tgz",
"bun-types": "npm:@types/bun"
}
}Installation Strategies
Hoisted (default for single packages)
Traditional flat node_modules:
bun install --linker hoistedIsolated (default for workspaces)
pnpm-like strict isolation:
bun install --linker isolatedIsolated prevents "phantom dependencies" - packages can only access declared dependencies.
CI/CD
# GitHub Actions
- uses: oven-sh/setup-bun@v2
- run: bun ci # frozen lockfilePlatform-Specific
# Install for different platform
bun install --cpu=x64 --os=linuxSecure Installation
When installing packages, follow supply chain security best practices:
- Block post-install scripts — Bun disables them by default; allow specific packages via
trustedDependenciesinpackage.json - Cooldown period — Configure
minimumReleaseAgeinbunfig.tomlto wait 7 days for new versions - Audit before installing — Run
socket package score npm <pkg>or usesocket npm install <pkg>to check packages before they reach your project
Load the dependency-upgrade skill for full security configuration including Socket CLI integration, cooldown setup, lockfile validation, and CI enforcement.
Common Errors
| Error | Cause | Fix |
|---|---|---|
Cannot find module | Missing dependency | Run bun install |
Lockfile mismatch | package.json changed | Run bun install |
Peer dependency | Missing peer | bun add the peer |
Lifecycle script failed | Untrusted package | Add to trustedDependencies |
Migration from Other Package Managers
From pnpm
Bun automatically migrates pnpm-lock.yaml:
bun install # Auto-converts to bun.lockWorkspace config moves to package.json:
{
"workspaces": {
"packages": ["apps/*", "packages/*"],
"catalog": {
"react": "^18.0.0"
}
}
}From npm/Yarn
Simply run bun install - Bun reads package-lock.json and yarn.lock.
When to Load References
Load references/cli-commands.md when:
- Need complete CLI flag reference
- Working with advanced options
Load references/workspaces.md when:
- Setting up monorepos
- Configuring workspace filters
Load references/migration.md when:
- Migrating from npm/yarn/pnpm
- Converting lockfiles
Bun Package Manager CLI Reference
bun install
bun install [flags]General Configuration
| Flag | Description |
|---|---|
--config | Path to bunfig.toml |
--cwd | Set working directory |
Dependency Scope
| Flag | Description |
|---|---|
--production | Skip devDependencies |
--no-save | Don't update package.json |
--save | Save to package.json (default) |
--omit | Exclude dev, optional, or peer |
--only-missing | Only add if not present |
Dependency Type
| Flag | Description |
|---|---|
--dev, -D | Add to devDependencies |
--optional, -O | Add to optionalDependencies |
--peer | Add to peerDependencies |
--exact, -E | Use exact version |
Lockfile
| Flag | Description |
|---|---|
--yarn | Write yarn.lock |
--frozen-lockfile | Disallow lockfile changes |
--save-text-lockfile | Use text lockfile |
--lockfile-only | Only update lockfile |
Network
| Flag | Description |
|---|---|
--ca | CA certificate |
--cafile | CA certificate file |
--registry | Override npm registry |
Installation Control
| Flag | Description |
|---|---|
--dry-run | Don't install anything |
--force | Force reinstall |
--global, -g | Install globally |
--backend | clonefile, hardlink, symlink, copyfile |
--filter | Install for matching workspaces |
Cache
| Flag | Description |
|---|---|
--cache-dir | Cache directory |
--no-cache | Ignore manifest cache |
Output
| Flag | Description |
|---|---|
--silent | No output |
--verbose | Debug output |
--no-progress | Hide progress bar |
--no-summary | Hide summary |
Security
| Flag | Description |
|---|---|
--no-verify | Skip integrity check |
--trust | Add to trustedDependencies |
Performance
| Flag | Description |
|---|---|
--concurrent-scripts | Max concurrent scripts |
--network-concurrency | Max network requests (default: 48) |
Lifecycle
| Flag | Description |
|---|---|
--ignore-scripts | Skip lifecycle scripts |
bun add
bun add <packages> [flags]All bun install flags plus:
bun add react # Latest
bun add react@19 # Major version
bun add react@19.1.1 # Exact version
bun add react@latest # Latest tag
bun add react@next # Next tag
bun add -D typescript # Dev dependency
bun add -O fsevents # Optional dependencybun remove
bun remove <packages>Removes from package.json and node_modules.
bun update
bun update [packages]Updates packages to latest allowed by semver.
bun update # Update all
bun update react # Update specific
bun update --latest # Ignore semver rangesbunx
bunx <package> [args]Run package binary (like npx):
bunx create-next-app my-app
bunx tsc --version
bunx prisma generatebun pm
Package manager utilities:
bun pm cache rm # Clear cache
bun pm cache # Show cache path
bun pm bin # Show bin directory
bun pm bin -g # Global bin directory
bun pm ls # List installed packages
bun pm hash # Show lockfile hash
bun pm hash-string # Deterministic hash
bun pm hash-print # Print hash details
bun pm migrate # Migrate from other PMsbun link
# In package directory
bun link
# In consuming project
bun link <package-name>
# Unlink
bun unlink
bun unlink <package-name>bun publish
bun publish [flags]Publish to npm registry.
bun outdated
bun outdated # Show outdated packages
bun outdated --filter # Filter workspacesbun why
bun why <package> # Show why installedbun audit
bun audit # Check for vulnerabilitiesbun patch
bun patch <package> # Create patch
bun patch --commit # Apply patch