buns

Run TypeScript scripts
with inline dependencies

No package.json needed. Just declare your npm packages in comments and run. Inspired by PEP 723 and uv.

hello.ts
#!/usr/bin/env buns
// buns
// packages = ["chalk@^5.0"]

import chalk from "chalk";

console.log(chalk.green("Hello from buns!"));
Dependencies auto-installed Cached for reuse

Scripts that just work

Everything you need to run standalone TypeScript scripts without the ceremony.

Inline Dependencies

Declare npm packages directly in your script comments. They're automatically installed and cached the first time you run.

Bun Version Management

Pin specific Bun versions per script. Missing versions are automatically downloaded from official releases.

Smart Caching

Dependencies are stored in a content-addressed cache. Same packages across scripts share a single installation.

Zero Config

No package.json. No tsconfig.json. No node_modules. Just write your script and run it.

Secure by Design

Run untrusted scripts safely with built-in sandboxing. Control filesystem access, network, and resource limits.

Filesystem Isolation

Restrict read and write access to only the paths your scripts need

Network Control

Block all network access or allow only specific hosts with wildcards

Resource Limits

Set memory, CPU time, and execution timeout limits per script

$ buns script.ts --sandbox --allow-read /data --allow-write /tmp

Uses sandbox-exec on macOS, bubblewrap on Linux

Get started in seconds

Choose your preferred installation method.

Homebrew (Recommended)
brew install eddmann/tap/buns
Quick Install
curl -fsSL https://raw.githubusercontent.com/eddmann/buns/main/install.sh | sh

Then run your first script

Terminal
$ buns hello.ts
Hello from buns!