← 返回命令列表

Linux command

bun-x 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Run a package binary

bun x [package]

Run a specific version

bun x [package]@[version]

Pass arguments

bun x [package] -- [args...]

Run create-* packages

bun x create-[template] [project-name]

说明

bun x runs a package's binary without permanently installing it. It's similar to npx but significantly faster due to Bun's caching and native implementation. If the package is already installed locally or globally, it uses that version. Otherwise, it downloads and caches the package temporarily. Common use cases include running scaffolding tools (create-react-app, create-next-app), one-off utilities, and trying packages before installing.

FAQ

What is the bun-x command used for?

bun x runs a package's binary without permanently installing it. It's similar to npx but significantly faster due to Bun's caching and native implementation. If the package is already installed locally or globally, it uses that version. Otherwise, it downloads and caches the package temporarily. Common use cases include running scaffolding tools (create-react-app, create-next-app), one-off utilities, and trying packages before installing.

How do I run a basic bun-x example?

Run `bun x [package]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

Where can I find more bun-x examples?

This page includes 4 examples for bun-x, plus related commands for nearby Linux tasks.