bun run & bunx in Bun
From the Bun cheat sheet ยท Running Scripts & Files ยท verified Jul 2026
bun run & bunx
Run files, package.json scripts, and remote packages
bash
# Run a TypeScript/JavaScript file
bun run index.ts
bun index.ts # "run" is optional
# Run package.json scripts
bun run dev
bun run build
# Execute a package (like npx)
bunx cowsay "Hello!"
bunx --bun vite # Force Bun runtime๐ก bun --watch restarts the whole process on changes; --hot reloads modules in-place
โก bun run is 30x faster than npm run โ it skips shell interpretation overhead
๐ bunx --bun forces packages like Vite or Prisma to run on Bun instead of Node
๐ข Bun auto-loads .env files โ no dotenv package needed
runbunxscriptswatch