Skip to content

bun

bun documentation

footman._stubs.bun.Bun

Bases: Tool

__call__

__call__(
    *args: str,
    bun: _Flag = ...,
    conditions: _Value = ...,
    config: _Value = ...,
    console_depth: _Value = ...,
    cpu_prof: _Flag = ...,
    cpu_prof_dir: _Value = ...,
    cpu_prof_interval: _Value = ...,
    cpu_prof_md: _Flag = ...,
    cpu_prof_name: _Value = ...,
    cron_period: _Value = ...,
    cron_title: _Value = ...,
    cwd: _Value = ...,
    dns_result_order: _Value = ...,
    elide_lines: _Value = ...,
    env_file: _Value = ...,
    eval: _Value = ...,
    experimental_http2_fetch: _Flag = ...,
    experimental_http3_fetch: _Flag = ...,
    expose_gc: _Flag = ...,
    fetch_preconnect: _Value = ...,
    filter: _Value = ...,
    heap_prof: _Flag = ...,
    heap_prof_dir: _Value = ...,
    heap_prof_md: _Flag = ...,
    heap_prof_name: _Value = ...,
    hot: _Flag = ...,
    i: _Flag = ...,
    if_present: _Flag = ...,
    import_: _Value = ...,
    inspect: _Value = ...,
    inspect_brk: _Value = ...,
    inspect_wait: _Value = ...,
    install: _Value = ...,
    max_http_header_size: _Value = ...,
    no_addons: _Flag = ...,
    no_clear_screen: _Flag = ...,
    no_deprecation: _Flag = ...,
    no_env_file: _Flag = ...,
    no_exit_on_error: _Flag = ...,
    no_install: _Flag = ...,
    no_orphans: _Flag = ...,
    parallel: _Flag = ...,
    port: _Value = ...,
    prefer_latest: _Flag = ...,
    prefer_offline: _Flag = ...,
    preload: _Value = ...,
    print: _Value = ...,
    redis_preconnect: _Flag = ...,
    require: _Value = ...,
    revision: _Flag = ...,
    sequential: _Flag = ...,
    shell: _Value = ...,
    silent: _Flag = ...,
    smol: _Flag = ...,
    sql_preconnect: _Flag = ...,
    throw_deprecation: _Flag = ...,
    title: _Value = ...,
    unhandled_rejections: _Value = ...,
    use_bundled_ca: _Flag = ...,
    use_openssl_ca: _Flag = ...,
    use_system_ca: _Flag = ...,
    user_agent: _Value = ...,
    watch: _Flag = ...,
    workspaces: _Flag = ...,
    zero_fill_buffers: _Flag = ...,
    **flags: Any,
) -> Result

Bun is a fast JavaScript runtime, package manager, bundler, and test runner. (1.3.14+0d9b296af)

Parameters:

Name Type Description Default
bun _Flag

Force a script or package to use Bun's runtime instead of Node.js (via symlinking node).

...
conditions _Value

Pass custom conditions to resolve.

...
config _Value

Specify path to Bun config file.

...
console_depth _Value

Set the default depth for console.log object inspection. Defaults to 2.

...
cpu_prof _Flag

Start CPU profiler and write profile to disk on exit.

...
cpu_prof_dir _Value

Specify the directory where the CPU profile will be saved.

...
cpu_prof_interval _Value

Specify the sampling interval in microseconds for CPU profiling. Defaults to 1000.

...
cpu_prof_md _Flag

Output CPU profile in markdown format (grep-friendly, designed for LLM analysis).

...
cpu_prof_name _Value

Specify the name of the CPU profile file.

...
cron_period _Value

Cron period for cron execution mode.

...
cron_title _Value

Title for cron execution mode.

...
cwd _Value

Absolute path to resolve files & entry points from.

...
dns_result_order _Value

Set the default order of DNS lookup results.

...
elide_lines _Value

Number of lines of script output shown when using --filter . Defaults to 10.

...
env_file _Value

Load environment variables from the specified file(s).

...
eval _Value

Evaluate argument as a script.

...
experimental_http2_fetch _Flag

Offer h2 in fetch() TLS ALPN.

...
experimental_http3_fetch _Flag

Honor Alt-Svc: h3 in fetch() and upgrade to HTTP/3.

...
expose_gc _Flag

Expose gc() on the global object.

...
fetch_preconnect _Value

Preconnect to a URL while code is loading.

...
filter _Value

Run a script in all workspace packages matching the pattern.

...
heap_prof _Flag

Generate V8 heap snapshot on exit (.heapsnapshot).

...
heap_prof_dir _Value

Specify the directory where the heap profile will be saved.

...
heap_prof_md _Flag

Generate markdown heap profile on exit (for CLI analysis).

...
heap_prof_name _Value

Specify the name of the heap profile file.

...
hot _Flag

Enable auto reload in the Bun runtime, test runner, or bundler.

...
i _Flag

Auto-install dependencies during execution.

...
if_present _Flag

Exit without an error if the entrypoint does not exist.

...
import_ _Value

Alias of --preload, for Node.js compatibility.

...
inspect _Value

Activate Bun's debugger.

...
inspect_brk _Value

Activate Bun's debugger, set breakpoint on first line of code and wait.

...
inspect_wait _Value

Activate Bun's debugger, wait for a connection before executing.

...
install _Value

Configure auto-install behavior.

...
max_http_header_size _Value

Set the maximum size of HTTP headers in bytes.

...
no_addons _Flag

Throw an error if process.dlopen is called, and disable export condition "node-addons".

...
no_clear_screen _Flag

Disable clearing the terminal screen on reload when --hot or --watch is enabled.

...
no_deprecation _Flag

Suppress all reporting of the custom deprecation.

...
no_env_file _Flag

Disable automatic loading of .env files.

...
no_exit_on_error _Flag

Continue running other scripts when one fails (with --parallel/--sequential).

...
no_install _Flag

Disable auto install in the Bun runtime.

...
no_orphans _Flag

Exit when the parent process dies, and on exit SIGKILL every descendant.

...
parallel _Flag

Run multiple scripts concurrently with Foreman-style output.

...
port _Value

Set the default port for Bun.serve.

...
prefer_latest _Flag

Use the latest matching versions of packages in the Bun runtime, always checking npm.

...
prefer_offline _Flag

Skip staleness checks for packages in the Bun runtime and resolve from disk.

...
preload _Value

Import a module before other modules are loaded.

...
print _Value

Evaluate argument as a script and print the result.

...
redis_preconnect _Flag

Preconnect to $REDIS_URL at startup.

...
require _Value

Alias of --preload, for Node.js compatibility.

...
revision _Flag

Print version with revision and exit.

...
sequential _Flag

Run multiple scripts sequentially with Foreman-style output.

...
shell _Value

Control the shell used for package.json scripts.

...
silent _Flag

Don't print the script command.

...
smol _Flag

Use less memory, but run garbage collection more often.

...
sql_preconnect _Flag

Preconnect to PostgreSQL at startup.

...
throw_deprecation _Flag

Determine whether or not deprecation warnings result in errors.

...
title _Value

Set the process title.

...
unhandled_rejections _Value

One of "strict", "throw", "warn", "none", or "warn-with-error-code".

...
use_bundled_ca _Flag

Use bundled CA store.

...
use_openssl_ca _Flag

Use OpenSSL's default CA store.

...
use_system_ca _Flag

Use the system's trusted certificate authorities.

...
user_agent _Value

Set the default User-Agent header for HTTP requests.

...
watch _Flag

Automatically restart the process on file change.

...
workspaces _Flag

Run a script in all workspace packages (from the "workspaces" field in package.json).

...
zero_fill_buffers _Flag

Boolean to force Buffer.allocUnsafe(size) to be zero-filled.

...

add

add(
    *args: str,
    analyze: _Flag = ...,
    backend: _Value = ...,
    ca: _Value = ...,
    cache_dir: _Value = ...,
    cafile: _Value = ...,
    concurrent_scripts: _Value = ...,
    config: _Value = ...,
    cpu: _Value = ...,
    cwd: _Value = ...,
    dev: _Flag = ...,
    dry_run: _Flag = ...,
    exact: _Flag = ...,
    force: _Flag = ...,
    frozen_lockfile: _Flag = ...,
    global_: _Flag = ...,
    ignore_scripts: _Flag = ...,
    linker: _Value = ...,
    lockfile_only: _Flag = ...,
    minimum_release_age: _Value = ...,
    network_concurrency: _Value = ...,
    no_cache: _Flag = ...,
    no_progress: _Flag = ...,
    no_summary: _Flag = ...,
    no_verify: _Flag = ...,
    omit: _Value = ...,
    only_missing: _Flag = ...,
    optional: _Flag = ...,
    os: _Value = ...,
    peer: _Flag = ...,
    production: _Flag = ...,
    quiet: _Flag = ...,
    registry: _Value = ...,
    save: _Flag = ...,
    save_text_lockfile: _Flag = ...,
    silent: _Flag = ...,
    trust: _Flag = ...,
    verbose: _Flag = ...,
    yarn: _Flag = ...,
    **flags: Any,
) -> Result

Alias: bun a

Parameters:

Name Type Description Default
analyze _Flag

Recursively analyze & install dependencies of files passed as arguments (using Bun's bundler).

...
backend _Value

Platform-specific optimizations for installing dependencies.

...
ca _Value

Provide a Certificate Authority signing certificate.

...
cache_dir _Value

Store & load cached data from a specific directory path.

...
cafile _Value

The same as --ca, but is a file path to the certificate.

...
concurrent_scripts _Value

Maximum number of concurrent jobs for lifecycle scripts. Defaults to 2x CPU cores.

...
config _Value

Specify path to config file (bunfig.toml).

...
cpu _Value

Override CPU architecture for optional dependencies (e.g., x64, arm64, * for all).

...
cwd _Value

Set a specific cwd.

...
dev _Flag

Add dependency to "devDependencies".

...
dry_run _Flag

Perform a dry run without making changes.

...
exact _Flag

Add the exact version instead of the ^range.

...
force _Flag

Always request the latest versions from the registry & reinstall all dependencies.

...
frozen_lockfile _Flag

Disallow changes to lockfile.

...
global_ _Flag

Install globally.

...
ignore_scripts _Flag

Skip lifecycle scripts in the project's package.json (dependency scripts are never run).

...
linker _Value

Linker strategy (one of "isolated" or "hoisted").

...
lockfile_only _Flag

Generate a lockfile without installing dependencies.

...
minimum_release_age _Value

Only install packages published at least N seconds ago (security feature).

...
network_concurrency _Value

Maximum number of concurrent network requests. Defaults to 48.

...
no_cache _Flag

Ignore manifest cache entirely.

...
no_progress _Flag

Disable the progress bar.

...
no_summary _Flag

Don't print a summary.

...
no_verify _Flag

Skip verifying integrity of newly downloaded packages.

...
omit _Value

Exclude 'dev', 'optional', or 'peer' dependencies from install.

...
only_missing _Flag

Only add dependencies to package.json if they are not already present.

...
optional _Flag

Add dependency to "optionalDependencies".

...
os _Value

Override operating system for optional dependencies (e.g., linux, darwin, * for all).

...
peer _Flag

Add dependency to "peerDependencies".

...
production _Flag

Don't install devDependencies.

...
quiet _Flag

Only show tarball name when packing.

...
registry _Value

Use a specific registry by default, overriding .npmrc, bunfig.toml and environment variables.

...
save _Flag

Save to package.json (true by default). save=off emits --no-save.

...
save_text_lockfile _Flag

Save a text-based lockfile.

...
silent _Flag

Don't log anything.

...
trust _Flag

Add to trustedDependencies in the project's package.json and install the package(s).

...
verbose _Flag

Excessively verbose logging.

...
yarn _Flag

Write a yarn.lock file (yarn v1).

...

build

build(
    entrypoint: str,
    /,
    *args: str,
    allow_unresolved: _Value = ...,
    app: _Flag = ...,
    asset_naming: _Value = ...,
    banner: _Value = ...,
    bytecode: _Flag = ...,
    chunk_naming: _Value = ...,
    compile: _Flag = ...,
    compile_autoload_bunfig: _Flag = ...,
    compile_autoload_dotenv: _Flag = ...,
    compile_autoload_package_json: _Flag = ...,
    compile_autoload_tsconfig: _Flag = ...,
    compile_exec_argv: _Value = ...,
    compile_executable_path: _Value = ...,
    conditions: _Value = ...,
    css_chunking: _Flag = ...,
    emit_dce_annotations: _Flag = ...,
    entry_naming: _Value = ...,
    env: _Value = ...,
    external: _Value = ...,
    footer: _Value = ...,
    format: _Value = ...,
    keep_names: _Flag = ...,
    metafile: _Value = ...,
    metafile_md: _Value = ...,
    minify: _Flag = ...,
    minify_identifiers: _Flag = ...,
    minify_syntax: _Flag = ...,
    minify_whitespace: _Flag = ...,
    no_bundle: _Flag = ...,
    no_clear_screen: _Flag = ...,
    outdir: _Value = ...,
    outfile: _Value = ...,
    packages: _Value = ...,
    production: _Flag = ...,
    public_path: _Value = ...,
    react_fast_refresh: _Flag = ...,
    reject_unresolved: _Flag = ...,
    root: _Value = ...,
    server_components: _Flag = ...,
    sourcemap: _Value = ...,
    splitting: _Flag = ...,
    target: _Value = ...,
    watch: _Flag = ...,
    windows_copyright: _Value = ...,
    windows_description: _Value = ...,
    windows_hide_console: _Flag = ...,
    windows_icon: _Value = ...,
    windows_publisher: _Value = ...,
    windows_title: _Value = ...,
    windows_version: _Value = ...,
    **flags: Any,
) -> Result

Transpile and bundle one or more files.

Parameters:

Name Type Description Default
allow_unresolved _Value

Allow unresolved dynamic import()/require() specifiers matching these glob patterns.

...
app _Flag

(EXPERIMENTAL) Build a web app for production using Bun Bake.

...
asset_naming _Value

Customize asset filenames.

...
banner _Value

Add a banner to the bundled output such as "use client"; for a bundle being used with RSCs.

...
bytecode _Flag

Use a bytecode cache.

...
chunk_naming _Value

Customize chunk filenames.

...
compile _Flag

Generate a standalone Bun executable containing your bundled code.

...
compile_autoload_bunfig _Flag

Enable autoloading of bunfig.toml in standalone executable. Defaults on — compile_autoload_bunfig=off emits --no-compile-autoload-bunfig.

...
compile_autoload_dotenv _Flag

Enable autoloading of .env files in standalone executable. Defaults on — compile_autoload_dotenv=off emits --no-compile-autoload-dotenv.

...
compile_autoload_package_json _Flag

Enable autoloading of package.json at runtime in standalone executable. compile_autoload_package_json=off emits --no-compile-autoload-package-json.

...
compile_autoload_tsconfig _Flag

Enable autoloading of tsconfig.json at runtime in standalone executable. compile_autoload_tsconfig=off emits --no-compile-autoload-tsconfig.

...
compile_exec_argv _Value

Prepend arguments to the standalone executable's execArgv.

...
compile_executable_path _Value

Path to a Bun executable to use for cross-compilation instead of downloading.

...
conditions _Value

Pass custom conditions to resolve.

...
css_chunking _Flag

Chunk CSS files together to reduce duplicated CSS loaded in a browser.

...
emit_dce_annotations _Flag

Re-emit DCE annotations in bundles.

...
entry_naming _Value

Customize entry point filenames.

...
env _Value

Inline environment variables into the bundle as process.env.${name}.

...
external _Value

Exclude module from transpilation (can use * wildcards).

...
footer _Value

Add a footer to the bundled output such as // built with bun!.

...
format _Value

Specifies the module format to build to.

...
keep_names _Flag

Preserve original function and class names when minifying.

...
metafile _Value

Write a JSON file with metadata about the build.

...
metafile_md _Value

Write a markdown file with a visualization of the module graph (LLM-friendly).

...
minify _Flag

Enable all minification flags.

...
minify_identifiers _Flag

Minify identifiers.

...
minify_syntax _Flag

Minify syntax and inline data.

...
minify_whitespace _Flag

Minify whitespace.

...
no_bundle _Flag

Transpile file only, do not bundle.

...
no_clear_screen _Flag

Disable clearing the terminal screen on reload when --watch is enabled.

...
outdir _Value

Default to "dist" if multiple files.

...
outfile _Value

Write to a file.

...
packages _Value

Add dependencies to bundle or keep them external.

...
production _Flag

Set NODE_ENV=production and enable minification.

...
public_path _Value

A prefix to be appended to any import paths in bundled code.

...
react_fast_refresh _Flag

Enable React Fast Refresh transform (does not emit hot-module code, use this for testing).

...
reject_unresolved _Flag

Fail the build on any dynamic import()/require() specifier that cannot be resolved at build time.

...
root _Value

Root directory used for multiple entry points.

...
server_components _Flag

(EXPERIMENTAL) Enable server components.

...
sourcemap _Value

Build with sourcemaps - 'linked', 'inline', 'external', or 'none'.

...
splitting _Flag

Enable code splitting.

...
target _Value

The intended execution environment for the bundle.

...
watch _Flag

Automatically restart the process on file change.

...
windows_copyright _Value

When using --compile targeting Windows, set the executable copyright.

...
windows_description _Value

When using --compile targeting Windows, set the executable description.

...
windows_hide_console _Flag

When using --compile targeting Windows, prevent a Command prompt from opening alongside the executable.

...
windows_icon _Value

When using --compile targeting Windows, assign an executable icon.

...
windows_publisher _Value

When using --compile targeting Windows, set the executable company name.

...
windows_title _Value

When using --compile targeting Windows, set the executable product name.

...
windows_version _Value

When using --compile targeting Windows, set the executable version (e.g.

...

flags

flags(
    *,
    bun: _Flag = ...,
    conditions: _Value = ...,
    config: _Value = ...,
    console_depth: _Value = ...,
    cpu_prof: _Flag = ...,
    cpu_prof_dir: _Value = ...,
    cpu_prof_interval: _Value = ...,
    cpu_prof_md: _Flag = ...,
    cpu_prof_name: _Value = ...,
    cron_period: _Value = ...,
    cron_title: _Value = ...,
    cwd: _Value = ...,
    dns_result_order: _Value = ...,
    elide_lines: _Value = ...,
    env_file: _Value = ...,
    eval: _Value = ...,
    experimental_http2_fetch: _Flag = ...,
    experimental_http3_fetch: _Flag = ...,
    expose_gc: _Flag = ...,
    fetch_preconnect: _Value = ...,
    filter: _Value = ...,
    heap_prof: _Flag = ...,
    heap_prof_dir: _Value = ...,
    heap_prof_md: _Flag = ...,
    heap_prof_name: _Value = ...,
    hot: _Flag = ...,
    i: _Flag = ...,
    if_present: _Flag = ...,
    import_: _Value = ...,
    inspect: _Value = ...,
    inspect_brk: _Value = ...,
    inspect_wait: _Value = ...,
    install: _Value = ...,
    max_http_header_size: _Value = ...,
    no_addons: _Flag = ...,
    no_clear_screen: _Flag = ...,
    no_deprecation: _Flag = ...,
    no_env_file: _Flag = ...,
    no_exit_on_error: _Flag = ...,
    no_install: _Flag = ...,
    no_orphans: _Flag = ...,
    parallel: _Flag = ...,
    port: _Value = ...,
    prefer_latest: _Flag = ...,
    prefer_offline: _Flag = ...,
    preload: _Value = ...,
    print: _Value = ...,
    redis_preconnect: _Flag = ...,
    require: _Value = ...,
    revision: _Flag = ...,
    sequential: _Flag = ...,
    shell: _Value = ...,
    silent: _Flag = ...,
    smol: _Flag = ...,
    sql_preconnect: _Flag = ...,
    throw_deprecation: _Flag = ...,
    title: _Value = ...,
    unhandled_rejections: _Value = ...,
    use_bundled_ca: _Flag = ...,
    use_openssl_ca: _Flag = ...,
    use_system_ca: _Flag = ...,
    user_agent: _Value = ...,
    watch: _Flag = ...,
    workspaces: _Flag = ...,
    zero_fill_buffers: _Flag = ...,
    **flags: Any,
) -> Bun

Bind tool-level global options before the subcommand.

tools.docker.flags(host=...) puts a tool's own options ahead of the verb, where they belong.

install

install(
    *args: str,
    analyze: _Flag = ...,
    backend: _Value = ...,
    ca: _Value = ...,
    cache_dir: _Value = ...,
    cafile: _Value = ...,
    concurrent_scripts: _Value = ...,
    config: _Value = ...,
    cpu: _Value = ...,
    cwd: _Value = ...,
    dev: _Flag = ...,
    dry_run: _Flag = ...,
    exact: _Flag = ...,
    filter: _Value = ...,
    force: _Flag = ...,
    frozen_lockfile: _Flag = ...,
    global_: _Flag = ...,
    ignore_scripts: _Flag = ...,
    linker: _Value = ...,
    lockfile_only: _Flag = ...,
    minimum_release_age: _Value = ...,
    network_concurrency: _Value = ...,
    no_cache: _Flag = ...,
    no_progress: _Flag = ...,
    no_summary: _Flag = ...,
    no_verify: _Flag = ...,
    omit: _Value = ...,
    only_missing: _Flag = ...,
    optional: _Flag = ...,
    os: _Value = ...,
    peer: _Flag = ...,
    production: _Flag = ...,
    quiet: _Flag = ...,
    registry: _Value = ...,
    save: _Flag = ...,
    save_text_lockfile: _Flag = ...,
    silent: _Flag = ...,
    trust: _Flag = ...,
    verbose: _Flag = ...,
    yarn: _Flag = ...,
    **flags: Any,
) -> Result

Alias: bun i

Parameters:

Name Type Description Default
analyze _Flag

Analyze & install all dependencies of files passed as arguments recursively (using Bun's bundler).

...
backend _Value

Platform-specific optimizations for installing dependencies.

...
ca _Value

Provide a Certificate Authority signing certificate.

...
cache_dir _Value

Store & load cached data from a specific directory path.

...
cafile _Value

The same as --ca, but is a file path to the certificate.

...
concurrent_scripts _Value

Maximum number of concurrent jobs for lifecycle scripts. Defaults to 2x CPU cores.

...
config _Value

Specify path to config file (bunfig.toml).

...
cpu _Value

Override CPU architecture for optional dependencies (e.g., x64, arm64, * for all).

...
cwd _Value

Set a specific cwd.

...
dev _Flag

Add dependency to "devDependencies".

...
dry_run _Flag

Perform a dry run without making changes.

...
exact _Flag

Add the exact version instead of the ^range.

...
filter _Value

Install packages for the matching workspaces.

...
force _Flag

Always request the latest versions from the registry & reinstall all dependencies.

...
frozen_lockfile _Flag

Disallow changes to lockfile.

...
global_ _Flag

Install globally.

...
ignore_scripts _Flag

Skip lifecycle scripts in the project's package.json (dependency scripts are never run).

...
linker _Value

Linker strategy (one of "isolated" or "hoisted").

...
lockfile_only _Flag

Generate a lockfile without installing dependencies.

...
minimum_release_age _Value

Only install packages published at least N seconds ago (security feature).

...
network_concurrency _Value

Maximum number of concurrent network requests. Defaults to 48.

...
no_cache _Flag

Ignore manifest cache entirely.

...
no_progress _Flag

Disable the progress bar.

...
no_summary _Flag

Don't print a summary.

...
no_verify _Flag

Skip verifying integrity of newly downloaded packages.

...
omit _Value

Exclude 'dev', 'optional', or 'peer' dependencies from install.

...
only_missing _Flag

Only add dependencies to package.json if they are not already present.

...
optional _Flag

Add dependency to "optionalDependencies".

...
os _Value

Override operating system for optional dependencies (e.g., linux, darwin, * for all).

...
peer _Flag

Add dependency to "peerDependencies".

...
production _Flag

Don't install devDependencies.

...
quiet _Flag

Only show tarball name when packing.

...
registry _Value

Use a specific registry by default, overriding .npmrc, bunfig.toml and environment variables.

...
save _Flag

Save to package.json (true by default). save=off emits --no-save.

...
save_text_lockfile _Flag

Save a text-based lockfile.

...
silent _Flag

Don't log anything.

...
trust _Flag

Add to trustedDependencies in the project's package.json and install the package(s).

...
verbose _Flag

Excessively verbose logging.

...
yarn _Flag

Write a yarn.lock file (yarn v1).

...

remove

remove(
    *args: str,
    backend: _Value = ...,
    ca: _Value = ...,
    cache_dir: _Value = ...,
    cafile: _Value = ...,
    concurrent_scripts: _Value = ...,
    config: _Value = ...,
    cpu: _Value = ...,
    cwd: _Value = ...,
    dry_run: _Flag = ...,
    force: _Flag = ...,
    frozen_lockfile: _Flag = ...,
    global_: _Flag = ...,
    ignore_scripts: _Flag = ...,
    linker: _Value = ...,
    lockfile_only: _Flag = ...,
    minimum_release_age: _Value = ...,
    network_concurrency: _Value = ...,
    no_cache: _Flag = ...,
    no_progress: _Flag = ...,
    no_summary: _Flag = ...,
    no_verify: _Flag = ...,
    omit: _Value = ...,
    os: _Value = ...,
    production: _Flag = ...,
    quiet: _Flag = ...,
    registry: _Value = ...,
    save: _Flag = ...,
    save_text_lockfile: _Flag = ...,
    silent: _Flag = ...,
    trust: _Flag = ...,
    verbose: _Flag = ...,
    yarn: _Flag = ...,
    **flags: Any,
) -> Result

Alias: bun r

Parameters:

Name Type Description Default
backend _Value

Platform-specific optimizations for installing dependencies.

...
ca _Value

Provide a Certificate Authority signing certificate.

...
cache_dir _Value

Store & load cached data from a specific directory path.

...
cafile _Value

The same as --ca, but is a file path to the certificate.

...
concurrent_scripts _Value

Maximum number of concurrent jobs for lifecycle scripts. Defaults to 2x CPU cores.

...
config _Value

Specify path to config file (bunfig.toml).

...
cpu _Value

Override CPU architecture for optional dependencies (e.g., x64, arm64, * for all).

...
cwd _Value

Set a specific cwd.

...
dry_run _Flag

Perform a dry run without making changes.

...
force _Flag

Always request the latest versions from the registry & reinstall all dependencies.

...
frozen_lockfile _Flag

Disallow changes to lockfile.

...
global_ _Flag

Install globally.

...
ignore_scripts _Flag

Skip lifecycle scripts in the project's package.json (dependency scripts are never run).

...
linker _Value

Linker strategy (one of "isolated" or "hoisted").

...
lockfile_only _Flag

Generate a lockfile without installing dependencies.

...
minimum_release_age _Value

Only install packages published at least N seconds ago (security feature).

...
network_concurrency _Value

Maximum number of concurrent network requests. Defaults to 48.

...
no_cache _Flag

Ignore manifest cache entirely.

...
no_progress _Flag

Disable the progress bar.

...
no_summary _Flag

Don't print a summary.

...
no_verify _Flag

Skip verifying integrity of newly downloaded packages.

...
omit _Value

Exclude 'dev', 'optional', or 'peer' dependencies from install.

...
os _Value

Override operating system for optional dependencies (e.g., linux, darwin, * for all).

...
production _Flag

Don't install devDependencies.

...
quiet _Flag

Only show tarball name when packing.

...
registry _Value

Use a specific registry by default, overriding .npmrc, bunfig.toml and environment variables.

...
save _Flag

Save to package.json (true by default). save=off emits --no-save.

...
save_text_lockfile _Flag

Save a text-based lockfile.

...
silent _Flag

Don't log anything.

...
trust _Flag

Add to trustedDependencies in the project's package.json and install the package(s).

...
verbose _Flag

Excessively verbose logging.

...
yarn _Flag

Write a yarn.lock file (yarn v1).

...

run

run(
    file: str,
    /,
    *args: str,
    bun: _Flag = ...,
    conditions: _Value = ...,
    config: _Value = ...,
    console_depth: _Value = ...,
    cpu_prof: _Flag = ...,
    cpu_prof_dir: _Value = ...,
    cpu_prof_interval: _Value = ...,
    cpu_prof_md: _Flag = ...,
    cpu_prof_name: _Value = ...,
    cron_period: _Value = ...,
    cron_title: _Value = ...,
    cwd: _Value = ...,
    define: _Value = ...,
    dns_result_order: _Value = ...,
    drop: _Value = ...,
    elide_lines: _Value = ...,
    env_file: _Value = ...,
    eval: _Value = ...,
    experimental_http2_fetch: _Flag = ...,
    experimental_http3_fetch: _Flag = ...,
    expose_gc: _Flag = ...,
    extension_order: _Value = ...,
    feature: _Value = ...,
    fetch_preconnect: _Value = ...,
    filter: _Value = ...,
    heap_prof: _Flag = ...,
    heap_prof_dir: _Value = ...,
    heap_prof_md: _Flag = ...,
    heap_prof_name: _Value = ...,
    hot: _Flag = ...,
    i: _Flag = ...,
    if_present: _Flag = ...,
    ignore_dce_annotations: _Flag = ...,
    import_: _Value = ...,
    inspect: _Value = ...,
    inspect_brk: _Value = ...,
    inspect_wait: _Value = ...,
    install: _Value = ...,
    jsx_factory: _Value = ...,
    jsx_fragment: _Value = ...,
    jsx_import_source: _Value = ...,
    jsx_runtime: _Value = ...,
    jsx_side_effects: _Flag = ...,
    loader: _Value = ...,
    main_fields: _Value = ...,
    max_http_header_size: _Value = ...,
    no_addons: _Flag = ...,
    no_clear_screen: _Flag = ...,
    no_deprecation: _Flag = ...,
    no_env_file: _Flag = ...,
    no_exit_on_error: _Flag = ...,
    no_install: _Flag = ...,
    no_macros: _Flag = ...,
    no_orphans: _Flag = ...,
    parallel: _Flag = ...,
    port: _Value = ...,
    prefer_latest: _Flag = ...,
    prefer_offline: _Flag = ...,
    preload: _Value = ...,
    preserve_symlinks: _Flag = ...,
    preserve_symlinks_main: _Flag = ...,
    print: _Value = ...,
    redis_preconnect: _Flag = ...,
    require: _Value = ...,
    sequential: _Flag = ...,
    shell: _Value = ...,
    silent: _Flag = ...,
    smol: _Flag = ...,
    sql_preconnect: _Flag = ...,
    throw_deprecation: _Flag = ...,
    title: _Value = ...,
    tsconfig_override: _Value = ...,
    unhandled_rejections: _Value = ...,
    use_bundled_ca: _Flag = ...,
    use_openssl_ca: _Flag = ...,
    use_system_ca: _Flag = ...,
    user_agent: _Value = ...,
    watch: _Flag = ...,
    workspaces: _Flag = ...,
    zero_fill_buffers: _Flag = ...,
    **flags: Any,
) -> Result

Run this verb.

Parameters:

Name Type Description Default
bun _Flag

Force a script or package to use Bun's runtime instead of Node.js (via symlinking node).

...
conditions _Value

Pass custom conditions to resolve.

...
config _Value

Specify path to Bun config file.

...
console_depth _Value

Set the default depth for console.log object inspection. Defaults to 2.

...
cpu_prof _Flag

Start CPU profiler and write profile to disk on exit.

...
cpu_prof_dir _Value

Specify the directory where the CPU profile will be saved.

...
cpu_prof_interval _Value

Specify the sampling interval in microseconds for CPU profiling. Defaults to 1000.

...
cpu_prof_md _Flag

Output CPU profile in markdown format (grep-friendly, designed for LLM analysis).

...
cpu_prof_name _Value

Specify the name of the CPU profile file.

...
cron_period _Value

Cron period for cron execution mode.

...
cron_title _Value

Title for cron execution mode.

...
cwd _Value

Absolute path to resolve files & entry points from.

...
define _Value

Substitute K:V while parsing, e.g. --define process.env.NODE_ENV:"development".

...
dns_result_order _Value

Set the default order of DNS lookup results.

...
drop _Value

Remove function calls, e.g. --drop=console removes all console.* calls.

...
elide_lines _Value

Number of lines of script output shown when using --filter . Defaults to 10.

...
env_file _Value

Load environment variables from the specified file(s).

...
eval _Value

Evaluate argument as a script.

...
experimental_http2_fetch _Flag

Offer h2 in fetch() TLS ALPN.

...
experimental_http3_fetch _Flag

Honor Alt-Svc: h3 in fetch() and upgrade to HTTP/3.

...
expose_gc _Flag

Expose gc() on the global object.

...
extension_order _Value

Defaults to: .tsx,.ts,.jsx,.js,.json.

...
feature _Value

Enable a feature flag for dead-code elimination, e.g. --feature=SUPER_SECRET.

...
fetch_preconnect _Value

Preconnect to a URL while code is loading.

...
filter _Value

Run a script in all workspace packages matching the pattern.

...
heap_prof _Flag

Generate V8 heap snapshot on exit (.heapsnapshot).

...
heap_prof_dir _Value

Specify the directory where the heap profile will be saved.

...
heap_prof_md _Flag

Generate markdown heap profile on exit (for CLI analysis).

...
heap_prof_name _Value

Specify the name of the heap profile file.

...
hot _Flag

Enable auto reload in the Bun runtime, test runner, or bundler.

...
i _Flag

Auto-install dependencies during execution.

...
if_present _Flag

Exit without an error if the entrypoint does not exist.

...
ignore_dce_annotations _Flag

Ignore tree-shaking annotations such as @PURE.

...
import_ _Value

Alias of --preload, for Node.js compatibility.

...
inspect _Value

Activate Bun's debugger.

...
inspect_brk _Value

Activate Bun's debugger, set breakpoint on first line of code and wait.

...
inspect_wait _Value

Activate Bun's debugger, wait for a connection before executing.

...
install _Value

Configure auto-install behavior.

...
jsx_factory _Value

Changes the function called when compiling JSX elements using the classic JSX runtime.

...
jsx_fragment _Value

Changes the function called when compiling JSX fragments.

...
jsx_import_source _Value

Declares the module specifier to be used for importing the jsx and jsxs factory functions.

...
jsx_runtime _Value

"automatic" (default) or "classic".

...
jsx_side_effects _Flag

Treat JSX elements as having side effects (disable pure annotations).

...
loader _Value

Parse files with .ext:loader, e.g. --loader .js:jsx.

...
main_fields _Value

Main fields to lookup in package.json.

...
max_http_header_size _Value

Set the maximum size of HTTP headers in bytes.

...
no_addons _Flag

Throw an error if process.dlopen is called, and disable export condition "node-addons".

...
no_clear_screen _Flag

Disable clearing the terminal screen on reload when --hot or --watch is enabled.

...
no_deprecation _Flag

Suppress all reporting of the custom deprecation.

...
no_env_file _Flag

Disable automatic loading of .env files.

...
no_exit_on_error _Flag

Continue running other scripts when one fails (with --parallel/--sequential).

...
no_install _Flag

Disable auto install in the Bun runtime.

...
no_macros _Flag

Disable macros from being executed in the bundler, transpiler and runtime.

...
no_orphans _Flag

Exit when the parent process dies, and on exit SIGKILL every descendant.

...
parallel _Flag

Run multiple scripts concurrently with Foreman-style output.

...
port _Value

Set the default port for Bun.serve.

...
prefer_latest _Flag

Use the latest matching versions of packages in the Bun runtime, always checking npm.

...
prefer_offline _Flag

Skip staleness checks for packages in the Bun runtime and resolve from disk.

...
preload _Value

Import a module before other modules are loaded.

...
preserve_symlinks _Flag

Preserve symlinks when resolving files.

...
preserve_symlinks_main _Flag

Preserve symlinks when resolving the main entry point.

...
print _Value

Evaluate argument as a script and print the result.

...
redis_preconnect _Flag

Preconnect to $REDIS_URL at startup.

...
require _Value

Alias of --preload, for Node.js compatibility.

...
sequential _Flag

Run multiple scripts sequentially with Foreman-style output.

...
shell _Value

Control the shell used for package.json scripts.

...
silent _Flag

Don't print the script command.

...
smol _Flag

Use less memory, but run garbage collection more often.

...
sql_preconnect _Flag

Preconnect to PostgreSQL at startup.

...
throw_deprecation _Flag

Determine whether or not deprecation warnings result in errors.

...
title _Value

Set the process title.

...
tsconfig_override _Value

Specify custom tsconfig.json.

...
unhandled_rejections _Value

One of "strict", "throw", "warn", "none", or "warn-with-error-code".

...
use_bundled_ca _Flag

Use bundled CA store.

...
use_openssl_ca _Flag

Use OpenSSL's default CA store.

...
use_system_ca _Flag

Use the system's trusted certificate authorities.

...
user_agent _Value

Set the default User-Agent header for HTTP requests.

...
watch _Flag

Automatically restart the process on file change.

...
workspaces _Flag

Run a script in all workspace packages (from the "workspaces" field in package.json).

...
zero_fill_buffers _Flag

Boolean to force Buffer.allocUnsafe(size) to be zero-filled.

...

test

test(
    *args: str,
    bail: _Value = ...,
    changed: _Value = ...,
    concurrent: _Flag = ...,
    coverage: _Flag = ...,
    coverage_dir: _Value = ...,
    coverage_reporter: _Value = ...,
    dots: _Flag = ...,
    isolate: _Flag = ...,
    max_concurrency: _Value = ...,
    no_orphans: _Flag = ...,
    only: _Flag = ...,
    only_failures: _Flag = ...,
    parallel: _Value = ...,
    parallel_delay: _Value = ...,
    pass_with_no_tests: _Flag = ...,
    path_ignore_patterns: _Value = ...,
    randomize: _Flag = ...,
    reporter: _Value = ...,
    reporter_outfile: _Value = ...,
    rerun_each: _Value = ...,
    retry: _Value = ...,
    seed: _Value = ...,
    shard: _Value = ...,
    test_name_pattern: _Value = ...,
    test_worker: _Flag = ...,
    timeout: _Value = ...,
    todo: _Flag = ...,
    update_snapshots: _Flag = ...,
    **flags: Any,
) -> Result

Run all matching test files and print the results to stdout

Parameters:

Name Type Description Default
bail _Value

Exit the test suite after failures.

...
changed _Value

Only run test files affected by changed files according to git.

...
concurrent _Flag

Treat all tests as test.concurrent() tests.

...
coverage _Flag

Generate a coverage profile.

...
coverage_dir _Value

Directory for coverage files.

...
coverage_reporter _Value

Report coverage in 'text' and/or 'lcov'.

...
dots _Flag

Enable dots reporter.

...
isolate _Flag

Run each test file in a fresh global object.

...
max_concurrency _Value

Maximum number of concurrent tests to execute at once.

...
no_orphans _Flag

Exit when the parent process dies, and on exit SIGKILL every descendant.

...
only _Flag

Run only tests that are marked with "test.only()" or "describe.only()".

...
only_failures _Flag

Only display test failures, hiding passing tests.

...
parallel _Value

Run test files in parallel using N worker processes.

...
parallel_delay _Value

Milliseconds the first --parallel worker must be busy before spawning the rest.

...
pass_with_no_tests _Flag

Exit with code 0 when no tests are found.

...
path_ignore_patterns _Value

Glob patterns for test file paths to ignore.

...
randomize _Flag

Run tests in random order.

...
reporter _Value

Test output reporter format.

...
reporter_outfile _Value

Output file path for the reporter format (required with --reporter).

...
rerun_each _Value

Re-run each test file times, helps catch certain bugs.

...
retry _Value

Default retry count for all tests, overridden by per-test { retry: N }.

...
seed _Value

Set the random seed for test randomization.

...
shard _Value

Run a subset of test files, e.g. '--shard=⅓' runs the first of three shards.

...
test_name_pattern _Value

Run only tests with a name that matches the given regex.

...
test_worker _Flag

(internal) Run as a --parallel worker, receiving files over IPC.

...
timeout _Value

Set the per-test timeout in milliseconds, default is 5000.

...
todo _Flag

Include tests that are marked with "test.todo()".

...
update_snapshots _Flag

Update snapshot files.

...

x

x(
    *args: str,
    bun: _Flag = ...,
    no_install: _Flag = ...,
    package: _Value = ...,
    silent: _Flag = ...,
    verbose: _Flag = ...,
    **flags: Any,
) -> Result

Execute an npm package executable (CLI), automatically installing into a global shared cache if not installed in node_modules.

Parameters:

Name Type Description Default
bun _Flag

Force the command to run with Bun instead of Node.js.

...
no_install _Flag

Skip installation if package is not already installed.

...
package _Value

Specify package to install when binary name differs from package name.

...
silent _Flag

Suppress output during installation.

...
verbose _Flag

Enable verbose output during installation.

...