commands.sh

bun

all

JavaScript runtime and toolkit. Includes a bundler, a test runner, and a package manager.

More info →

Subcommands (26)

bun add

Add and install new dependencies to the current project. Note: `a` can be used as an alias for `add`.

bun audit

Check installed packages for known security vulnerabilities.

bun build

Bundle JavaScript and TypeScript files with Bun's fast native bundler.

bun c

This command is an alias of `bun create`.

bun create

Create a new project from a template. Note: `c` can be used as an alias for `create`.

bun exec

Execute shell commands or script files using Bun's runtime. Note: When running from a shell, remember to escape quotes.

bun feedback

Send feedback to Bun.

bun i

This command is an alias of `bun install`.

bun-info

Display package metadata from the npm registry.

bun init

Scaffold an empty Bun project.

bun install

Install JavaScript dependencies for a project from `package.json`.

bun link

Register a local package as linkable or link a registered package into a project. See also: `bun unlink`.

bun list

This command is an alias of `bun pm ls`.

bun outdated

List dependencies that have newer versions available.

bun patch

Prepare a package for patching or generate a patch file.

bun pm

A set of utilities for working with Bun's package manager. Some subcommands such as `pack`, `pkg` have their own usage documentation.

bun publish

Publish a package to the npm registry.

bun remove

Remove a dependency from `package.json`. Note: `rm` can be used as an alias for `remove`.

bun rm

This command is an alias of `bun remove`.

bun run

Execute a JavaScript/TypeScript file, or a script from `package.json`.

bun test

Run tests using Bun's built-in test runner. It is a fast, Jest-compatible test runner that looks for `*.test.ts` (and similar) files.

bun unlink

Unregister the current directory as a linkable package. See also: `bun link`.

bun update

Update dependencies in a Bun project.

bun upgrade

Upgrade Bun to the latest version.

bun why

Explain why a package is installed by showing its dependency chain.

bun x

This command is an alias of `bunx`.

Options (3)

boolean

Download and install all the packages listed as dependencies in `package.json`

Example: bun {{[i|install]}}
boolean

Add a dependency to `package.json`

Example: bun {{[a|add]}} {{module_name}}
boolean

Remove a dependency from `package.json`

Example: bun {{[rm|remove]}} {{module_name}}

Examples (8)

Create a new Bun project in the current directory

Run a JavaScript file or a `package.json` script

bun run path/to/file|script_name

Run unit tests

Download and install all the packages listed as dependencies in `package.json`

bun [i|install]

Add a dependency to `package.json`

bun [a|add] module_name

Remove a dependency from `package.json`

bun [rm|remove] module_name

Start a REPL (interactive shell)

bun repl

Upgrade Bun to the latest version

made by @shridhargupta | data from tldr-pages