OS Manuals

/usr/bin/bun

Bun requires itself to bootstrap.

From bun-bootstrap 1.4.4-r0 (os), captured 2026-11-10 by running bun --help (exit 0). permalink

Bun is a fast JavaScript runtime, package manager, bundler, and test runner. (1.4.4+38afee6c8)

Usage: bun <command> [...flags] [...args]

Commands:
  run       ./my-script.ts       Execute a file with Bun
            dev                  Run a package.json script
  test                           Run unit tests with Bun
  check                          Type check a TypeScript project
  fmt                            Format JavaScript and TypeScript, like Prettier
  x         vite                 Execute a package binary (CLI), installing if needed (bunx)
  repl                           Start a REPL session with Bun
  exec                           Run a shell script directly with Bun

  install                        Install dependencies for a package.json (bun i)
  add       @evan/duckdb         Add a dependency to package.json (bun a)
  remove    browserify           Remove a dependency from package.json (bun rm)
  update    @zarfjs/zarf         Update outdated dependencies
  audit                          Check installed packages for vulnerabilities
  dedupe                         Remove duplicate versions from the lockfile
  prune                          Remove packages that are not in the lockfile from node_modules
  outdated                       Display latest versions of outdated dependencies
  link      [<package>]          Register or link a local npm package
  unlink                         Unregister a local npm package
  publish                        Publish a package to the npm registry
  patch <pkg>                    Prepare a package for patching
  pm <subcommand>                Additional package management utilities
  info      zod                  Display package metadata from the registry
  why       tailwindcss          Explain why a package is installed

  build     ./a.ts ./b.jsx       Bundle TypeScript & JavaScript into a single file

  init                           Start an empty Bun project from a built-in template
  create    astro                Create a new project from a template (bun c)
  upgrade                        Upgrade to latest version of Bun.

  <command> --help               Print help text for command.

Flags:
      --silent                        Don't print the script command
      --elide-lines=<val>             Number of lines of script output shown when using --filter (default: 0, show all lines)
  -v, --version                       Print version and exit
      --revision                      Print version with revision and exit
  -F, --filter=<val>                  Run a script in all workspace packages matching the pattern
  -b, --bun                           Force a script or package to use Bun's runtime instead of Node.js (via symlinking node)
      --no-orphans                    Exit when the parent process dies, and on exit kill every descendant.
      --shell=<val>                   Control the shell used for package.json scripts. Supports either 'bun' or 'system'
      --workspaces                    Run a script in all workspace packages (from the "workspaces" field in package.json)
      --parallel                      Run multiple scripts concurrently with Foreman-style output
      --sequential                    Run multiple scripts sequentially with Foreman-style output
      --no-exit-on-error              Continue running other scripts when one fails (with --parallel/--sequential)
      --watch                         Automatically restart the process on file change
      --watch-kill-signal=<val>       Signal whose handlers run when --watch restarts the process (default: "SIGTERM")
      --hot                           Enable auto reload in the Bun runtime, test runner, or bundler
      --no-clear-screen               Disable clearing the terminal screen on reload when --hot or --watch is enabled
      --check                         Type check before running. Nothing runs if there are type errors. Alone: bun check
      --smol                          Use less memory, but run garbage collection more often
      --interactive                   Start a Node.js-compatible REPL, like node --interactive
  -r, --preload=<val>                 Import a module before other modules are loaded
      --require=<val>                 Alias of --preload, for Node.js compatibility
      --import=<val>                  Alias of --preload, for Node.js compatibility
      --inspect=<val>                 Activate Bun's debugger
      --inspect-wait=<val>            Activate Bun's debugger, wait for a connection before executing
      --inspect-brk=<val>             Activate Bun's debugger, set breakpoint on first line of code and wait
      --cpu-prof                      Start CPU profiler and write profile to disk on exit
      --cpu-prof-name=<val>           Specify the name of the CPU profile file
      --cpu-prof-dir=<val>            Specify the directory where the CPU profile will be saved
      --cpu-prof-md                   Output CPU profile in markdown format (grep-friendly, designed for LLM analysis)
      --cpu-prof-interval=<val>       Specify the sampling interval in microseconds for CPU profiling (default: 1000)
      --heap-prof                     Write a heap profile to disk on exit (.heapprofile)
      --heap-prof-name=<val>          Specify the name of the heap profile file
      --heap-prof-dir=<val>           Specify the directory where the heap profile will be saved
      --heap-prof-md                  Generate markdown heap profile on exit (for CLI analysis)
      --heap-prof-interval=<val>      Specify the average sampling interval in bytes for heap profiling (default: 524288)
      --if-present                    Exit without an error if the entrypoint does not exist
      --no-install                    Disable auto install in the Bun runtime
      --install=<val>                 Configure auto-install behavior. One of "auto" (default, auto-installs when no node_modules), "fallback" (missing packages only), "force" (always).
  -i                                  Auto-install dependencies during execution. Equivalent to --install=fallback.
  -e, --eval=<val>                    Evaluate argument as a script
  -p, --print=<val>                   Evaluate argument as a script and print the result
      --prefer-offline                Skip staleness checks for packages in the Bun runtime and resolve from disk
      --prefer-latest                 Use the latest matching versions of packages in the Bun runtime, always checking npm
      --port=<val>                    Set the default port for Bun.serve
      --conditions=<val>              Pass custom conditions to resolve
      --fetch-preconnect=<val>        Preconnect to a URL while code is loading
      --experimental-http2-fetch      Offer h2 in fetch() TLS ALPN. Same as BUN_FEATURE_FLAG_EXPERIMENTAL_HTTP2_CLIENT=1
      --experimental-http3-fetch      Honor Alt-Svc: h3 in fetch() and upgrade to HTTP/3. Same as BUN_FEATURE_FLAG_EXPERIMENTAL_HTTP3_CLIENT=1
      --max-http-header-size=<val>    Set the maximum size of HTTP headers in bytes. Default is 16KiB
      --insecure-http-parser          Use an insecure HTTP parser that accepts invalid HTTP headers
      --dns-result-order=<val>        Set the default order of DNS lookup results. Valid orders: verbatim (default), ipv4first, ipv6first
      --experimental-stream-iter      Enable the experimental stream/iter API (node:stream/iter, node:zlib/iter).
      --expose-gc                     Expose gc() on the global object. Has no effect on Bun.gc().
      --no-deprecation                Suppress all reporting of the custom deprecation.
      --throw-deprecation             Determine whether or not deprecation warnings result in errors.
      --no-warnings                   Silence all process warnings
      --trace-warnings                Show stack traces on process warnings
      --trace-deprecation             Show stack traces on deprecations
      --pending-deprecation           Emit pending deprecation warnings
      --redirect-warnings=<val>       Write process warnings to the given file instead of printing to stderr
      --disable-warning=<val>         Silence specific process warnings by code or type
      --title=<val>                   Set the process title
      --zero-fill-buffers             Boolean to force Buffer.allocUnsafe(size) to be zero-filled.
      --use-system-ca                 Use the system's trusted certificate authorities
      --use-openssl-ca                Use OpenSSL's default CA store
      --use-bundled-ca                Use bundled CA store
      --tls-min-v1.0                  Set the default TLS minimum to TLSv1.0
      --tls-min-v1.1                  Set the default TLS minimum to TLSv1.1
      --tls-min-v1.2                  Set the default TLS minimum to TLSv1.2
      --tls-min-v1.3                  Set the default TLS minimum to TLSv1.3
      --tls-max-v1.2                  Set the default TLS maximum to TLSv1.2
      --tls-max-v1.3                  Set the default TLS maximum to TLSv1.3
      --redis-preconnect              Preconnect to $REDIS_URL at startup
      --sql-preconnect                Preconnect to PostgreSQL at startup
      --no-addons                     Throw an error if process.dlopen or bun:ffi cc() is called, and disable export condition "node-addons"
      --no-ffi-cc                     Throw an error if bun:ffi cc() is called (disables the C compiler)
      --unhandled-rejections=<val>    One of "strict", "throw", "warn", "none", or "warn-with-error-code"
      --console-depth=<val>           Set the default depth for console.log object inspection (default: 2)
      --user-agent=<val>              Set the default User-Agent header for HTTP requests
      --cron-title=<val>              Title for cron execution mode
      --cron-period=<val>             Cron period for cron execution mode
      --main-fields=<val>             Main fields to lookup in package.json. Defaults to --target dependent
      --preserve-symlinks             Preserve symlinks when resolving files
      --preserve-symlinks-main        Preserve symlinks when resolving the main entry point
      --extension-order=<val>         Defaults to: .tsx,.ts,.jsx,.js,.json
      --tsconfig-override=<val>       Specify custom tsconfig.json. Default $cwd/tsconfig.json
  -d, --define=<val>                  Substitute K:V while parsing, e.g. --define process.env.NODE_ENV:"development". Values are parsed as JSON.
      --drop=<val>                    Remove function calls, e.g. --drop=console removes all console.* calls.
      --feature=<val>                 Enable a feature flag for dead-code elimination, e.g. --feature=SUPER_SECRET
  -l, --loader=<val>                  Parse files with .ext:loader, e.g. --loader .js:jsx. Valid loaders: js, jsx, ts, tsx, json, toml, text, file, wasm, napi
      --no-macros                     Disable macros from being executed in the bundler, transpiler and runtime
      --jsx-factory=<val>             Changes the function called when compiling JSX elements using the classic JSX runtime
      --jsx-fragment=<val>            Changes the function called when compiling JSX fragments
      --jsx-import-source=<val>       Declares the module specifier to be used for importing the jsx and jsxs factory functions. Default: "react"
      --jsx-runtime=<val>             "automatic" (default) or "classic"
      --jsx-side-effects              Treat JSX elements as having side effects (disable pure annotations)
      --ignore-dce-annotations        Ignore tree-shaking annotations such as @__PURE__
      --env-file=<val>                Load environment variables from the specified file(s)
      --no-env-file                   Disable automatic loading of .env files
      --cwd=<val>                     Absolute path to resolve files & entry points from. This just changes the process' cwd.
  -c, --config=<val>                  Specify path to Bun config file. Default $cwd/bunfig.toml
  -h, --help                          Display this menu and exit

(more flags in bun install --help, bun test --help, and bun build --help)

Learn more about Bun:            https://bun.com/docs
Join our Discord community:      https://bun.com/discord
Options (102)
OptionDescriptionSource
--silentDon't print the script commandhelp
--elide-lines valNumber of lines of script output shown when using --filter (default: 0, show all lines)help
-v, --versionPrint version and exithelp
--revisionPrint version with revision and exithelp
-F, --filter valRun a script in all workspace packages matching the patternhelp
-b, --bunForce a script or package to use Bun's runtime instead of Node.js (via symlinking node)help
--no-orphansExit when the parent process dies, and on exit kill every descendant.help
--shell valControl the shell used for package.json scripts.help
--workspacesRun a script in all workspace packages (from the "workspaces" field in package.json)help
--parallelRun multiple scripts concurrently with Foreman-style outputhelp
--sequentialRun multiple scripts sequentially with Foreman-style outputhelp
--no-exit-on-errorContinue running other scripts when one fails (with --parallel/--sequential)help
--watchAutomatically restart the process on file changehelp
--watch-kill-signal valSignal whose handlers run when --watch restarts the process (default: "SIGTERM")help
--hotEnable auto reload in the Bun runtime, test runner, or bundlerhelp
--no-clear-screenDisable clearing the terminal screen on reload when --hot or --watch is enabledhelp
--checkType check before running.help
--smolUse less memory, but run garbage collection more oftenhelp
--interactiveStart a Node.js-compatible REPL, like node --interactivehelp
-r, --preload valImport a module before other modules are loadedhelp
--require valAlias of --preload, for Node.js compatibilityhelp
--import valAlias of --preload, for Node.js compatibilityhelp
--inspect valActivate Bun's debuggerhelp
--inspect-wait valActivate Bun's debugger, wait for a connection before executinghelp
--inspect-brk valActivate Bun's debugger, set breakpoint on first line of code and waithelp
--cpu-profStart CPU profiler and write profile to disk on exithelp
--cpu-prof-name valSpecify the name of the CPU profile filehelp
--cpu-prof-dir valSpecify the directory where the CPU profile will be savedhelp
--cpu-prof-mdOutput CPU profile in markdown format (grep-friendly, designed for LLM analysis)help
--cpu-prof-interval valSpecify the sampling interval in microseconds for CPU profiling (default: 1000)help
--heap-profWrite a heap profile to disk on exit (.heapprofile)help
--heap-prof-name valSpecify the name of the heap profile filehelp
--heap-prof-dir valSpecify the directory where the heap profile will be savedhelp
--heap-prof-mdGenerate markdown heap profile on exit (for CLI analysis)help
--heap-prof-interval valSpecify the average sampling interval in bytes for heap profiling (default: 524288)help
--if-presentExit without an error if the entrypoint does not existhelp
--no-installDisable auto install in the Bun runtimehelp
--install valConfigure auto-install behavior.help
-iAuto-install dependencies during execution.help
-e, --eval valEvaluate argument as a scripthelp
-p, --print valEvaluate argument as a script and print the resulthelp
--prefer-offlineSkip staleness checks for packages in the Bun runtime and resolve from diskhelp
--prefer-latestUse the latest matching versions of packages in the Bun runtime, always checking npmhelp
--port valSet the default port for Bun.servehelp
--conditions valPass custom conditions to resolvehelp
--fetch-preconnect valPreconnect to a URL while code is loadinghelp
--experimental-http2-fetchOffer h2 in fetch() TLS ALPN.help
--experimental-http3-fetchHonor Alt-Svc: h3 in fetch() and upgrade to HTTP/3.help
--max-http-header-size valSet the maximum size of HTTP headers in bytes.help
--insecure-http-parserUse an insecure HTTP parser that accepts invalid HTTP headershelp
--dns-result-order valSet the default order of DNS lookup results.help
--experimental-stream-iterEnable the experimental stream/iter API (node:stream/iter, node:zlib/iter).help
--expose-gcExpose gc() on the global object.help
--no-deprecationSuppress all reporting of the custom deprecation.help
--throw-deprecationDetermine whether or not deprecation warnings result in errors.help
--no-warningsSilence all process warningshelp
--trace-warningsShow stack traces on process warningshelp
--trace-deprecationShow stack traces on deprecationshelp
--pending-deprecationEmit pending deprecation warningshelp
--redirect-warnings valWrite process warnings to the given file instead of printing to stderrhelp
--disable-warning valSilence specific process warnings by code or typehelp
--title valSet the process titlehelp
--zero-fill-buffersBoolean to force Buffer.allocUnsafe(size) to be zero-filled.help
--use-system-caUse the system's trusted certificate authoritieshelp
--use-openssl-caUse OpenSSL's default CA storehelp
--use-bundled-caUse bundled CA storehelp
--tls-min-v1.0Set the default TLS minimum to TLSv1.0help
--tls-min-v1.1Set the default TLS minimum to TLSv1.1help
--tls-min-v1.2Set the default TLS minimum to TLSv1.2help
--tls-min-v1.3Set the default TLS minimum to TLSv1.3help
--tls-max-v1.2Set the default TLS maximum to TLSv1.2help
--tls-max-v1.3Set the default TLS maximum to TLSv1.3help
--redis-preconnectPreconnect to $REDIS_URL at startuphelp
--sql-preconnectPreconnect to PostgreSQL at startuphelp
--no-addonsThrow an error if process.dlopen or bun:ffi cc() is called, and disable export condition "node-addons"help
--no-ffi-ccThrow an error if bun:ffi cc() is called (disables the C compiler)help
--unhandled-rejections valOne of "strict", "throw", "warn", "none", or "warn-with-error-code"help
--console-depth valSet the default depth for console.log object inspection (default: 2)help
--user-agent valSet the default User-Agent header for HTTP requestshelp
--cron-title valTitle for cron execution modehelp
--cron-period valCron period for cron execution modehelp
--main-fields valMain fields to lookup in package.json.help
--preserve-symlinksPreserve symlinks when resolving fileshelp
--preserve-symlinks-mainPreserve symlinks when resolving the main entry pointhelp
--extension-order valDefaults to: .tsx,.ts,.jsx,.js,.jsonhelp
--tsconfig-override valSpecify custom tsconfig.json.help
-d, --define valSubstitute K:V while parsing, e.g. --define process.env.NODE_ENV:"development".help
--drop valRemove function calls, e.g. --drop=console removes all console.* calls.help
--feature valEnable a feature flag for dead-code elimination, e.g. --feature=SUPER_SECREThelp
-l, --loader valParse files with .ext:loader, e.g. --loader .js:jsx.help
--no-macrosDisable macros from being executed in the bundler, transpiler and runtimehelp
--jsx-factory valChanges the function called when compiling JSX elements using the classic JSX runtimehelp
--jsx-fragment valChanges the function called when compiling JSX fragmentshelp
--jsx-import-source valDeclares the module specifier to be used for importing the jsx and jsxs factory functions.help
--jsx-runtime val"automatic" (default) or "classic"help
--jsx-side-effectsTreat JSX elements as having side effects (disable pure annotations)help
--ignore-dce-annotationsIgnore tree-shaking annotations such as @__PURE__help
--env-file valLoad environment variables from the specified file(s)help
--no-env-fileDisable automatic loading of .env fileshelp
--cwd valAbsolute path to resolve files & entry points from.help
-c, --config valSpecify path to Bun config file.help
-h, --helpDisplay this menu and exithelp

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.