Skip to content

bunx CLI Usage

bash
bunx [flags] <package>[@version] [flags and arguments for the package]

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

Flags

--bunboolean
Force the command to run with Bun instead of Node.js, even if the executable contains a Node shebang (`#!/usr/bin/env node`)
-p, --packagestring
Specify package to install when binary name differs from package name
--no-installboolean
Skip installation if package is not already installed
--verboseboolean
Enable verbose output during installation
--silentboolean
Suppress output during installation

Examples

bash
# Run Prisma migrations
bunx prisma migrate

# Format a file with Prettier
bunx prettier foo.js

# Run a specific version of a package
bunx uglify-js@3.14.0 app.js

# Use --package when binary name differs from package name
bunx -p @angular/cli ng new my-app

# Force running with Bun instead of Node.js, even if the executable contains a Node shebang
bunx --bun vite dev foo.js

Bun by www.bunjs.com.cn 편집