AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Bun Runtime

skill-secondsky-claude-skills-bun-runtime · by secondsky

Use for Bun runtime, bunfig.toml, watch/hot modes, env vars, CLI flags, and module resolution.

No reviews yet
0 installs
31 views
0.0% view→install

Install

$ agentstack add skill-secondsky-claude-skills-bun-runtime

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access Used
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-secondsky-claude-skills-bun-runtime)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Bun Runtime? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Bun Runtime

Bun is a fast all-in-one JavaScript runtime built on JavaScriptCore (Safari's engine). It provides 4x faster startup than Node.js on Linux.

Quick Start

# Run a file
bun run index.ts
bun index.ts  # shorthand

# Run with watch mode
bun --watch run index.ts

# Run package.json script
bun run dev

# Run with hot reloading
bun --hot run server.ts

Core CLI Flags

| Flag | Purpose | |------|---------| | --watch | Restart on file changes | | --hot | Hot module replacement (preserves state) | | --smol | Reduce memory usage (slower GC) | | --inspect | Enable debugger | | --preload | Load modules before execution | | --env-file | Load specific .env file | | -e, --eval | Evaluate code string |

Running Files

Bun transpiles TypeScript and JSX on-the-fly:

bun run index.js
bun run index.ts
bun run index.jsx
bun run index.tsx

Important: Put Bun flags immediately after bun:

bun --watch run dev    # Correct
bun run dev --watch    # Wrong - flag passed to script

Package.json Scripts

# Run script
bun run dev
bun dev  # shorthand (if no Bun command conflicts)

# List available scripts
bun run

# Run with Bun instead of Node
bun run --bun vite

Bun respects lifecycle hooks (preclean, postclean, etc.).

Watch Mode vs Hot Reloading

| Mode | Flag | Behavior | |------|------|----------| | Watch | --watch | Full process restart on changes | | Hot | --hot | Replace modules, preserve state |

# Watch mode - full restart
bun --watch run server.ts

# Hot reloading - preserves connections/state
bun --hot run server.ts

Environment Variables

Bun automatically loads .env files:

# Loads automatically: .env, .env.local, .env.development
bun run index.ts

# Specify env file
bun --env-file .env.production run index.ts

# Disable auto-loading
# In bunfig.toml: env = false

Access in code:

const apiKey = process.env.API_KEY;
const bunEnv = Bun.env.NODE_ENV;

Globals Available

| Global | Source | Notes | |--------|--------|-------| | Bun | Bun | Main API object | | Buffer | Node.js | Binary data | | process | Node.js | Process info | | fetch | Web | HTTP requests | | Request/Response | Web | HTTP types | | WebSocket | Web | WebSocket client | | crypto | Web | Cryptography | | console | Web | Logging | | __dirname | Node.js | Current directory | | __filename | Node.js | Current file |

Preload Scripts

Load modules before your main script:

bun --preload ./setup.ts run index.ts

Or in bunfig.toml:

preload = ["./setup.ts"]

Use cases: polyfills, global setup, instrumentation.

Stdin Execution

# Pipe code to Bun
echo "console.log('Hello')" | bun run -

# Redirect file
bun run - < script.js

Workspaces & Monorepos

# Run script in specific packages
bun run --filter 'pkg-*' build

# Run in all workspaces
bun run --filter '*' test

Debugging

# Start debugger
bun --inspect run index.ts

# Wait for debugger connection
bun --inspect-wait run index.ts

# Break on first line
bun --inspect-brk run index.ts

Connect via Chrome DevTools or VS Code.

Common Errors

| Error | Cause | Fix | |-------|-------|-----| | Cannot find module | Missing dependency | Run bun install | | Top-level await | Using await outside async | Wrap in async function or use .mts | | --watch not working | Flag in wrong position | Put flag before run |

When to Load References

Load references/bunfig.md when:

  • Configuring bunfig.toml
  • Setting up test configuration
  • Configuring package manager behavior
  • Setting JSX options

Load references/cli-flags.md when:

  • Need complete CLI flag reference
  • Configuring advanced runtime options
  • Setting up debugging

Load references/module-resolution.md when:

  • Troubleshooting import errors
  • Configuring path aliases
  • Understanding Bun's resolution algorithm

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.