[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7D3TFM8YR2B4XQ16K0VHFKC":3,"skill-same:01M7D3TFM8YR2B4XQ16K0VHFKC":89},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7D3TFM8YR2B4XQ16K0VHFKC","bun-cli",null,"Bun CLI reference for package management, script running, type checking, testing, bundling, and compilation. Covers bun install\u002Fadd\u002Fremove\u002Fupdate, bun run, bun check and --check, bun test, bun build, bunx, bun patch, bun audit fix, bun dedupe, bun prune, bun why, bun pm, bun repl, bunfig.toml, bun.lock, workspace catalogs, isolated installs and the global virtual store, offline installs, self-contained workspaces, zero-config frontend dev, parallel\u002Fsequential execution, test sharding and parallelism, code splitting, bytecode, profile-guided bytecode layout and cross-compiled executables, compile-to-browser, and replacing npm\u002Fnpx\u002Fyarn\u002Fpnpm and tsc --noEmit with bun equivalents. Use for package management, lockfile issues, type checking, test runner config, bundler setup, or frontend dev server Not for Bun runtime APIs (Bun.file(), Bun.$(), Bun.sql()) -- use bun-api skill","datamonsterr\u002Fother-skill","datamonsterr","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F94211882?v=4","01M753RPEB0GWGMAQK66KRXW1S","Pham Dat","01M7D3SZKK01PFJSY7QM4FBXKP",3,"MIT","https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fbackend\u002Fbun-cli--396a407bee6a948e\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fbackend\u002Fbun-cli--396a407bee6a948e\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bun-cli\ndescription: >-\n  Bun CLI reference for package management, script running, type checking, testing, bundling,\n  and compilation. Covers bun install\u002Fadd\u002Fremove\u002Fupdate, bun run, bun check and --check,\n  bun test, bun build, bunx, bun patch, bun audit fix, bun dedupe, bun prune, bun why, bun pm,\n  bun repl, bunfig.toml, bun.lock, workspace catalogs, isolated installs and the global virtual\n  store, offline installs, self-contained workspaces, zero-config frontend dev,\n  parallel\u002Fsequential execution, test sharding and parallelism, code splitting, bytecode,\n  profile-guided bytecode layout and cross-compiled executables, compile-to-browser, and\n  replacing npm\u002Fnpx\u002Fyarn\u002Fpnpm and tsc --noEmit with bun equivalents. Use for package\n  management, lockfile issues, type checking, test runner config, bundler setup, or frontend\n  dev server\n  Not for Bun runtime APIs (Bun.file(), Bun.$(), Bun.sql()) -- use bun-api skill\n---\n\n# Bun CLI\n\nBun is an all-in-one JavaScript\u002FTypeScript runtime, package manager, bundler, test runner, and (v1.4.3+) type checker. Bun runs TypeScript natively — `bun file.ts` directly, no compile step, no `tsc`, no `ts-node` — and `bun check` replaces `tsc --noEmit`. Always use `bun` instead of `node`, `npm`, `npx`, `yarn`, or `pnpm` in Bun projects.\n\n**Verified against Bun v1.4.3** (2026-10-10). Features are tagged with the version that\nintroduced them (`v1.4+`, `v1.4.1+`, `v1.4.2+`, `v1.4.3+`). Where a release changed existing\nbehavior, both behaviors are stated so this skill stays correct on older projects -- run\n`bun --version` before relying on a version-tagged item.\n\n## Check the Version, Then Check Bun's Docs\n\n`bun \u003Ccommand> --help` is authoritative for flags and always matches the installed binary --\nprefer it over any table here when the two disagree.\n\nFor everything beyond flags, Bun ships its full docs inside `bun-types`, version-matched to\nthe runtime, in any project that has `bun-types` or `@types\u002Fbun` installed:\n\n```text\nnode_modules\u002Fbun-types\u002Fdocs\u002Fpm\u002F**\u002F*.mdx        # install, lockfile, workspaces, catalogs, linkers\nnode_modules\u002Fbun-types\u002Fdocs\u002Ftest\u002F**\u002F*.mdx      # test runner\nnode_modules\u002Fbun-types\u002Fdocs\u002Fbundler\u002F**\u002F*.mdx   # bun build, executables, loaders, plugins\nnode_modules\u002Fbun-types\u002Fdocs\u002Fruntime\u002Fbunfig.mdx\nnode_modules\u002Fbun-types\u002FCLAUDE.md             # Bun's own agent rules\n```\n\n1. **Depend on `bun-types`, not `@types\u002Fbun`.** `bun-types` ships with every Bun release and\n   carries both the docs and the types. `@types\u002Fbun` lags every release, often by a day or\n   more, yet `bun init` adds it as `latest` -- so `bun check` rejects the newest APIs\n   (`TS2339`, `TS2353`). Adding `bun-types` beside `@types\u002Fbun` fixes only the docs path:\n   type checking keeps `@types\u002Fbun`'s nested, pinned copy. Switch both:\n\n   ```bash\n   bun remove @types\u002Fbun\n   bun add -d bun-types@$(bun --version)   # then \"types\": [\"bun-types\"] in tsconfig.json\n   ```\n\n   Compare `bun --version` with `node_modules\u002Fbun-types\u002Fpackage.json` before trusting either.\n2. **Open by explicit path.** With the global virtual store enabled, `node_modules\u002Fbun-types`\n   is a symlink, so `find node_modules -name '*.mdx'` and `rg \u003Cpattern> node_modules` return\n   nothing. `find node_modules\u002Fbun-types\u002Fdocs -name '*.mdx'` works.\n3. **Never edit under `node_modules\u002F`.** Under the global store every project on the machine\n   shares the same inode. Use `bun patch`.\n4. **Not installed?** The same path works online: `docs\u002Fpm\u002Flockfile.mdx` is\n   `https:\u002F\u002Fbun.com\u002Fdocs\u002Fpm\u002Flockfile`.\n\n| Task | Doc path (under `node_modules\u002Fbun-types\u002Fdocs\u002F`) |\n|---|---|\n| Install behavior, lockfile, linkers | `pm\u002Fcli\u002Finstall.mdx`, `pm\u002Flockfile.mdx`, `pm\u002Fisolated-installs.mdx`, `pm\u002Fglobal-store.mdx` |\n| Workspaces, catalogs, filters, overrides | `pm\u002Fworkspaces.mdx`, `pm\u002Fcatalogs.mdx`, `pm\u002Ffilter.mdx`, `pm\u002Foverrides.mdx` |\n| Registries, auth, lifecycle scripts | `pm\u002Fscopes-registries.mdx`, `pm\u002Fnpmrc.mdx`, `pm\u002Flifecycle.mdx` |\n| Type checking (`bun check`, `--check`) | `runtime\u002Fcheck.mdx` |\n| Test runner | `test\u002Findex.mdx`, `test\u002Fdiscovery.mdx`, `test\u002Fconfiguration.mdx`, `test\u002Fcode-coverage.mdx`, `test\u002Freporters.mdx`, `test\u002Fmocks.mdx` |\n| Bundler, executables, loaders | `bundler\u002Findex.mdx`, `bundler\u002Fexecutables.mdx`, `bundler\u002Floaders.mdx`, `bundler\u002Fplugins.mdx` |\n| Config | `runtime\u002Fbunfig.mdx` |\n| Migrating from npm\u002Fyarn\u002Fpnpm | `guides\u002Finstall\u002Ffrom-npm-install-to-bun-install.mdx` |\n\n## Detecting Bun Projects\n\nA project uses Bun if any of these are present:\n- `bun.lock` or `bun.lockb` in the project root\n- `bunfig.toml` in the project root\n- `bun` field in `package.json` (e.g., `\"bun\": { \"install\": { ... } }`)\n- Package manager field: `\"packageManager\": \"bun@...\"`\n- `[run] bun = true` in `bunfig.toml` (forces Bun runtime for all scripts)\n\n## Critical Rule\n\n**In a Bun project, ALWAYS use `bun` for everything.** Never fall back to `node`, `npm`, `npx`, `yarn`, or `pnpm`. This avoids compatibility issues, unnecessary retries, and cryptic errors from Node.js\u002Fnpm not understanding Bun-specific features (workspace protocol, lockfile format, trustedDependencies, etc.).\n\n- Run files: `bun file.ts` (not `node file.ts`)\n- Run scripts: `bun run dev` (not `npm run dev`)\n- Execute binaries: `bunx tool` (not `npx tool`)\n- Install packages: `bun add pkg` (not `npm install pkg`)\n- Run tests: `bun test` (not `npx jest` or `node --test`)\n- Type check: `bun check` (not `tsc --noEmit`; v1.4.3+)\n\n## Read-Only Commands (safe, no side effects)\n\n| Command | Purpose |\n|---------|---------|\n| `bun --version` | Runtime version |\n| `bun info \u003Cpkg>` | Package metadata, available versions |\n| `bun info \u003Cpkg> versions` | List all published versions |\n| `bun pm ls` | List installed packages (alias: `bun list`) |\n| `bun pm ls --all` | List all (including transitive) |\n| `bun pm ls --trusted` | List only packages allowed to run lifecycle scripts (v1.4+) |\n| `bun pm hash` | Print lockfile hash |\n| `bun pm cache` | Show cache directory |\n| `bun pm bin` | Print the bin directory (`-g` for global) |\n| `bun pm licenses` | List dependencies grouped by license (v1.4+; `--json`, `--prod`) |\n| `bun pm diff \u003Cpkg>` | Diff two versions of a package (v1.4+) |\n| `bun pm untrusted` | List packages whose lifecycle scripts were blocked |\n| `bun why \u003Cpkg>` | Explain why a package is installed |\n| `bun outdated` | Check for outdated dependencies |\n| `bun audit` | Security vulnerability audit |\n| `bun dedupe --check` | Exit 1 if the lockfile has removable duplicates (v1.4+) |\n| `bun prune --dry-run` | Show what would be removed from `node_modules` (v1.4+) |\n| `bun test` | Run test suite |\n| `bun --check` | Type check the whole project and exit; never writes files or runs a script (v1.4.3+). `bun check` does the same unless `package.json` defines a `check` script, which it runs instead |\n| `bun run lint` | Run linter (project-specific) |\n| `bun run check-types` | Type checking (project-specific) |\n\n> **Reference**: See `references\u002Fallowlist.md` for copy-paste `Bash(command:*)` patterns for Claude Code \u002F OpenCode settings.\n\n## npm\u002Fnpx\u002Fnode to Bun Translation\n\n| npm\u002Fnpx\u002Fnode | Bun equivalent |\n|---|---|\n| `npm install` | `bun install` |\n| `npm install pkg` | `bun add pkg` |\n| `npm install -D pkg` | `bun add -d pkg` |\n| `npm install -g pkg` | `bun add -g pkg` |\n| `npm uninstall pkg` | `bun remove pkg` |\n| `npm update` | `bun update` |\n| `npm run script` | `bun run script` |\n| `npx command` | `bunx command` |\n| `node file.js` | `bun file.js` |\n| `node --watch file.js` | `bun --watch file.js` |\n| `npm test` | `bun test` |\n| `tsc --noEmit` | `bun check` (v1.4.3+) |\n| `npm pack` | `bun pm pack` |\n| `npm publish` | `bun publish` |\n| `npm info pkg` | `bun info pkg` |\n| `npm outdated` | `bun outdated` |\n| `npm audit` | `bun audit` |\n| `npm link` | `bun link` |\n\n### Key Behavioral Differences\n\n- **No `npm run` prefix needed**: `bun run dev` works, but so does `bun dev` (direct script execution)\n- **`--bun` flag**: Forces Bun runtime instead of Node.js for scripts that use `node` in their shebang. In `bunfig.toml`, set `[run] bun = true` to make this the default\n- **Lockfile**: Bun uses `bun.lock` (text-based, v1.2+) or `bun.lockb` (binary, legacy). Text lockfile is default for new projects\n- **Workspace commands**: Use `--filter` flag: `bun --filter 'pkg-name' add dep`\n- **Lifecycle scripts**: Bun ignores lifecycle scripts by default for security. Use `trustedDependencies` in package.json to allowlist packages that need postinstall etc.\n\n## Package Management\n\n### Installing Dependencies\n\n```bash\nbun install                    # Install all from package.json\nbun install --frozen-lockfile  # CI mode: fail if lockfile needs update\nbun install --no-save          # Install without updating package.json\nbun install --production       # Skip devDependencies\nbun install --dry-run          # Show what would be installed\nbun install --offline          # No network at all; every package must already be cached (v1.4.1+)\nbun install --prefer-offline   # Cached metadata regardless of age; download only what is missing (v1.4.1+)\n```\n\n`--offline` suits CI jobs that restore `~\u002F.bun\u002Finstall\u002Fcache` and air-gapped machines -- a\nmissing package fails by name (`no cached manifest for 'left-pad'`). `--prefer-offline` skips\nthe staleness check but still fetches uncached packages. Both have `bunfig.toml` forms:\n`[install] offline = true` and `[install] prefer = \"offline\"`.\n\n**Changed in 1.4.3 -- installs cache only what they place.** Without a lockfile, `bun install`\nand `bun add` no longer download tarballs that never land in `node_modules`: groups dropped by\n`--production` or `--omit`, other platforms' optional packages, bundled dependencies. A cache\nwarmed by `bun install --production` then fails a full `--offline` install with\n`\"left-pad\" is not in the cache`. Warm an offline cache with an install that places at least\nthe same packages, on the same platform.\n\n### Adding\u002FRemoving Packages\n\n```bash\nbun add pkg                    # Add to dependencies\nbun add pkg@version            # Add specific version\nbun add -d pkg                 # Add to devDependencies (--dev)\nbun add -D pkg                 # Same as -d\nbun add --optional pkg         # Add to optionalDependencies\nbun add --peer pkg             # Add to peerDependencies\nbun add -g pkg                 # Install globally\nbun add --exact pkg            # Pin exact version (no ^)\nbun add pkg --filter api       # Add to one workspace from the repo root (v1.4+)\nbun add pkg --catalog          # Add to the root catalog, depend on it as \"catalog:\" (v1.4+)\nbun remove pkg                 # Remove package\n```\n\n**Changed in 1.4:** `bun add`, `bun remove`, and `bun update` accept `--filter`, and\n`bun install \u003Cpkg> --filter x` now edits workspace `x` rather than the root. In a workspace\nwhose default catalog already lists the package, a plain `bun add \u003Cpkg>` writes `catalog:`.\n`--filter 'web...'` selects `web` and everything it depends on; `'...web'` selects everything\nthat depends on `web`.\n\n### Updating and Inspecting\n\n```bash\nbun update                     # Update all packages within package.json ranges\nbun update pkg                 # Update every copy of pkg, transitive ones included (v1.4+)\nbun update '@types\u002F*' --latest # Patterns; --latest ignores the declared range\nbun update --recursive         # Update every workspace and write each package.json (v1.4+)\nbun update --filter 'pkg-*' --filter '!pkg-c'   # Repeatable; ! excludes (v1.4+)\nbun outdated                   # Show outdated packages\nbun info pkg                   # Show package metadata\nbun info pkg versions          # List all available versions\nbun why pkg                    # Explain why a package is in the tree\nbun pm ls                      # List installed packages (alias: bun list)\nbun pm ls --all                # List all (including transitive)\nbun pm hash                    # Print lockfile hash\nbun pm cache                   # Show cache directory\nbun pm cache rm                # Clear cache (including the global virtual store)\n```\n\n**Changed in 1.4:** `bun update` re-resolves transitive dependencies, not just the ones named\nin `package.json`, and `bun update \u003Cname>` **errors with exit 1** when nothing depends on that\nname (it used to add the package).\n\n### Maintenance (v1.4+)\n\n```bash\nbun audit fix                  # Upgrade vulnerable packages to the lowest safe version\nbun audit fix --dry-run        # Preview\nbun audit fix --latest         # Also apply fixes your declared ranges exclude\nbun dedupe                     # Collapse duplicate versions in bun.lock, then install\nbun dedupe --check             # CI gate: exit 1 if duplicates remain\nbun prune                      # Drop node_modules entries no longer in bun.lock\nbun prune --production         # Also drop devDependencies -- build with them, ship without\nbun pm licenses --prod --json  # License inventory\nbun pm diff react@18.2.0 19.0.0  # What changed between two versions of a package\n```\n\n`bun pm diff` leads with a summary -- files changed, new install scripts, and new imports of\n`child_process`, `fs`, `net`, or `vm` -- then the diff, with minified files expanded and\nformatting-only changes skipped. Useful for reviewing a dependency bump.\n\n`bun prune --production` fits the Docker build stage:\n\n```dockerfile\nCOPY package.json bun.lock .\u002F\nRUN bun install --frozen-lockfile\nCOPY . .\nRUN bun run build\nRUN bun prune --production\n```\n\n### Linking and Patching\n\n```bash\nbun link                       # Register current package as linkable\nbun link pkg-name              # Link a registered package\nbun pm pack                    # Create tarball of package\nbun patch pkg                  # Start patching a package\nbun patch --commit pkg-dir     # Apply patch\n```\n\n### Publishing\n\n```bash\nbun publish                    # Publish to npm\nbun publish --dry-run          # Preview what would be published\nbun publish --tag beta         # Publish with tag\nbun publish --access public    # Set access level\n```\n\n> **Reference**: See `references\u002Fpackage-management.md` for complete flag details.\n\n## Install Layout: Linker and Global Virtual Store\n\nTwo settings decide how `node_modules` is laid out. Both matter more than they look.\n\n### Linker\n\n| | `hoisted` | `isolated` |\n|---|---|---|\n| Layout | npm-style flat `node_modules` | symlinks into `node_modules\u002F.bun\u002F` (pnpm-style) |\n| Phantom dependencies | resolve silently | fail, as they should |\n| Default when | `configVersion = 0` (any project), or `configVersion = 1` without workspaces | `configVersion = 1` **and** the project uses workspaces |\n\nThe default depends on the lockfile's `configVersion`, not on the Bun version: isolated only\nwhen `configVersion = 1` **and** the project uses workspaces. Lockfiles created before v1.3.2\nare treated as `configVersion = 0` and keep hoisted, so upgrading Bun does not change an\nexisting project's layout. Override with `--linker` or `[install] linker`.\n\n### Global Virtual Store (v1.3.14+, faster in 1.4)\n\nPackage files live once in `~\u002F.bun\u002Finstall\u002Fcache\u002Flinks\u002F` and each project symlinks into them:\nwarm installs are roughly 7x faster, and `node_modules` drops from hundreds of MB to a few MB\nof links. **It is off by default and needs both settings** -- with `linker = \"hoisted\"` the\n`globalStore` flag is silently ignored.\n\n```toml\n[install]\nlinker = \"isolated\"      # prerequisite\nglobalStore = true\n```\n\n```bash\nBUN_INSTALL_GLOBAL_STORE=1 bun install --linker isolated   # per invocation\nbun pm cache rm                                            # clears the store too\n```\n\nConsequences worth knowing before enabling it:\n\n1. **`node_modules` is mostly symlinks.** `find node_modules -name '*.mdx'` and\n   `rg \u003Cpattern> node_modules` return nothing, and `du -sh node_modules` reports ~`0B`\n   because it measures the symlinks rather than their targets (the real tree is a few MB of\n   links; `du -sh -L` shows the target sizes, counted once per link). Address\n   files by explicit path, or pass `find -L` (which double-counts through the link layers).\n   Tools that scan `node_modules` without following symlinks behave differently -- the same\n   caveat as any pnpm-style layout.\n2. **Every project shares the same inode.** Editing a file under `node_modules\u002F` changes it\n   for every project on the machine. Use `bun patch`.\n3. **True phantom dependencies stop resolving.** Packages realpath into the cache, so the\n   hidden `node_modules\u002F.bun\u002Fnode_modules\u002F` layer is no longer on the resolution path from\n   inside a package. Fix by declaring the dependency, or set `globalStore = false`.\n4. **Some entries stay project-local**: patched packages, `trustedDependencies`, and anything\n   depending on a `workspace:`, `file:`, or `link:` dependency. Ineligibility propagates up\n   the graph, so a monorepo keeps a good share of the tree local regardless.\n\n> **Reference**: `node_modules\u002Fbun-types\u002Fdocs\u002Fpm\u002Fglobal-store.mdx` and `pm\u002Fisolated-installs.mdx`.\n\n### Self-Contained Workspaces (v1.4.1+, hoisted linker)\n\nElectron packagers and serverless bundlers repackage one workspace's `node_modules` and expect\nevery dependency physically under it. List such workspaces in the root `package.json`, or set\nYarn's `\"installConfig\": { \"hoistingLimits\": \"workspaces\" }` in the workspace's own file:\n\n```json\n{ \"workspaces\": { \"packages\": [\"apps\u002F*\", \"packages\u002F*\"], \"selfContained\": [\"apps\u002Fdesktop\"] } }\n```\n\nNothing that workspace depends on, directly or transitively, is hoisted above\n`apps\u002Fdesktop\u002Fnode_modules`, and those packages are real copies rather than cache hardlinks.\nThe lockfile does not record it, and it has no effect under the isolated linker.\n\n## Running Scripts and Files\n\n### Direct Execution\n\n```bash\nbun file.ts                    # Run TypeScript\u002FJavaScript directly\nbun run script-name            # Run package.json script\nbun script-name                # Short form (if no conflict with bun commands)\nbun --watch file.ts            # Re-run on file changes\nbun --hot file.ts              # Hot reload (preserves state)\nbun --env-file .env file.ts    # Load env file\nbun --env-file .env.local --env-file .env file.ts  # Multiple env files\nbun --no-env-file file.ts      # Skip automatic .env loading (CI\u002Fprod; `env = false` in bunfig)\nbun --env-file=\u003C(op inject -i .env.tpl) file.ts   # 1Password CLI renders dotenv lines; any pipe\u002FFIFO\u002F\u002Fdev\u002Fstdin works (v1.4.1+)\nbun --no-ffi-cc file.ts        # cc() from bun:ffi throws ERR_FFI_CC_DISABLED (v1.4.1+)\nbun --check file.ts            # Type check the file and its imports first; nothing runs on an error (v1.4.3+)\nbun --disallow-code-generation-from-strings=strict server.ts   # eval\u002Fnew Function\u002Fnode:vm\u002Fdata: imports throw EvalError (v1.4.3+)\nbun --no-orphans run dev       # Die with the parent, SIGKILL every descendant on exit\nbun repl                       # Native REPL: highlighting, history, completion (v1.3.10+)\nbun repl -p '{ a: 1 }'         # Evaluate and print with REPL semantics\nbun exec 'ls | wc -l'          # Run a shell script through Bun's shell\nbun .\u002FREADME.md                # Render Markdown in the terminal, no VM started\n```\n\n### bunx (npx Replacement)\n\n```bash\nbunx command                   # Run package binary (auto-installs if needed)\nbunx --bun command             # Force Bun runtime for the command\nbunx command@version           # Run specific version\n```\n\n### Parallel and Sequential Execution\n\nReplaces `npm-run-all` and `concurrently`. Output is prefixed per script (or `package:script`\nunder `--filter`), and `pre*`\u002F`post*` hooks stay grouped with their main script.\n\n```bash\nbun run --parallel build lint typecheck        # Run all concurrently\nbun run --parallel 'build:*'                   # Glob-match script names\nbun run --parallel --filter '*' build          # Fan out across every workspace\nbun run --parallel --no-exit-on-error --filter '*' test   # Keep going past failures\nbun run --sequential clean build deploy        # One at a time, same prefixed output\n```\n\nThe flag may also precede `run` (`bun --parallel run build lint`); both forms work.\n\n### Workspace-Aware Execution\n\n```bash\nbun --filter 'pkg-name' run script    # Run in specific workspace\nbun --filter '*' run script           # Run in all workspaces\nbun --filter '.\u002Fapps\u002F*' run build     # Run with glob pattern\n```\n\n### Script Flags\n\n```bash\nbun run --smol file.ts         # Reduce memory usage (sacrifice throughput)\nbun run --silent script        # Suppress script name echo\nbun run --shell=bun script     # Use Bun's built-in shell (cross-platform, default on Windows)\nbun run --shell=system script  # Use system shell (default on macOS\u002FLinux)\n```\n\n### Zero-Config Frontend Development\n\nRun HTML files directly as a dev server -- no Vite, Webpack, or any config needed:\n\n```bash\nbun .\u002Findex.html               # Start dev server, auto-bundles JS\u002FTS\u002FCSS\nbun --hot .\u002Findex.html         # With hot module replacement\n```\n\nBun automatically transpiles TypeScript, JSX, TSX, and CSS linked from the HTML. Resolves `node_modules` imports in `\u003Cscript>` tags. Enables HMR and React Fast Refresh.\n\n> **Reference**: See `references\u002Frunning-and-execution.md` for complete details.\n\n## Type Checking (v1.4.3+)\n\n`bun check` is a built-in port of TypeScript 7: it reads `tsconfig.json`, reports what `tsc`\nreports, uses every CPU core, needs no `typescript` package, and never writes files. Exit 1 on\nany error, 0 when clean, and 1 when there is nothing to check.\n\n```bash\nbun check                          # the project of the nearest tsconfig.json\nbun check src\u002Findex.ts             # one file and everything it imports\nbun check -b                       # every project in `references`, like tsc -b -- nothing pre-built\nbun --check src\u002Findex.ts           # type check, then run; nothing runs on an error\nbun test --check                   # no test runs on an error\nbun build --check .\u002Fapp.ts --outdir dist   # nothing is written on an error\nbun --watch --check src\u002Findex.ts   # re-check before every restart (there is no bun check --watch)\n```\n\n- **Point `types` at `bun-types`.** With no Bun types, or a stale `@types\u002Fbun`, `Bun`,\n  `bun:test`, and every API newer than the installed types fail to check. See \"Check the\n  Version\" above.\n- **A `check` script wins.** When `package.json` defines `check`, `bun check` runs that\n  script -- from the shell and from other scripts alike, so `bun init`'s\n  `\"typecheck\": \"bun check\"` then runs the lint script. Only inside the `check` script and the\n  scripts it starts is `bun check` the type checker. `bun --check` always type checks: use it in\n  scripts. On an older Bun, `\"check\": \"bun check\"` calls itself forever.\n- **Agent output.** With `CLAUDECODE=1`, `AGENT=1`, or `REPL_ID=1` set, errors print as\n  `\u003Cerror file= line= column= code=>` blocks with the source lines. `--no-pretty` gives one\n  `file(line,col): error TSxxxx: ...` line per error, the default when piped; the summary goes to\n  stderr.\n- **TypeScript 7 rules apply** whatever `typescript` is installed: `strict` is on, `types` is\n  empty unless listed, and a removed option (`baseUrl`, `moduleResolution: \"node\"`,\n  `target: \"es5\"`) stops the check before any file is checked.\n- **Keep `tsc` for `.d.ts` output** -- `bun check` emits nothing.\n\n> **Reference**: See `references\u002Ftype-checking.md` for what `--check` covers, output formats,\n> monorepos, CI, and the TypeScript 5-to-7 migration table.\n\n## Testing\n\nBun includes a built-in test runner compatible with Jest-like syntax.\n\n### Running Tests\n\n```bash\nbun test                          # Run all test files\nbun test file.test.ts             # Run specific file\nbun test foo bar                  # Positional args filter by FILE path, not test name\nbun test -t \"pattern\"             # Filter by TEST NAME (regex); --grep is an alias\nbun test --timeout 10000         # Set timeout (ms)\nbun test --bail                   # Stop on first failure\nbun test --bail 5                 # Stop after 5 failures\nbun test --rerun-each 3           # Run each test 3 times\nbun test --retry 3                # Default retry count for flaky tests\nbun test --only                   # Run only tests marked with .only\nbun test --todo                   # Include .todo tests\nbun test --only-failures          # Print failures and the summary only\nbun test --pass-with-no-tests     # Exit 0 when nothing matches (monorepos)\nbun test --check                  # Type check test files + imports first; no test runs on an error (v1.4.3+)\n```\n\n**`--filter` is not a test-name filter.** In `bun test`, `--filter` is another **file path**\nfilter, identical to a positional argument; `-F` is rejected. (Workspace selection is a\npackage-manager feature: `bun run --filter '*' test`.) Passing a test name usually matches\nno files, and `bun test` then exits **1** (\"did not match any test files\") -- so the mistake\nfails the run rather than passing it silently, but it still tests nothing. Use `-t` \u002F\n`--test-name-pattern` \u002F `--grep` for test names. `--pass-with-no-tests` turns that exit 1\ninto 0, which is what would hide it.\n\n### Coverage\n\n```bash\nbun test --coverage               # Enable code coverage\nbun test --coverage-reporter text # Coverage format: 'text' and\u002For 'lcov' -- there is no 'json'\nbun test --coverage-dir .\u002Fcov     # Output directory\n```\n\n`--coverage-reporter` implies `--coverage` as of v1.4.3. Before, `--coverage-reporter=lcov`\nalone ran the tests and wrote no report.\n\n### Parallelism, Sharding, Isolation\n\n```bash\nbun test --parallel               # Files across N worker processes (default: CPU count)\nbun test --parallel=4 --isolate   # Explicit worker count\nbun test --isolate                # Fresh globalThis per file, same process (Jest\u002FVitest default)\nbun test --shard=1\u002F3              # One CI runner's slice of the files\nbun test --changed=main           # Only files your diff reaches (walks the import graph)\nbun test --timings=t.json --update-timings   # Record per-file durations\nbun test --parallel --shard=1\u002F3 --timings=t.json   # Balance by wall time, not file count\n```\n\n- `--parallel` **implies `--isolate`**; `--no-isolate` opts out so each worker reuses one\n  global and module registry.\n- `--isolate` fixes \"passes alone, fails in the suite\" by resetting `globalThis` and the module\n  registries between files, and closing servers, sockets, watchers, and subprocesses the file\n  left open. Transpiled source and bytecode stay cached across globals, so the cost is low.\n- Workers expose their 1-indexed slot as `JEST_WORKER_ID` \u002F `BUN_TEST_WORKER_ID`, so Jest\n  setups that key a database or port off `JEST_WORKER_ID` work unchanged.\n- Coverage and JUnit output are merged across workers; `--bail` stops every worker.\n- `--timings` (v1.4+) makes shards equal in **time** rather than file count, and the file is\n  written slowest-first so it doubles as a slow-test report.\n- 1.4.1 stops files using `mock()`, `spyOn()`, `mock.module()`, or `Bun.plugin()` from keeping\n  the previous module graph alive under `--isolate`, so memory stays flat across a large suite.\n\n### Test File Patterns\n\nBy default, Bun finds files matching: `*.test.{ts,tsx,js,jsx}`, `*_test.{ts,tsx,js,jsx}`, `*.spec.{ts,tsx,js,jsx}`, `*_spec.{ts,tsx,js,jsx}`, and files in `__tests__\u002F` directories. Exclude paths with `--path-ignore-patterns \u003Cglob>` or `test.pathIgnorePatterns` in `bunfig.toml`.\n\n### Snapshot Testing\n\n```bash\nbun test --update-snapshots       # Update snapshot files\n```\n\n### Watch Mode\n\n```bash\nbun test --watch                  # Re-run on file changes\n```\n\n> **Reference**: See `references\u002Ftesting.md` for test API, mocking, lifecycle hooks, and coverage config.\n\n## Bundling and Compilation\n\n### Bundling\n\n```bash\nbun build .\u002Fsrc\u002Findex.ts --outdir .\u002Fdist           # Bundle to directory\nbun build .\u002Fsrc\u002Findex.ts --outfile .\u002Fdist\u002Fout.js    # Bundle to single file\nbun build .\u002Fsrc\u002Findex.ts --target browser           # Target: browser (default), bun, node\nbun build .\u002Fsrc\u002Findex.ts --format esm               # Format: esm (default), cjs, iife\nbun build .\u002Fsrc\u002Findex.ts --minify                   # Minify output\nbun build .\u002Fsrc\u002Findex.ts --sourcemap external        # Sourcemaps: external, inline, linked, none\nbun build .\u002Fsrc\u002Findex.ts --splitting                # Code splitting (ESM only)\nbun build .\u002Fsrc\u002Findex.ts --splitting --min-chunk-size=16384   # Fold tiny side-effect-free chunks into their loaders (v1.4.1+)\nbun build .\u002Fsrc\u002Findex.ts --outdir .\u002Fdist --check    # Type check first; nothing is written on an error (v1.4.3+)\n```\n\n**Changed in 1.4.1 -- splitting output.** Code shared between an entry and its lazy routes stays\nin the entry's chunk (fewer, smaller files), browser builds get `\u003Clink rel=\"modulepreload\">`\nfor every chunk an entry or `import()` loads (`--no-module-preload` to disable), `--target bun`\nturns `require()` of an ES module into its own chunk (`--no-split-require` to inline), and\n`export * as` \u002F `const { x } = await import()` tree-shake unused exports -- `zod` and `effect`\nbundles shrink 50-80%. Snapshot tests of build output will change.\n\n**Changed in 1.4.3 -- chunk names.** Large `--splitting` builds no longer fail with\n`Multiple files share the same output path`: two different chunks whose 8-character `[hash]`\ncollided now both get extra characters until they differ. `[hash9]` through `[hash13]` set a\nwider minimum (`[hash13]` is the full 64-bit hash; 1.4.2 printed the token literally and failed).\nShared code no longer folds into an entry chunk whose name has no `[hash]`, so an entry loaded\nwith a query string (`index.js?v=1`) cannot run twice -- a 1.4.1 regression. Each split\n`import()` in `metafile.inputs` names the file it loads in `entryPoint`.\n\n### Standalone Executables\n\n```bash\nbun build .\u002Fsrc\u002Fcli.ts --compile                    # Create self-contained executable\nbun build .\u002Fsrc\u002Fcli.ts --compile --target bun-linux-x64    # Cross-compile\nbun build .\u002Fsrc\u002Fcli.ts --compile --minify           # Minified executable\n```\n\nAvailable compilation targets: `bun-linux-x64`, `bun-linux-arm64`, `bun-darwin-x64`, `bun-darwin-arm64`, `bun-windows-x64`.\n\nBrowser target (v1.3.10+) -- compile to a self-contained HTML file:\n```bash\nbun build --compile --target=browser .\u002Fapp.tsx --outfile .\u002Fdist\u002Fapp.html\n```\n\n### Build Options\n\n```bash\nbun build ... --external pkg        # Exclude from bundle\nbun build ... --define 'KEY=VALUE'  # Define compile-time constants\nbun build ... --loader .ext=type    # Custom loaders (js, jsx, ts, tsx, json, css, text, file, base64, dataurl, binary)\nbun build ... --entry-naming [dir]\u002F[name].[ext]   # Output naming pattern\nbun build ... --chunk-naming 'chunk-[hash13].[ext]'   # Wider minimum hash: [hash9]..[hash13] (v1.4.3+)\nbun build ... --public-path \u002Fcdn\u002F   # Public path prefix for assets\nbun build ... --react-compiler      # React auto-memoization, no Babel\u002FSWC (v1.4+)\nbun build ... --metafile meta.json  # esbuild-format build metadata\nbun build ... --metafile-md meta.md # Module graph as Markdown, for reading or an LLM (v1.3.8+)\nbun build ... --feature=FLAG        # Compile-time flag for `feature()` from bun:bundle\nbun build .\u002Fsrc\u002Fcli.ts --compile --asset .\u002Fpublic --asset .\u002Ftemplates   # Embed files\u002Fdirs (v1.4+)\nbun build .\u002Fsrc\u002Fcli.ts --compile --bytecode --bytecode-depth=1   # Bytecode for top-level + one nesting level (v1.4.1+)\nbun build ... --no-deprecated-namespace-object-setters   # Getter-only `import * as ns` objects, the future default (v1.4.1+)\n```\n\n`--asset` (v1.4+) embeds a file or directory into a `--compile` executable keeping original\nfilenames, so `path.join(import.meta.dir, ...)` resolves the same as on disk. `node:fs` treats\n`\u002F$bunfs\u002F` as a real tree, so `readdirSync` (including `recursive`\u002F`withFileTypes`) works\ninside the binary -- static file servers that enumerate a directory at startup run unmodified.\n\n**Changed in v1.3.4:** `--compile` binaries no longer auto-load `tsconfig.json` or\n`package.json` from the runtime working directory (opt back in with\n`--compile-autoload-tsconfig` \u002F `--compile-autoload-package-json`); `.env` and `bunfig.toml`\nstill auto-load.\n`--bytecode` gained ES module support back in **v1.3.9** (`--format=esm`, requires\n`--compile`), enabling top-level await,\n`import.meta`, dynamic imports, and code splitting -- it previously forced CommonJS.\nAs of **v1.4.1** bytecode is about 3x the source size instead of 9x, `--bytecode-depth=N`\nlimits ahead-of-time compilation to N nesting levels (deeper functions compile on first call),\nand cross-compiling with `--bytecode` works for every target, `bun-windows-x64` from macOS or\nLinux included, with byte-identical output.\n\n**Profile-guided bytecode layout (v1.4.3+).** `--bytecode-order` puts the bytecode a recorded\nrun used at the front of a `--compile --bytecode` executable, so it reads and decodes less of\nitself (one large CLI: cold start 1.01 s to 0.53 s). It requires `--compile --bytecode`.\n\n```bash\nbun build .\u002Fsrc\u002Fcli.ts --compile --bytecode --outfile mycli                               # 1. build\nBUN_BYTECODE_ORDER_OUT=mycli.order .\u002Fmycli --help                                         # 2. run it as users do; written on exit\nbun build .\u002Fsrc\u002Fcli.ts --compile --bytecode --bytecode-order=mycli.order --outfile mycli  # 3. rebuild with the profile\n```\n\nFunctions are matched by a hash of their syntax, so last week's profile still applies --\ncommit or cache it. `--bytecode-order=a.order,b.order` takes several, most common first, and\n`bytecodeOrderStats()` from `bun:jsc` reports how much of a run the profile covered.\n`--compile-jit-policy \u003Cn>` starts the executable with JIT tier-up thresholds scaled by `n`, so\nrun-once startup code stays in the interpreter; call `Bun.unsafe.setJITPolicy(1)` once the app\nis interactive. `--no-optimize-bytecode` skips the build-time bytecode optimizer.\n\n> **Reference**: See `references\u002Fbundling-and-compilation.md` for complete options.\n\n## Project Initialization\n\n```bash\nbun init                       # Initialize new project (creates package.json, tsconfig.json, index.ts)\nbun init -y                    # Accept defaults, no template picker\nbun init --react               # React template (also --react=tailwind, --react=shadcn)\nbun init --minimal             # Type definitions only\nbun create template-name       # Create from template\nbun create next-app my-app     # Example: create Next.js app\n```\n\n`bun init` also writes a **`CLAUDE.md` of Bun's own agent rules** into the project root\n(copied from `node_modules\u002Fbun-types\u002FCLAUDE.md`) — \"use `bun` not `node`\u002F`npm`\", the API\nsubstitution list, and the HTML-imports frontend pattern. Recommend running it in new Bun\nprojects: it gives every agent working in the repo the same baseline, and points at the\nshipped docs.\n\n**Changed in 1.4.3:** `bun init` adds a `\"typecheck\": \"bun check\"` script (make it\n`bun --check` if the project has a `check` script), and the copied rules say `bun check` instead\nof `tsc --noEmit`. It still adds `\"@types\u002Fbun\": \"latest\"` with\n`\"types\": [\"bun\"]`, which resolves to the previous release for a day or more after each Bun\nrelease -- swap it for `bun-types` (see \"Check the Version\").\n\n**Changed in 1.4:** `bun init` writes `typescript: ^7` (it wrote `^5`, or nothing in the React\ntemplates), and with a non-TTY stdin (CI, a piped spawn) it behaves as `bun init -y` instead\nof opening the template picker. `bun update -i` with a non-TTY stdin now exits 1 -- use\n`bun update` or `bun outdated`.\n\n## Configuration (bunfig.toml)\n\nKey sections:\n\n```toml\n[run]\nbun = true                     # Always use Bun runtime (not Node)\n\n[install]\nexact = true                   # Pin exact versions by default\npeer = false                   # Don't auto-install peer deps\nproduction = false             # Include devDeps\nfrozenLockfile = false         # Don't fail on lockfile mismatch\nglobalDir = \"~\u002F.bun\u002Finstall\u002Fglobal\"  # Global install location\nlinker = \"isolated\"            # \"isolated\" or \"hoisted\" -- see gotchas\nglobalStore = true             # Share package files across projects (requires isolated)\noffline = false                # true: never touch the network, every package must be cached (v1.4.1+)\nprefer = \"online\"              # \"offline\": cached metadata regardless of age (v1.4.1+); \"latest\": always check\n\n[install.scopes]\n\"@myorg\" = { token = \"$NPM_TOKEN\", url = \"https:\u002F\u002Fnpm.pkg.github.com\u002F\" }\n\n[test]\ncoverage = false               # Enable coverage by default\ncoverageReporter = [\"text\", \"lcov\"]\ntimeout = 5000                 # Default test timeout\npathIgnorePatterns = [\"**\u002Fe2e\u002F**\"]   # Exclude test files by glob\n\n[bundle]\nentryPoints = [\".\u002Fsrc\u002Findex.ts\"]\noutdir = \".\u002Fdist\"\n```\n\n> **Reference**: See `references\u002Fconfiguration.md` for complete bunfig.toml reference.\n\n## Debugging and Profiling\n\n```bash\nbun --inspect file.ts              # Start debugger (WebSocket, connect via Chrome DevTools)\nbun --inspect-wait file.ts         # Wait for debugger to attach before executing\nbun --inspect-brk file.ts         # Break on first line\nbun --cpu-prof file.ts             # Generate CPU profile\nbun --cpu-prof-md file.ts          # CPU profile as Markdown (v1.3.7+)\nbun --heap-prof file.ts            # Generate heap profile\nbun --heap-prof-md file.ts         # Heap profile as Markdown (v1.3.7+)\nBUN_JSC_logJITCodeForPerf=1 bun file.ts  # Linux perf integration\n```\n\n## Environment Variables\n\n```bash\nbun --env-file .env file.ts        # Load .env file\nbun --env-file .env.local --env-file .env file.ts  # Load multiple (left takes precedence)\n```\n\nBun auto-loads `.env`, `.env.production`, `.env.local`, `.env.production.local` by default based on `NODE_ENV`.\n\n## Built-in Features That Replace External Tools\n\nBun has many capabilities built in that eliminate the need for external packages or tooling:\n\n### Native TypeScript\nBun runs `.ts`, `.tsx` files directly — no `tsc`, `ts-node`, or `tsx` needed. The transpiler is built into the runtime. Use `bun file.ts` to run any TypeScript file immediately.\n\n### Built-in Type Checker\n`bun check` (v1.4.3+) replaces `tsc --noEmit`, and `--check` gates `bun \u003Cfile>`, `bun test`, and `bun build` on a clean type check — no `typescript` package needed. Keep `tsc` only to emit `.d.ts` files.\n\n### Workspace Catalogs\nBun supports `catalog:` protocol in `package.json` for centralized dependency version management across monorepo workspaces — no need for tools like `syncpack` or `manypkg`:\n\n```json\n\u002F\u002F Root package.json\n{\n  \"workspaces\": [\"packages\u002F*\"],\n  \"catalog\": {\n    \"react\": \"^19.0.0\",\n    \"typescript\": \"^5.7.0\"\n  }\n}\n\n\u002F\u002F packages\u002Fapp\u002Fpackage.json\n{\n  \"dependencies\": {\n    \"react\": \"catalog:\"\n  }\n}\n```\n\n### Built-in Test Runner\n`bun test` is a full Jest-compatible test runner with snapshot testing, mocking, coverage — no need for `jest`, `vitest`, or `mocha`.\n\n### Built-in Bundler\n`bun build` replaces `esbuild`, `webpack`, `rollup` for many use cases. Supports code splitting, tree shaking, minification, and standalone executable compilation.\n\n### Built-in SQLite\n`import { Database } from 'bun:sqlite'` — zero-dependency SQLite3 with prepared statements and transactions. No need for `better-sqlite3` or `sql.js`.\n\n### Built-in Shell\n`Bun.$` tagged template — cross-platform shell execution with automatic escaping. Replaces `execa`, `shelljs`, `zx`.\n\n### Built-in File I\u002FO\n`Bun.file()` and `Bun.write()` — fast file operations without importing `fs`. Auto-detects MIME types.\n\n### Built-in Glob\n`new Bun.Glob(pattern)` — fast glob matching and file scanning. Replaces `glob`, `fast-glob`, `minimatch`.\n\n### Built-in Password Hashing\n`Bun.password.hash()` and `.verify()` with bcrypt and argon2id. Replaces `bcrypt`, `argon2` packages.\n\n### Built-in Compression\n`Bun.gzipSync()`, `Bun.deflateSync()`, `Bun.zstdCompressSync()` — no need for `zlib` wrapper packages.\n\n### Built-in Semver\n`Bun.semver.satisfies()`, `.order()` — replaces `semver` package.\n\n### Built-in Runtime APIs\nFor Bun's built-in runtime helpers (`Bun.s3`, `Bun.redis`, `Bun.Archive`, `JSONC`, `JSON5`, `JSONL`, `markdown`, `cron`), see the `bun-api` skill.\n\n### Zero-Config Frontend Dev Server\n`bun .\u002Findex.html` — serve HTML with auto-bundling of JS\u002FTS\u002FCSS, HMR, and React Fast Refresh. Replaces Vite\u002FWebpack dev server for simple projects.\n\n### ES Decorators\nTC39 standard ES decorators supported natively (v1.3.10+) — no `experimentalDecorators` tsconfig needed.\n\n## Key Gotchas\n\n1. **Always use `bun` not `npm`\u002F`node`\u002F`npx`** in Bun projects\n2. **Lockfile format**: `bun.lock` (text, v1.2+) is the default for new projects. Legacy `bun.lockb` is binary. Don't mix with `package-lock.json`. **v1.4+** writes `lockfileVersion: 2` (and `3` when nested or version-scoped overrides are used). **Bun 1.3 cannot read version 3** -- check before committing one to a repo whose CI pins an older Bun\n3. **trustedDependencies**: Lifecycle scripts (postinstall, etc.) only run for packages listed in `trustedDependencies` in package.json. **v1.3.5+** the default trusted list applies only to packages from the npm registry, so a `file:`\u002F`link:`\u002F`git:`\u002F`github:` dependency named `esbuild` gets no trust from the real esbuild's entry -- list it yourself. **v1.4+** entries match the exact package name rather than a truncated hash\n4. **`--bun` flag**: Some tools (e.g., Next.js) use Node.js by default even when run with `bun run`. Use `--bun` or `[run] bun = true` in `bunfig.toml` to force Bun runtime\n5. **Workspace protocol**: Use `\"workspace:*\"` in package.json to reference workspace packages\n6. **Global binaries**: Installed with `bun add -g`, located in `~\u002F.bun\u002Fbin\u002F`\n7. **Node.js compatibility**: Bun implements most Node.js APIs but some edge cases differ. Check https:\u002F\u002Fbun.sh\u002Fdocs\u002Fruntime\u002Fnodejs-apis for compatibility\n8. **TypeScript**: Bun runs TypeScript natively with no compilation step. Uses its own transpiler (not tsc), and running never type checks -- use `bun check` or `--check` (v1.4.3+)\n9. **Auto-install**: Bun can auto-install missing packages on import (disabled by default, enable with `[install] auto = true` in bunfig.toml)\n10. **`bun run` vs `bun`**: `bun run script` runs a package.json script; `bun file.ts` runs a file directly. `bun script` tries script first, then falls back to file\n11. **`--filter` is not a name filter for tests.** In `bun test` it filters **file paths**, same as a positional argument (`-F` is rejected; workspace selection is `bun run --filter '*' test`). `bun test -t \u003Cregex>` (or `--grep`) filters test names. Getting this wrong matches nothing and exits 1 -- unless `--pass-with-no-tests` is set, which turns it into a green run that tested nothing\n12. **Coverage reporters are `text` and `lcov` only** -- `--coverage-reporter=json` is rejected. As of v1.4.3 the flag implies `--coverage`\n13. **`bunfig.toml` is strict TOML as of v1.4.** Unquoted values, missing newlines between pairs, and integers past `Number.MAX_SAFE_INTEGER` now fail at startup with a `SyntaxError`. `linker = isolated` must be `linker = \"isolated\"`\n14. **Bun invoked as `node` no longer loads `.env` (v1.4+).** Under `bun --bun`, `bunx --bun`, or a `node` symlink, a script calling `node` sees those variables as `undefined`. Pass `--env-file`, matching Node's behavior\n15. **The isolated linker is not on by default for existing projects** -- it is chosen by the lockfile's `configVersion`, not the Bun version. See \"Install Layout\" above\n16. **x64 builds are baseline-only (v1.4+).** The `-march=haswell` build is gone; the `-baseline` download URLs and npm packages still exist and contain the same binary, and the `CPU lacks AVX support` warning is removed\n17. **`bun feedback` was removed in 1.4**\n18. **Bundled namespace objects will become getter-only.** `import * as ns` \u002F `export * as ns` from `bun build` currently accept `ns.x = 1` silently; `--no-deprecated-namespace-object-setters` (or `deprecatedNamespaceObjectSetters: false`) opts into the future default now (v1.4.1+)\n19. **`bun run --filter`, `--workspaces`, `--parallel`, and `--sequential` ignored an auto-discovered `bunfig.toml`** before 1.4.1 unless `--config` was passed; `bun run` also reused a stale transpile cache for files of 4 KiB or more after `[define]` or `--drop` changed\n20. **Bun 1.4.1's `bun build` could rename a nested `var` onto a `let` in the same block**, so bundles importing Elysia failed to load with `SyntaxError: Cannot declare a var variable that shadows a let\u002Fconst\u002Fclass variable`, and a `let` could take a parameter's or `catch` binding's name and compute wrong values. Fixed in 1.4.2 -- upgrade rather than patch the output, and do not pin 1.4.1 for bundling\n21. **A `check` script shadows `bun check` (v1.4.3+).** When `package.json` defines `check`, `bun check` runs it -- from other scripts too, except those the `check` script itself starts -- so `bun init`'s `\"typecheck\": \"bun check\"` then runs the lint script. `bun --check` type checks regardless: use it in scripts. On an older Bun, `\"check\": \"bun check\"` calls itself forever\n22. **`@types\u002Fbun` lags every Bun release**, often by a day or more, so `bun check` rejects the newest APIs (`TS2339`, `TS2353`). Depend on `bun-types@\u003Cruntime-version>` with `\"types\": [\"bun-types\"]` instead; installing `bun-types` beside `@types\u002Fbun` does not change what gets type checked\n23. **Installs no longer cache what they skip (v1.4.3+).** A `--production` or `--omit` install without a lockfile downloads no tarballs for the dropped groups, so it cannot warm a cache for a later full `--offline` install. Warm it with an install that places the same packages, on the same platform\n24. **`--disallow-code-generation-from-strings` is enforced as of 1.4.3** -- Bun accepted and ignored it before. `eval()` and `new Function()` now throw `EvalError` process-wide, Workers included; `=strict` also blocks `node:vm`, `data:`\u002F`blob:` imports, and plugins that return source text, and refuses `--inspect`\n\n## References\n\n> - `references\u002Fmigration-1.4.md` -- what changed from 1.3 through 1.4.3 for the CLI, package manager, bundler, and test runner\n> - `references\u002Fpackage-management.md` -- install\u002Fadd\u002Fupdate\u002Faudit\u002Fpm flags, workspaces, linkers\n> - `references\u002Frunning-and-execution.md` -- runtime flags, bunx, profiling, watch\u002Fhot, code-generation lockdown\n> - `references\u002Ftype-checking.md` -- `bun check`, `--check`, output formats, TypeScript 7 defaults, monorepos, CI\n> - `references\u002Ftesting.md` -- test runner API, mocking, coverage, CI shaping\n> - `references\u002Fbundling-and-compilation.md` -- `bun build`, targets, standalone executables\n> - `references\u002Fconfiguration.md` -- full `bunfig.toml` reference\n> - `references\u002Fallowlist.md` -- copy-paste `Bash(command:*)` permission patterns\n","# Bun CLI\n\nBun is an all-in-one JavaScript\u002FTypeScript runtime, package manager, bundler, test runner, and (v1.4.3+) type checker. Bun runs TypeScript natively — `bun file.ts` directly, no compile step, no `tsc`, no `ts-node` — and `bun check` replaces `tsc --noEmit`. Always use `bun` instead of `node`, `npm`, `npx`, `yarn`, or `pnpm` in Bun projects.\n\n**Verified against Bun v1.4.3** (2026-10-10). Features are tagged with the version that\nintroduced them (`v1.4+`, `v1.4.1+`, `v1.4.2+`, `v1.4.3+`). Where a release changed existing\nbehavior, both behaviors are stated so this skill stays correct on older projects -- run\n`bun --version` before relying on a version-tagged item.\n\n## Check the Version, Then Check Bun's Docs\n\n`bun \u003Ccommand> --help` is authoritative for flags and always matches the installed binary --\nprefer it over any table here when the two disagree.\n\nFor everything beyond flags, Bun ships its full docs inside `bun-types`, version-matched to\nthe runtime, in any project that has `bun-types` or `@types\u002Fbun` installed:\n\n```text\nnode_modules\u002Fbun-types\u002Fdocs\u002Fpm\u002F**\u002F*.mdx        # install, lockfile, workspaces, catalogs, linkers\nnode_modules\u002Fbun-types\u002Fdocs\u002Ftest\u002F**\u002F*.mdx      # test runner\nnode_modules\u002Fbun-types\u002Fdocs\u002Fbundler\u002F**\u002F*.mdx   # bun build, executables, loaders, plugins\nnode_modules\u002Fbun-types\u002Fdocs\u002Fruntime\u002Fbunfig.mdx\nnode_modules\u002Fbun-types\u002FCLAUDE.md             # Bun's own agent rules\n```\n\n1. **Depend on `bun-types`, not `@types\u002Fbun`.** `bun-types` ships with every Bun release and\n   carries both the docs and the types. `@types\u002Fbun` lags every release, often by a day or\n   more, yet `bun init` adds it as `latest` -- so `bun check` rejects the newest APIs\n   (`TS2339`, `TS2353`). Adding `bun-types` beside `@types\u002Fbun` fixes only the docs path:\n   type checking keeps `@types\u002Fbun`'s nested, pinned copy. Switch both:\n\n   ```bash\n   bun remove @types\u002Fbun\n   bun add -d bun-types@$(bun --version)   # then \"types\": [\"bun-types\"] in tsconfig.json\n   ```\n\n   Compare `bun --version` with `node_modules\u002Fbun-types\u002Fpackage.json` before trusting either.\n2. **Open by explicit path.** With the global virtual store enabled, `node_modules\u002Fbun-types`\n   is a symlink, so `find node_modules -name '*.mdx'` and `rg \u003Cpattern> node_modules` return\n   nothing. `find node_modules\u002Fbun-types\u002Fdocs -name '*.mdx'` works.\n3. **Never edit under `node_modules\u002F`.** Under the global store every project on the machine\n   shares the same inode. Use `bun patch`.\n4. **Not installed?** The same path works online: `docs\u002Fpm\u002Flockfile.mdx` is\n   `https:\u002F\u002Fbun.com\u002Fdocs\u002Fpm\u002Flockfile`.\n\n| Task | Doc path (under `node_modules\u002Fbun-types\u002Fdocs\u002F`) |\n|---|---|\n| Install behavior, lockfile, linkers | `pm\u002Fcli\u002Finstall.mdx`, `pm\u002Flockfile.mdx`, `pm\u002Fisolated-installs.mdx`, `pm\u002Fglobal-store.mdx` |\n| Workspaces, catalogs, filters, overrides | `pm\u002Fworkspaces.mdx`, `pm\u002Fcatalogs.mdx`, `pm\u002Ffilter.mdx`, `pm\u002Foverrides.mdx` |\n| Registries, auth, lifecycle scripts | `pm\u002Fscopes-registries.mdx`, `pm\u002Fnpmrc.mdx`, `pm\u002Flifecycle.mdx` |\n| Type checking (`bun check`, `--check`) | `runtime\u002Fcheck.mdx` |\n| Test runner | `test\u002Findex.mdx`, `test\u002Fdiscovery.mdx`, `test\u002Fconfiguration.mdx`, `test\u002Fcode-coverage.mdx`, `test\u002Freporters.mdx`, `test\u002Fmocks.mdx` |\n| Bundler, executables, loaders | `bundler\u002Findex.mdx`, `bundler\u002Fexecutables.mdx`, `bundler\u002Floaders.mdx`, `bundler\u002Fplugins.mdx` |\n| Config | `runtime\u002Fbunfig.mdx` |\n| Migrating from npm\u002Fyarn\u002Fpnpm | `guides\u002Finstall\u002Ffrom-npm-install-to-bun-install.mdx` |\n\n## Detecting Bun Projects\n\nA project uses Bun if any of these are present:\n- `bun.lock` or `bun.lockb` in the project root\n- `bunfig.toml` in the project root\n- `bun` field in `package.json` (e.g., `\"bun\": { \"install\": { ... } }`)\n- Package manager field: `\"packageManager\": \"bun@...\"`\n- `[run] bun = true` in `bunfig.toml` (forces Bun runtime for all scripts)\n\n## Critical Rule\n\n**In a Bun project, ALWAYS use `bun` for everything.** Never fall back to `node`, `npm`, `npx`, `yarn`, or `pnpm`. This avoids compatibility issues, unnecessary retries, and cryptic errors from Node.js\u002Fnpm not understanding Bun-specific features (workspace protocol, lockfile format, trustedDependencies, etc.).\n\n- Run files: `bun file.ts` (not `node file.ts`)\n- Run scripts: `bun run dev` (not `npm run dev`)\n- Execute binaries: `bunx tool` (not `npx tool`)\n- Install packages: `bun add pkg` (not `npm install pkg`)\n- Run tests: `bun test` (not `npx jest` or `node --test`)\n- Type check: `bun check` (not `tsc --noEmit`; v1.4.3+)\n\n## Read-Only Commands (safe, no side effects)\n\n| Command | Purpose |\n|---------|---------|\n| `bun --version` | Runtime version |\n| `bun info \u003Cpkg>` | Package metadata, available versions |\n| `bun info \u003Cpkg> versions` | List all published versions |\n| `bun pm ls` | List installed packages (alias: `bun list`) |\n| `bun pm ls --all` | List all (including transitive) |\n| `bun pm ls --trusted` | List only packages allowed to run lifecycle scripts (v1.4+) |\n| `bun pm hash` | Print lockfile hash |\n| `bun pm cache` | Show cache directory |\n| `bun pm bin` | Print the bin directory (`-g` for global) |\n| `bun pm licenses` | List dependencies grouped by license (v1.4+; `--json`, `--prod`) |\n| `bun pm diff \u003Cpkg>` | Diff two versions of a package (v1.4+) |\n| `bun pm untrusted` | List packages whose lifecycle scripts were blocked |\n| `bun why \u003Cpkg>` | Explain why a package is installed |\n| `bun outdated` | Check for outdated dependencies |\n| `bun audit` | Security vulnerability audit |\n| `bun dedupe --check` | Exit 1 if the lockfile has removable duplicates (v1.4+) |\n| `bun prune --dry-run` | Show what would be removed from `node_modules` (v1.4+) |\n| `bun test` | Run test suite |\n| `bun --check` | Type check the whole project and exit; never writes files or runs a script (v1.4.3+). `bun check` does the same unless `package.json` defines a `check` script, which it runs instead |\n| `bun run lint` | Run linter (project-specific) |\n| `bun run check-types` | Type checking (project-specific) |\n\n> **Reference**: See `references\u002Fallowlist.md` for copy-paste `Bash(command:*)` patterns for Claude Code \u002F OpenCode settings.\n\n## npm\u002Fnpx\u002Fnode to Bun Translation\n\n| npm\u002Fnpx\u002Fnode | Bun equivalent |\n|---|---|\n| `npm install` | `bun install` |\n| `npm install pkg` | `bun add pkg` |\n| `npm install -D pkg` | `bun add -d pkg` |\n| `npm install -g pkg` | `bun add -g pkg` |\n| `npm uninstall pkg` | `bun remove pkg` |\n| `npm update` | `bun update` |\n| `npm run script` | `bun run script` |\n| `npx command` | `bunx command` |\n| `node file.js` | `bun file.js` |\n| `node --watch file.js` | `bun --watch file.js` |\n| `npm test` | `bun test` |\n| `tsc --noEmit` | `bun check` (v1.4.3+) |\n| `npm pack` | `bun pm pack` |\n| `npm publish` | `bun publish` |\n| `npm info pkg` | `bun info pkg` |\n| `npm outdated` | `bun outdated` |\n| `npm audit` | `bun audit` |\n| `npm link` | `bun link` |\n\n### Key Behavioral Differences\n\n- **No `npm run` prefix needed**: `bun run dev` works, but so does `bun dev` (direct script execution)\n- **`--bun` flag**: Forces Bun runtime instead of Node.js for scripts that use `node` in their shebang. In `bunfig.toml`, set `[run] bun = true` to make this the default\n- **Lockfile**: Bun uses `bun.lock` (text-based, v1.2+) or `bun.lockb` (binary, legacy). Text lockfile is default for new projects\n- **Workspace commands**: Use `--filter` flag: `bun --filter 'pkg-name' add dep`\n- **Lifecycle scripts**: Bun ignores lifecycle scripts by default for security. Use `trustedDependencies` in package.json to allowlist packages that need postinstall etc.\n\n## Package Management\n\n### Installing Dependencies\n\n```bash\nbun install                    # Install all from package.json\nbun install --frozen-lockfile  # CI mode: fail if lockfile needs update\nbun install --no-save          # Install without updating package.json\nbun install --production       # Skip devDependencies\nbun install --dry-run          # Show what would be installed\nbun install --offline          # No network at all; every package must already be cached (v1.4.1+)\nbun install --prefer-offline   # Cached metadata regardless of age; download only what is missing (v1.4.1+)\n```\n\n`--offline` suits CI jobs that restore `~\u002F.bun\u002Finstall\u002Fcache` and air-gapped machines -- a\nmissing package fails by name (`no cached manifest for 'left-pad'`). `--prefer-offline` skips\nthe staleness check but still fetches uncached packages. Both have `bunfig.toml` forms:\n`[install] offline = true` and `[install] prefer = \"offline\"`.\n\n**Changed in 1.4.3 -- installs cache only what they place.** Without a lockfile, `bun install`\nand `bun add` no longer download tarballs that never land in `node_modules`: groups dropped by\n`--production` or `--omit`, other platforms' optional packages, bundled dependencies. A cache\nwarmed by `bun install --production` then fails a full `--offline` install with\n`\"left-pad\" is not in the cache`. Warm an offline cache with an install that places at least\nthe same packages, on the same platform.\n\n### Adding\u002FRemoving Packages\n\n```bash\nbun add pkg                    # Add to dependencies\nbun add pkg@version            # Add specific version\nbun add -d pkg                 # Add to devDependencies (--dev)\nbun add -D pkg                 # Same as -d\nbun add --optional pkg         # Add to optionalDependencies\nbun add --peer pkg             # Add to peerDependencies\nbun add -g pkg                 # Install globally\nbun add --exact pkg            # Pin exact version (no ^)\nbun add pkg --filter api       # Add to one workspace from the repo root (v1.4+)\nbun add pkg --catalog          # Add to the root catalog, depend on it as \"catalog:\" (v1.4+)\nbun remove pkg                 # Remove package\n```\n\n**Changed in 1.4:** `bun add`, `bun remove`, and `bun update` accept `--filter`, and\n`bun install \u003Cpkg> --filter x` now edits workspace `x` rather than the root. In a workspace\nwhose default catalog already lists the package, a plain `bun add \u003Cpkg>` writes `catalog:`.\n`--filter 'web...'` selects `web` and everything it depends on; `'...web'` selects everything\nthat depends on `web`.\n\n### Updating and Inspecting\n\n```bash\nbun update                     # Update all packages within package.json ranges\nbun update pkg                 # Update every copy of pkg, transitive ones included (v1.4+)\nbun update '@types\u002F*' --latest # Patterns; --latest ignores the declared range\nbun update --recursive         # Update every workspace and write each package.json (v1.4+)\nbun update --filter 'pkg-*' --filter '!pkg-c'   # Repeatable; ! excludes (v1.4+)\nbun outdated                   # Show outdated packages\nbun info pkg                   # Show package metadata\nbun info pkg versions          # List all available versions\nbun why pkg                    # Explain why a package is in the tree\nbun pm ls                      # List installed packages (alias: bun list)\nbun pm ls --all                # List all (including transitive)\nbun pm hash                    # Print lockfile hash\nbun pm cache                   # Show cache directory\nbun pm cache rm                # Clear cache (including the global virtual store)\n```\n\n**Changed in 1.4:** `bun update` re-resolves transitive dependencies, not just the ones named\nin `package.json`, and `bun update \u003Cname>` **errors with exit 1** when nothing depends on that\nname (it used to add the package).\n\n### Maintenance (v1.4+)\n\n```bash\nbun audit fix                  # Upgrade vulnerable packages to the lowest safe version\nbun audit fix --dry-run        # Preview\nbun audit fix --latest         # Also apply fixes your declared ranges exclude\nbun dedupe                     # Collapse duplicate versions in bun.lock, then install\nbun dedupe --check             # CI gate: exit 1 if duplicates remain\nbun prune                      # Drop node_modules entries no longer in bun.lock\nbun prune --production         # Also drop devDependencies -- build with them, ship without\nbun pm licenses --prod --json  # License inventory\nbun pm diff react@18.2.0 19.0.0  # What changed between two versions of a package\n```\n\n`bun pm diff` leads with a summary -- files changed, new install scripts, and new imports of\n`child_process`, `fs`, `net`, or `vm` -- then the diff, with minified files expanded and\nformatting-only changes skipped. Useful for reviewing a dependency bump.\n\n`bun prune --production` fits the Docker build stage:\n\n```dockerfile\nCOPY package.json bun.lock .\u002F\nRUN bun install --frozen-lockfile\nCOPY . .\nRUN bun run build\nRUN bun prune --production\n```\n\n### Linking and Patching\n\n```bash\nbun link                       # Register current package as linkable\nbun link pkg-name              # Link a registered package\nbun pm pack                    # Create tarball of package\nbun patch pkg                  # Start patching a package\nbun patch --commit pkg-dir     # Apply patch\n```\n\n### Publishing\n\n```bash\nbun publish                    # Publish to npm\nbun publish --dry-run          # Preview what would be published\nbun publish --tag beta         # Publish with tag\nbun publish --access public    # Set access level\n```\n\n> **Reference**: See `references\u002Fpackage-management.md` for complete flag details.\n\n## Install Layout: Linker and Global Virtual Store\n\nTwo settings decide how `node_modules` is laid out. Both matter more than they look.\n\n### Linker\n\n| | `hoisted` | `isolated` |\n|---|---|---|\n| Layout | npm-style flat `node_modules` | symlinks into `node_modules\u002F.bun\u002F` (pnpm-style) |\n| Phantom dependencies | resolve silently | fail, as they should |\n| Default when | `configVersion = 0` (any project), or `configVersion = 1` without workspaces | `configVersion = 1` **and** the project uses workspaces |\n\nThe default depends on the lockfile's `configVersion`, not on the Bun version: isolated only\nwhen `configVersion = 1` **and** the project uses workspaces. Lockfiles created before v1.3.2\nare treated as `configVersion = 0` and keep hoisted, so upgrading Bun does not change an\nexisting project's layout. Override with `--linker` or `[install] linker`.\n\n### Global Virtual Store (v1.3.14+, faster in 1.4)\n\nPackage files live once in `~\u002F.bun\u002Finstall\u002Fcache\u002Flinks\u002F` and each project symlinks into them:\nwarm installs are roughly 7x faster, and `node_modules` drops from hundreds of MB to a few MB\nof links. **It is off by default and needs both settings** -- with `linker = \"hoisted\"` the\n`globalStore` flag is silently ignored.\n\n```toml\n[install]\nlinker = \"isolated\"      # prerequisite\nglobalStore = true\n```\n\n```bash\nBUN_INSTALL_GLOBAL_STORE=1 bun install --linker isolated   # per invocation\nbun pm cache rm                                            # clears the store too\n```\n\nConsequences worth knowing before enabling it:\n\n1. **`node_modules` is mostly symlinks.** `find node_modules -name '*.mdx'` and\n   `rg \u003Cpattern> node_modules` return nothing, and `du -sh node_modules` reports ~`0B`\n   because it measures the symlinks rather than their targets (the real tree is a few MB of\n   links; `du -sh -L` shows the target sizes, counted once per link). Address\n   files by explicit path, or pass `find -L` (which double-counts through the link layers).\n   Tools that scan `node_modules` without following symlinks behave differently -- the same\n   caveat as any pnpm-style layout.\n2. **Every project shares the same inode.** Editing a file under `node_modules\u002F` changes it\n   for every project on the machine. Use `bun patch`.\n3. **True phantom dependencies stop resolving.** Packages realpath into the cache, so the\n   hidden `node_modules\u002F.bun\u002Fnode_modules\u002F` layer is no longer on the resolution path from\n   inside a package. Fix by declaring the dependency, or set `globalStore = false`.\n4. **Some entries stay project-local**: patched packages, `trustedDependencies`, and anything\n   depending on a `workspace:`, `file:`, or `link:` dependency. Ineligibility propagates up\n   the graph, so a monorepo keeps a good share of the tree local regardless.\n\n> **Reference**: `node_modules\u002Fbun-types\u002Fdocs\u002Fpm\u002Fglobal-store.mdx` and `pm\u002Fisolated-installs.mdx`.\n\n### Self-Contained Workspaces (v1.4.1+, hoisted linker)\n\nElectron packagers and serverless bundlers repackage one workspace's `node_modules` and expect\nevery dependency physically under it. List such workspaces in the root `package.json`, or set\nYarn's `\"installConfig\": { \"hoistingLimits\": \"workspaces\" }` in the workspace's own file:\n\n```json\n{ \"workspaces\": { \"packages\": [\"apps\u002F*\", \"packages\u002F*\"], \"selfContained\": [\"apps\u002Fdesktop\"] } }\n```\n\nNothing that workspace depends on, directly or transitively, is hoisted above\n`apps\u002Fdesktop\u002Fnode_modules`, and those packages are real copies rather than cache hardlinks.\nThe lockfile does not record it, and it has no effect under the isolated linker.\n\n## Running Scripts and Files\n\n### Direct Execution\n\n```bash\nbun file.ts                    # Run TypeScript\u002FJavaScript directly\nbun run script-name            # Run package.json script\nbun script-name                # Short form (if no conflict with bun commands)\nbun --watch file.ts            # Re-run on file changes\nbun --hot file.ts              # Hot reload (preserves state)\nbun --env-file .env file.ts    # Load env file\nbun --env-file .env.local --env-file .env file.ts  # Multiple env files\nbun --no-env-file file.ts      # Skip automatic .env loading (CI\u002Fprod; `env = false` in bunfig)\nbun --env-file=\u003C(op inject -i .env.tpl) file.ts   # 1Password CLI renders dotenv lines; any pipe\u002FFIFO\u002F\u002Fdev\u002Fstdin works (v1.4.1+)\nbun --no-ffi-cc file.ts        # cc() from bun:ffi throws ERR_FFI_CC_DISABLED (v1.4.1+)\nbun --check file.ts            # Type check the file and its imports first; nothing runs on an error (v1.4.3+)\nbun --disallow-code-generation-from-strings=strict server.ts   # eval\u002Fnew Function\u002Fnode:vm\u002Fdata: imports throw EvalError (v1.4.3+)\nbun --no-orphans run dev       # Die with the parent, SIGKILL every descendant on exit\nbun repl                       # Native REPL: highlighting, history, completion (v1.3.10+)\nbun repl -p '{ a: 1 }'         # Evaluate and print with REPL semantics\nbun exec 'ls | wc -l'          # Run a shell script through Bun's shell\nbun .\u002FREADME.md                # Render Markdown in the terminal, no VM started\n```\n\n### bunx (npx Replacement)\n\n```bash\nbunx command                   # Run package binary (auto-installs if needed)\nbunx --bun command             # Force Bun runtime for the command\nbunx command@version           # Run specific version\n```\n\n### Parallel and Sequential Execution\n\nReplaces `npm-run-all` and `concurrently`. Output is prefixed per script (or `package:script`\nunder `--filter`), and `pre*`\u002F`post*` hooks stay grouped with their main script.\n\n```bash\nbun run --parallel build lint typecheck        # Run all concurrently\nbun run --parallel 'build:*'                   # Glob-match script names\nbun run --parallel --filter '*' build          # Fan out across every workspace\nbun run --parallel --no-exit-on-error --filter '*' test   # Keep going past failures\nbun run --sequential clean build deploy        # One at a time, same prefixed output\n```\n\nThe flag may also precede `run` (`bun --parallel run build lint`); both forms work.\n\n### Workspace-Aware Execution\n\n```bash\nbun --filter 'pkg-name' run script    # Run in specific workspace\nbun --filter '*' run script           # Run in all workspaces\nbun --filter '.\u002Fapps\u002F*' run build     # Run with glob pattern\n```\n\n### Script Flags\n\n```bash\nbun run --smol file.ts         # Reduce memory usage (sacrifice throughput)\nbun run --silent script        # Suppress script name echo\nbun run --shell=bun script     # Use Bun's built-in shell (cross-platform, default on Windows)\nbun run --shell=system script  # Use system shell (default on macOS\u002FLinux)\n```\n\n### Zero-Config Frontend Development\n\nRun HTML files directly as a dev server -- no Vite, Webpack, or any config needed:\n\n```bash\nbun .\u002Findex.html               # Start dev server, auto-bundles JS\u002FTS\u002FCSS\nbun --hot .\u002Findex.html         # With hot module replacement\n```\n\nBun automatically transpiles TypeScript, JSX, TSX, and CSS linked from the HTML. Resolves `node_modules` imports in `\u003Cscript>` tags. Enables HMR and React Fast Refresh.\n\n> **Reference**: See `references\u002Frunning-and-execution.md` for complete details.\n\n## Type Checking (v1.4.3+)\n\n`bun check` is a built-in port of TypeScript 7: it reads `tsconfig.json`, reports what `tsc`\nreports, uses every CPU core, needs no `typescript` package, and never writes files. Exit 1 on\nany error, 0 when clean, and 1 when there is nothing to check.\n\n```bash\nbun check                          # the project of the nearest tsconfig.json\nbun check src\u002Findex.ts             # one file and everything it imports\nbun check -b                       # every project in `references`, like tsc -b -- nothing pre-built\nbun --check src\u002Findex.ts           # type check, then run; nothing runs on an error\nbun test --check                   # no test runs on an error\nbun build --check .\u002Fapp.ts --outdir dist   # nothing is written on an error\nbun --watch --check src\u002Findex.ts   # re-check before every restart (there is no bun check --watch)\n```\n\n- **Point `types` at `bun-types`.** With no Bun types, or a stale `@types\u002Fbun`, `Bun`,\n  `bun:test`, and every API newer than the installed types fail to check. See \"Check the\n  Version\" above.\n- **A `check` script wins.** When `package.json` defines `check`, `bun check` runs that\n  script -- from the shell and from other scripts alike, so `bun init`'s\n  `\"typecheck\": \"bun check\"` then runs the lint script. Only inside the `check` script and the\n  scripts it starts is `bun check` the type checker. `bun --check` always type checks: use it in\n  scripts. On an older Bun, `\"check\": \"bun check\"` calls itself forever.\n- **Agent output.** With `CLAUDECODE=1`, `AGENT=1`, or `REPL_ID=1` set, errors print as\n  `\u003Cerror file= line= column= code=>` blocks with the source lines. `--no-pretty` gives one\n  `file(line,col): error TSxxxx: ...` line per error, the default when piped; the summary goes to\n  stderr.\n- **TypeScript 7 rules apply** whatever `typescript` is installed: `strict` is on, `types` is\n  empty unless listed, and a removed option (`baseUrl`, `moduleResolution: \"node\"`,\n  `target: \"es5\"`) stops the check before any file is checked.\n- **Keep `tsc` for `.d.ts` output** -- `bun check` emits nothing.\n\n> **Reference**: See `references\u002Ftype-checking.md` for what `--check` covers, output formats,\n> monorepos, CI, and the TypeScript 5-to-7 migration table.\n\n## Testing\n\nBun includes a built-in test runner compatible with Jest-like syntax.\n\n### Running Tests\n\n```bash\nbun test                          # Run all test files\nbun test file.test.ts             # Run specific file\nbun test foo bar                  # Positional args filter by FILE path, not test name\nbun test -t \"pattern\"             # Filter by TEST NAME (regex); --grep is an alias\nbun test --timeout 10000         # Set timeout (ms)\nbun test --bail                   # Stop on first failure\nbun test --bail 5                 # Stop after 5 failures\nbun test --rerun-each 3           # Run each test 3 times\nbun test --retry 3                # Default retry count for flaky tests\nbun test --only                   # Run only tests marked with .only\nbun test --todo                   # Include .todo tests\nbun test --only-failures          # Print failures and the summary only\nbun test --pass-with-no-tests     # Exit 0 when nothing matches (monorepos)\nbun test --check                  # Type check test files + imports first; no test runs on an error (v1.4.3+)\n```\n\n**`--filter` is not a test-name filter.** In `bun test`, `--filter` is another **file path**\nfilter, identical to a positional argument; `-F` is rejected. (Workspace selection is a\npackage-manager feature: `bun run --filter '*' test`.) Passing a test name usually matches\nno files, and `bun test` then exits **1** (\"did not match any test files\") -- so the mistake\nfails the run rather than passing it silently, but it still tests nothing. Use `-t` \u002F\n`--test-name-pattern` \u002F `--grep` for test names. `--pass-with-no-tests` turns that exit 1\ninto 0, which is what would hide it.\n\n### Coverage\n\n```bash\nbun test --coverage               # Enable code coverage\nbun test --coverage-reporter text # Coverage format: 'text' and\u002For 'lcov' -- there is no 'json'\nbun test --coverage-dir .\u002Fcov     # Output directory\n```\n\n`--coverage-reporter` implies `--coverage` as of v1.4.3. Before, `--coverage-reporter=lcov`\nalone ran the tests and wrote no report.\n\n### Parallelism, Sharding, Isolation\n\n```bash\nbun test --parallel               # Files across N worker processes (default: CPU count)\nbun test --parallel=4 --isolate   # Explicit worker count\nbun test --isolate                # Fresh globalThis per file, same process (Jest\u002FVitest default)\nbun test --shard=1\u002F3              # One CI runner's slice of the files\nbun test --changed=main           # Only files your diff reaches (walks the import graph)\nbun test --timings=t.json --update-timings   # Record per-file durations\nbun test --parallel --shard=1\u002F3 --timings=t.json   # Balance by wall time, not file count\n```\n\n- `--parallel` **implies `--isolate`**; `--no-isolate` opts out so each worker reuses one\n  global and module registry.\n- `--isolate` fixes \"passes alone, fails in the suite\" by resetting `globalThis` and the module\n  registries between files, and closing servers, sockets, watchers, and subprocesses the file\n  left open. Transpiled source and bytecode stay cached across globals, so the cost is low.\n- Workers expose their 1-indexed slot as `JEST_WORKER_ID` \u002F `BUN_TEST_WORKER_ID`, so Jest\n  setups that key a database or port off `JEST_WORKER_ID` work unchanged.\n- Coverage and JUnit output are merged across workers; `--bail` stops every worker.\n- `--timings` (v1.4+) makes shards equal in **time** rather than file count, and the file is\n  written slowest-first so it doubles as a slow-test report.\n- 1.4.1 stops files using `mock()`, `spyOn()`, `mock.module()`, or `Bun.plugin()` from keeping\n  the previous module graph alive under `--isolate`, so memory stays flat across a large suite.\n\n### Test File Patterns\n\nBy default, Bun finds files matching: `*.test.{ts,tsx,js,jsx}`, `*_test.{ts,tsx,js,jsx}`, `*.spec.{ts,tsx,js,jsx}`, `*_spec.{ts,tsx,js,jsx}`, and files in `__tests__\u002F` directories. Exclude paths with `--path-ignore-patterns \u003Cglob>` or `test.pathIgnorePatterns` in `bunfig.toml`.\n\n### Snapshot Testing\n\n```bash\nbun test --update-snapshots       # Update snapshot files\n```\n\n### Watch Mode\n\n```bash\nbun test --watch                  # Re-run on file changes\n```\n\n> **Reference**: See `references\u002Ftesting.md` for test API, mocking, lifecycle hooks, and coverage config.\n\n## Bundling and Compilation\n\n### Bundling\n\n```bash\nbun build .\u002Fsrc\u002Findex.ts --outdir .\u002Fdist           # Bundle to directory\nbun build .\u002Fsrc\u002Findex.ts --outfile .\u002Fdist\u002Fout.js    # Bundle to single file\nbun build .\u002Fsrc\u002Findex.ts --target browser           # Target: browser (default), bun, node\nbun build .\u002Fsrc\u002Findex.ts --format esm               # Format: esm (default), cjs, iife\nbun build .\u002Fsrc\u002Findex.ts --minify                   # Minify output\nbun build .\u002Fsrc\u002Findex.ts --sourcemap external        # Sourcemaps: external, inline, linked, none\nbun build .\u002Fsrc\u002Findex.ts --splitting                # Code splitting (ESM only)\nbun build .\u002Fsrc\u002Findex.ts --splitting --min-chunk-size=16384   # Fold tiny side-effect-free chunks into their loaders (v1.4.1+)\nbun build .\u002Fsrc\u002Findex.ts --outdir .\u002Fdist --check    # Type check first; nothing is written on an error (v1.4.3+)\n```\n\n**Changed in 1.4.1 -- splitting output.** Code shared between an entry and its lazy routes stays\nin the entry's chunk (fewer, smaller files), browser builds get `\u003Clink rel=\"modulepreload\">`\nfor every chunk an entry or `import()` loads (`--no-module-preload` to disable), `--target bun`\nturns `require()` of an ES module into its own chunk (`--no-split-require` to inline), and\n`export * as` \u002F `const { x } = await import()` tree-shake unused exports -- `zod` and `effect`\nbundles shrink 50-80%. Snapshot tests of build output will change.\n\n**Changed in 1.4.3 -- chunk names.** Large `--splitting` builds no longer fail with\n`Multiple files share the same output path`: two different chunks whose 8-character `[hash]`\ncollided now both get extra characters until they differ. `[hash9]` through `[hash13]` set a\nwider minimum (`[hash13]` is the full 64-bit hash; 1.4.2 printed the token literally and failed).\nShared code no longer folds into an entry chunk whose name has no `[hash]`, so an entry loaded\nwith a query string (`index.js?v=1`) cannot run twice -- a 1.4.1 regression. Each split\n`import()` in `metafile.inputs` names the file it loads in `entryPoint`.\n\n### Standalone Executables\n\n```bash\nbun build .\u002Fsrc\u002Fcli.ts --compile                    # Create self-contained executable\nbun build .\u002Fsrc\u002Fcli.ts --compile --target bun-linux-x64    # Cross-compile\nbun build .\u002Fsrc\u002Fcli.ts --compile --minify           # Minified executable\n```\n\nAvailable compilation targets: `bun-linux-x64`, `bun-linux-arm64`, `bun-darwin-x64`, `bun-darwin-arm64`, `bun-windows-x64`.\n\nBrowser target (v1.3.10+) -- compile to a self-contained HTML file:\n```bash\nbun build --compile --target=browser .\u002Fapp.tsx --outfile .\u002Fdist\u002Fapp.html\n```\n\n### Build Options\n\n```bash\nbun build ... --external pkg        # Exclude from bundle\nbun build ... --define 'KEY=VALUE'  # Define compile-time constants\nbun build ... --loader .ext=type    # Custom loaders (js, jsx, ts, tsx, json, css, text, file, base64, dataurl, binary)\nbun build ... --entry-naming [dir]\u002F[name].[ext]   # Output naming pattern\nbun build ... --chunk-naming 'chunk-[hash13].[ext]'   # Wider minimum hash: [hash9]..[hash13] (v1.4.3+)\nbun build ... --public-path \u002Fcdn\u002F   # Public path prefix for assets\nbun build ... --react-compiler      # React auto-memoization, no Babel\u002FSWC (v1.4+)\nbun build ... --metafile meta.json  # esbuild-format build metadata\nbun build ... --metafile-md meta.md # Module graph as Markdown, for reading or an LLM (v1.3.8+)\nbun build ... --feature=FLAG        # Compile-time flag for `feature()` from bun:bundle\nbun build .\u002Fsrc\u002Fcli.ts --compile --asset .\u002Fpublic --asset .\u002Ftemplates   # Embed files\u002Fdirs (v1.4+)\nbun build .\u002Fsrc\u002Fcli.ts --compile --bytecode --bytecode-depth=1   # Bytecode for top-level + one nesting level (v1.4.1+)\nbun build ... --no-deprecated-namespace-object-setters   # Getter-only `import * as ns` objects, the future default (v1.4.1+)\n```\n\n`--asset` (v1.4+) embeds a file or directory into a `--compile` executable keeping original\nfilenames, so `path.join(import.meta.dir, ...)` resolves the same as on disk. `node:fs` treats\n`\u002F$bunfs\u002F` as a real tree, so `readdirSync` (including `recursive`\u002F`withFileTypes`) works\ninside the binary -- static file servers that enumerate a directory at startup run unmodified.\n\n**Changed in v1.3.4:** `--compile` binaries no longer auto-load `tsconfig.json` or\n`package.json` from the runtime working directory (opt back in with\n`--compile-autoload-tsconfig` \u002F `--compile-autoload-package-json`); `.env` and `bunfig.toml`\nstill auto-load.\n`--bytecode` gained ES module support back in **v1.3.9** (`--format=esm`, requires\n`--compile`), enabling top-level await,\n`import.meta`, dynamic imports, and code splitting -- it previously forced CommonJS.\nAs of **v1.4.1** bytecode is about 3x the source size instead of 9x, `--bytecode-depth=N`\nlimits ahead-of-time compilation to N nesting levels (deeper functions compile on first call),\nand cross-compiling with `--bytecode` works for every target, `bun-windows-x64` from macOS or\nLinux included, with byte-identical output.\n\n**Profile-guided bytecode layout (v1.4.3+).** `--bytecode-order` puts the bytecode a recorded\nrun used at the front of a `--compile --bytecode` executable, so it reads and decodes less of\nitself (one large CLI: cold start 1.01 s to 0.53 s). It requires `--compile --bytecode`.\n\n```bash\nbun build .\u002Fsrc\u002Fcli.ts --compile --bytecode --outfile mycli                               # 1. build\nBUN_BYTECODE_ORDER_OUT=mycli.order .\u002Fmycli --help                                         # 2. run it as users do; written on exit\nbun build .\u002Fsrc\u002Fcli.ts --compile --bytecode --bytecode-order=mycli.order --outfile mycli  # 3. rebuild with the profile\n```\n\nFunctions are matched by a hash of their syntax, so last week's profile still applies --\ncommit or cache it. `--bytecode-order=a.order,b.order` takes several, most common first, and\n`bytecodeOrderStats()` from `bun:jsc` reports how much of a run the profile covered.\n`--compile-jit-policy \u003Cn>` starts the executable with JIT tier-up thresholds scaled by `n`, so\nrun-once startup code stays in the interpreter; call `Bun.unsafe.setJITPolicy(1)` once the app\nis interactive. `--no-optimize-bytecode` skips the build-time bytecode optimizer.\n\n> **Reference**: See `references\u002Fbundling-and-compilation.md` for complete options.\n\n## Project Initialization\n\n```bash\nbun init                       # Initialize new project (creates package.json, tsconfig.json, index.ts)\nbun init -y                    # Accept defaults, no template picker\nbun init --react               # React template (also --react=tailwind, --react=shadcn)\nbun init --minimal             # Type definitions only\nbun create template-name       # Create from template\nbun create next-app my-app     # Example: create Next.js app\n```\n\n`bun init` also writes a **`CLAUDE.md` of Bun's own agent rules** into the project root\n(copied from `node_modules\u002Fbun-types\u002FCLAUDE.md`) — \"use `bun` not `node`\u002F`npm`\", the API\nsubstitution list, and the HTML-imports frontend pattern. Recommend running it in new Bun\nprojects: it gives every agent working in the repo the same baseline, and points at the\nshipped docs.\n\n**Changed in 1.4.3:** `bun init` adds a `\"typecheck\": \"bun check\"` script (make it\n`bun --check` if the project has a `check` script), and the copied rules say `bun check` instead\nof `tsc --noEmit`. It still adds `\"@types\u002Fbun\": \"latest\"` with\n`\"types\": [\"bun\"]`, which resolves to the previous release for a day or more after each Bun\nrelease -- swap it for `bun-types` (see \"Check the Version\").\n\n**Changed in 1.4:** `bun init` writes `typescript: ^7` (it wrote `^5`, or nothing in the React\ntemplates), and with a non-TTY stdin (CI, a piped spawn) it behaves as `bun init -y` instead\nof opening the template picker. `bun update -i` with a non-TTY stdin now exits 1 -- use\n`bun update` or `bun outdated`.\n\n## Configuration (bunfig.toml)\n\nKey sections:\n\n```toml\n[run]\nbun = true                     # Always use Bun runtime (not Node)\n\n[install]\nexact = true                   # Pin exact versions by default\npeer = false                   # Don't auto-install peer deps\nproduction = false             # Include devDeps\nfrozenLockfile = false         # Don't fail on lockfile mismatch\nglobalDir = \"~\u002F.bun\u002Finstall\u002Fglobal\"  # Global install location\nlinker = \"isolated\"            # \"isolated\" or \"hoisted\" -- see gotchas\nglobalStore = true             # Share package files across projects (requires isolated)\noffline = false                # true: never touch the network, every package must be cached (v1.4.1+)\nprefer = \"online\"              # \"offline\": cached metadata regardless of age (v1.4.1+); \"latest\": always check\n\n[install.scopes]\n\"@myorg\" = { token = \"$NPM_TOKEN\", url = \"https:\u002F\u002Fnpm.pkg.github.com\u002F\" }\n\n[test]\ncoverage = false               # Enable coverage by default\ncoverageReporter = [\"text\", \"lcov\"]\ntimeout = 5000                 # Default test timeout\npathIgnorePatterns = [\"**\u002Fe2e\u002F**\"]   # Exclude test files by glob\n\n[bundle]\nentryPoints = [\".\u002Fsrc\u002Findex.ts\"]\noutdir = \".\u002Fdist\"\n```\n\n> **Reference**: See `references\u002Fconfiguration.md` for complete bunfig.toml reference.\n\n## Debugging and Profiling\n\n```bash\nbun --inspect file.ts              # Start debugger (WebSocket, connect via Chrome DevTools)\nbun --inspect-wait file.ts         # Wait for debugger to attach before executing\nbun --inspect-brk file.ts         # Break on first line\nbun --cpu-prof file.ts             # Generate CPU profile\nbun --cpu-prof-md file.ts          # CPU profile as Markdown (v1.3.7+)\nbun --heap-prof file.ts            # Generate heap profile\nbun --heap-prof-md file.ts         # Heap profile as Markdown (v1.3.7+)\nBUN_JSC_logJITCodeForPerf=1 bun file.ts  # Linux perf integration\n```\n\n## Environment Variables\n\n```bash\nbun --env-file .env file.ts        # Load .env file\nbun --env-file .env.local --env-file .env file.ts  # Load multiple (left takes precedence)\n```\n\nBun auto-loads `.env`, `.env.production`, `.env.local`, `.env.production.local` by default based on `NODE_ENV`.\n\n## Built-in Features That Replace External Tools\n\nBun has many capabilities built in that eliminate the need for external packages or tooling:\n\n### Native TypeScript\nBun runs `.ts`, `.tsx` files directly — no `tsc`, `ts-node`, or `tsx` needed. The transpiler is built into the runtime. Use `bun file.ts` to run any TypeScript file immediately.\n\n### Built-in Type Checker\n`bun check` (v1.4.3+) replaces `tsc --noEmit`, and `--check` gates `bun \u003Cfile>`, `bun test`, and `bun build` on a clean type check — no `typescript` package needed. Keep `tsc` only to emit `.d.ts` files.\n\n### Workspace Catalogs\nBun supports `catalog:` protocol in `package.json` for centralized dependency version management across monorepo workspaces — no need for tools like `syncpack` or `manypkg`:\n\n```json\n\u002F\u002F Root package.json\n{\n  \"workspaces\": [\"packages\u002F*\"],\n  \"catalog\": {\n    \"react\": \"^19.0.0\",\n    \"typescript\": \"^5.7.0\"\n  }\n}\n\n\u002F\u002F packages\u002Fapp\u002Fpackage.json\n{\n  \"dependencies\": {\n    \"react\": \"catalog:\"\n  }\n}\n```\n\n### Built-in Test Runner\n`bun test` is a full Jest-compatible test runner with snapshot testing, mocking, coverage — no need for `jest`, `vitest`, or `mocha`.\n\n### Built-in Bundler\n`bun build` replaces `esbuild`, `webpack`, `rollup` for many use cases. Supports code splitting, tree shaking, minification, and standalone executable compilation.\n\n### Built-in SQLite\n`import { Database } from 'bun:sqlite'` — zero-dependency SQLite3 with prepared statements and transactions. No need for `better-sqlite3` or `sql.js`.\n\n### Built-in Shell\n`Bun.$` tagged template — cross-platform shell execution with automatic escaping. Replaces `execa`, `shelljs`, `zx`.\n\n### Built-in File I\u002FO\n`Bun.file()` and `Bun.write()` — fast file operations without importing `fs`. Auto-detects MIME types.\n\n### Built-in Glob\n`new Bun.Glob(pattern)` — fast glob matching and file scanning. Replaces `glob`, `fast-glob`, `minimatch`.\n\n### Built-in Password Hashing\n`Bun.password.hash()` and `.verify()` with bcrypt and argon2id. Replaces `bcrypt`, `argon2` packages.\n\n### Built-in Compression\n`Bun.gzipSync()`, `Bun.deflateSync()`, `Bun.zstdCompressSync()` — no need for `zlib` wrapper packages.\n\n### Built-in Semver\n`Bun.semver.satisfies()`, `.order()` — replaces `semver` package.\n\n### Built-in Runtime APIs\nFor Bun's built-in runtime helpers (`Bun.s3`, `Bun.redis`, `Bun.Archive`, `JSONC`, `JSON5`, `JSONL`, `markdown`, `cron`), see the `bun-api` skill.\n\n### Zero-Config Frontend Dev Server\n`bun .\u002Findex.html` — serve HTML with auto-bundling of JS\u002FTS\u002FCSS, HMR, and React Fast Refresh. Replaces Vite\u002FWebpack dev server for simple projects.\n\n### ES Decorators\nTC39 standard ES decorators supported natively (v1.3.10+) — no `experimentalDecorators` tsconfig needed.\n\n## Key Gotchas\n\n1. **Always use `bun` not `npm`\u002F`node`\u002F`npx`** in Bun projects\n2. **Lockfile format**: `bun.lock` (text, v1.2+) is the default for new projects. Legacy `bun.lockb` is binary. Don't mix with `package-lock.json`. **v1.4+** writes `lockfileVersion: 2` (and `3` when nested or version-scoped overrides are used). **Bun 1.3 cannot read version 3** -- check before committing one to a repo whose CI pins an older Bun\n3. **trustedDependencies**: Lifecycle scripts (postinstall, etc.) only run for packages listed in `trustedDependencies` in package.json. **v1.3.5+** the default trusted list applies only to packages from the npm registry, so a `file:`\u002F`link:`\u002F`git:`\u002F`github:` dependency named `esbuild` gets no trust from the real esbuild's entry -- list it yourself. **v1.4+** entries match the exact package name rather than a truncated hash\n4. **`--bun` flag**: Some tools (e.g., Next.js) use Node.js by default even when run with `bun run`. Use `--bun` or `[run] bun = true` in `bunfig.toml` to force Bun runtime\n5. **Workspace protocol**: Use `\"workspace:*\"` in package.json to reference workspace packages\n6. **Global binaries**: Installed with `bun add -g`, located in `~\u002F.bun\u002Fbin\u002F`\n7. **Node.js compatibility**: Bun implements most Node.js APIs but some edge cases differ. Check https:\u002F\u002Fbun.sh\u002Fdocs\u002Fruntime\u002Fnodejs-apis for compatibility\n8. **TypeScript**: Bun runs TypeScript natively with no compilation step. Uses its own transpiler (not tsc), and running never type checks -- use `bun check` or `--check` (v1.4.3+)\n9. **Auto-install**: Bun can auto-install missing packages on import (disabled by default, enable with `[install] auto = true` in bunfig.toml)\n10. **`bun run` vs `bun`**: `bun run script` runs a package.json script; `bun file.ts` runs a file directly. `bun script` tries script first, then falls back to file\n11. **`--filter` is not a name filter for tests.** In `bun test` it filters **file paths**, same as a positional argument (`-F` is rejected; workspace selection is `bun run --filter '*' test`). `bun test -t \u003Cregex>` (or `--grep`) filters test names. Getting this wrong matches nothing and exits 1 -- unless `--pass-with-no-tests` is set, which turns it into a green run that tested nothing\n12. **Coverage reporters are `text` and `lcov` only** -- `--coverage-reporter=json` is rejected. As of v1.4.3 the flag implies `--coverage`\n13. **`bunfig.toml` is strict TOML as of v1.4.** Unquoted values, missing newlines between pairs, and integers past `Number.MAX_SAFE_INTEGER` now fail at startup with a `SyntaxError`. `linker = isolated` must be `linker = \"isolated\"`\n14. **Bun invoked as `node` no longer loads `.env` (v1.4+).** Under `bun --bun`, `bunx --bun`, or a `node` symlink, a script calling `node` sees those variables as `undefined`. Pass `--env-file`, matching Node's behavior\n15. **The isolated linker is not on by default for existing projects** -- it is chosen by the lockfile's `configVersion`, not the Bun version. See \"Install Layout\" above\n16. **x64 builds are baseline-only (v1.4+).** The `-march=haswell` build is gone; the `-baseline` download URLs and npm packages still exist and contain the same binary, and the `CPU lacks AVX support` warning is removed\n17. **`bun feedback` was removed in 1.4**\n18. **Bundled namespace objects will become getter-only.** `import * as ns` \u002F `export * as ns` from `bun build` currently accept `ns.x = 1` silently; `--no-deprecated-namespace-object-setters` (or `deprecatedNamespaceObjectSetters: false`) opts into the future default now (v1.4.1+)\n19. **`bun run --filter`, `--workspaces`, `--parallel`, and `--sequential` ignored an auto-discovered `bunfig.toml`** before 1.4.1 unless `--config` was passed; `bun run` also reused a stale transpile cache for files of 4 KiB or more after `[define]` or `--drop` changed\n20. **Bun 1.4.1's `bun build` could rename a nested `var` onto a `let` in the same block**, so bundles importing Elysia failed to load with `SyntaxError: Cannot declare a var variable that shadows a let\u002Fconst\u002Fclass variable`, and a `let` could take a parameter's or `catch` binding's name and compute wrong values. Fixed in 1.4.2 -- upgrade rather than patch the output, and do not pin 1.4.1 for bundling\n21. **A `check` script shadows `bun check` (v1.4.3+).** When `package.json` defines `check`, `bun check` runs it -- from other scripts too, except those the `check` script itself starts -- so `bun init`'s `\"typecheck\": \"bun check\"` then runs the lint script. `bun --check` type checks regardless: use it in scripts. On an older Bun, `\"check\": \"bun check\"` calls itself forever\n22. **`@types\u002Fbun` lags every Bun release**, often by a day or more, so `bun check` rejects the newest APIs (`TS2339`, `TS2353`). Depend on `bun-types@\u003Cruntime-version>` with `\"types\": [\"bun-types\"]` instead; installing `bun-types` beside `@types\u002Fbun` does not change what gets type checked\n23. **Installs no longer cache what they skip (v1.4.3+).** A `--production` or `--omit` install without a lockfile downloads no tarballs for the dropped groups, so it cannot warm a cache for a later full `--offline` install. Warm it with an install that places the same packages, on the same platform\n24. **`--disallow-code-generation-from-strings` is enforced as of 1.4.3** -- Bun accepted and ignored it before. `eval()` and `new Function()` now throw `EvalError` process-wide, Workers included; `=strict` also blocks `node:vm`, `data:`\u002F`blob:` imports, and plugins that return source text, and refuses `--inspect`\n\n## References\n\n> - `references\u002Fmigration-1.4.md` -- what changed from 1.3 through 1.4.3 for the CLI, package manager, bundler, and test runner\n> - `references\u002Fpackage-management.md` -- install\u002Fadd\u002Fupdate\u002Faudit\u002Fpm flags, workspaces, linkers\n> - `references\u002Frunning-and-execution.md` -- runtime flags, bunx, profiling, watch\u002Fhot, code-generation lockdown\n> - `references\u002Ftype-checking.md` -- `bun check`, `--check`, output formats, TypeScript 7 defaults, monorepos, CI\n> - `references\u002Ftesting.md` -- test runner API, mocking, coverage, CI shaping\n> - `references\u002Fbundling-and-compilation.md` -- `bun build`, targets, standalone executables\n> - `references\u002Fconfiguration.md` -- full `bunfig.toml` reference\n> - `references\u002Fallowlist.md` -- copy-paste `Bash(command:*)` permission patterns\n",{"name":5,"description":7},"master","bfa2c1cff678afb35dca75f52f5d4c683e544c79",".otherskill\u002Fbank\u002Fbackend\u002Fbun-cli--396a407bee6a948e",0,"https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill","https:\u002F\u002Fgithub.com\u002Fdatamonsterr","Product Engineer","2026-11-08 16:15:51",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add datamonsterr\u002Fother-skill --skill bun-cli",{"tool":39,"command":40},"bunx","bunx skills add datamonsterr\u002Fother-skill --skill bun-cli",{"tool":42,"command":43},"pnpm","pnpm dlx skills add datamonsterr\u002Fother-skill --skill bun-cli","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fbackend\u002Fbun-cli--396a407bee6a948e\u002FSKILL.md",true,[47,53,57,61,65,69,73,77,81,85],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},".otherskill.json","REFERENCE","参考文档",327,"https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fbackend\u002Fbun-cli--396a407bee6a948e\u002F.otherskill.json",{"path":54,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":16},"LICENSE","许可证",1036,{"path":58,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":59,"sourceHtmlUrl":60},"references\u002Fallowlist.md",3805,"https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fbackend\u002Fbun-cli--396a407bee6a948e\u002Freferences\u002Fallowlist.md",{"path":62,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":63,"sourceHtmlUrl":64},"references\u002Fbundling-and-compilation.md",18161,"https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fbackend\u002Fbun-cli--396a407bee6a948e\u002Freferences\u002Fbundling-and-compilation.md",{"path":66,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Fconfiguration.md",6668,"https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fbackend\u002Fbun-cli--396a407bee6a948e\u002Freferences\u002Fconfiguration.md",{"path":70,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":71,"sourceHtmlUrl":72},"references\u002Fmigration-1.4.md",22858,"https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fbackend\u002Fbun-cli--396a407bee6a948e\u002Freferences\u002Fmigration-1.4.md",{"path":74,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":75,"sourceHtmlUrl":76},"references\u002Fpackage-management.md",21147,"https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fbackend\u002Fbun-cli--396a407bee6a948e\u002Freferences\u002Fpackage-management.md",{"path":78,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002Frunning-and-execution.md",12318,"https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fbackend\u002Fbun-cli--396a407bee6a948e\u002Freferences\u002Frunning-and-execution.md",{"path":82,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Ftesting.md",16323,"https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fbackend\u002Fbun-cli--396a407bee6a948e\u002Freferences\u002Ftesting.md",{"path":86,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Ftype-checking.md",9751,"https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fbackend\u002Fbun-cli--396a407bee6a948e\u002Freferences\u002Ftype-checking.md",[90,99,107,115,123],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":94,"licenseFileUrl":95,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":20},"01M7D3VENJ4DW6A6SENKCE0SPS","skill-creator","Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fmanagement\u002Fskill-creator--8a7784776c1d7d1d\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fmanagement\u002Fskill-creator--8a7784776c1d7d1d\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":94,"licenseFileUrl":103,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":20},"01M7D3V6XQ5Q4P4A66KGA1TGFK","hook-development","This skill should be used when the user asks to \"create a hook\", \"add a PreToolUse\u002FPostToolUse\u002FStop hook\", \"validate tool use\", \"implement prompt-based hooks\", \"use ${CLAUDE_PLUGIN_ROOT}\", \"set up event-driven automation\", \"block dangerous commands\", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.","https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fmanagement\u002Fhook-development--a82eb25c70ecda8d\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fmanagement\u002Fhook-development--a82eb25c70ecda8d\u002FSKILL.md",[],[],{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":111,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":20},"01M7D3V0Q3KJ4768NKZ1BESB5W","crafting-effective-readmes","Use when writing or improving README files. Not all READMEs are the same — provides templates and guidance matched to your audience and project type.","https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fdocs\u002Fcrafting-effective-readmes--d7c2c8d55c003c98\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fdocs\u002Fcrafting-effective-readmes--d7c2c8d55c003c98\u002FSKILL.md",[],[],{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":119,"sourceHtmlUrl":120,"categories":121,"keywords":122,"publishedAt":20},"01M7D3TV7ZRNA40REYM63V92MZ","openrouter","Choose OpenRouter models and routers, query live catalog data, use structured outputs and batch inference, and debug routing with metadata. Use when working with OpenRouter APIs, openrouter\u002Fauto, openrouter\u002Ffree, model discovery, pricing, providers, batch jobs, or structured JSON responses.","https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fbackend\u002Fopenrouter--a3545e0ad9571eb6\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fbackend\u002Fopenrouter--a3545e0ad9571eb6\u002FSKILL.md",[],[],{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":127,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":20},"01M7D3T2CWCM6PFVFG971JAQJ7","bun-api","Bun runtime API reference for TypeScript scripts. Covers Bun.serve() HTTP\u002FHTTP\u002F2 server with routes and WebSockets, fetch() transport options, proxies and Bun.FetchSession connection pools, Bun.ModuleGraph multi-instance apps, Bun.file(), Bun.write(), Bun.$() shell, Bun.spawn(), Bun.Glob, Bun.env, bun:sqlite, Bun.sql() for PostgreSQL\u002FMySQL via DATABASE_URL, Bun.s3 for S3-compatible storage, Bun.redis for Redis\u002FValkey, Bun.Archive for tarballs, Bun.Image image processing, Bun.WebView headless browser automation, Bun.cron scheduling, Bun.secrets OS credential storage, Bun.Terminal PTYs, JSONC\u002FJSON5\u002FJSONL\u002FXML\u002FTOML\u002FYAML\u002Fmarkdown parsers, Bun.hash, Bun.password, compression, and scripting utilities. Use when writing scripts, automating tasks, querying databases, working with S3 storage, Redis caching, processing images, automating a headless browser, parsing markdown\u002FJSON variants, or doing file processing in a Bun project. Signals: bun.lock, bunfig.toml, DATABASE_URL, REDIS_URL, AWS_ACCESS_KEY_ID, Bun.$ usage Not for bun CLI commands (bun-cli skill), non-Bun runtimes, or ORM CLI tooling","https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fbackend\u002Fbun-api--2ed05c7ba5dd764f\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fdatamonsterr\u002Fother-skill\u002Fblob\u002Fmaster\u002F.otherskill\u002Fbank\u002Fbackend\u002Fbun-api--2ed05c7ba5dd764f\u002FSKILL.md",[],[]]