bun-utils

A rules reference for the Bun command-line tool's built-in runtime values and functions. It documents items such as the running Bun version, revision, environment variables, entrypoint path, and timed delays.

In plain words
What is it for?
Use it while writing Bun programs that need version or environment details, the main entrypoint path, or a promise that resolves after a delay.
Why use it?
Bun-specific behavior can be unclear if you only know Node.js or browser JavaScript. This reference explains how to inspect runtime information and distinguish a directly run script from an imported one.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/takuya0206/bigquery-mcp-server/bun-utils
Clone the repo
git clone --depth 1 https://github.com/takuya0206/bigquery-mcp-server

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 8,075 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.08075
Opus 5 $0.00000 $0.04038
Sonnet 5 $0.00000 $0.01615
Haiku 4.5 $0.00000 $0.00808

Measured 2d ago against content hash 457283f3bcdd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

bun-utils scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • bun-utils — 100% identical, 0 lines differ
.cursor/rules/bun-utils.mdc · 803 lines

How it starts

The opening of the file, as written. The whole thing — 803 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Bun.version

A string containing the version of the bun CLI that is currently running.

Bun.version;
// => "0.6.4"

Bun.revision

The git commit of Bun that was compiled to create the current bun CLI.

Bun.revision;
// => "f02561530fda1ee9396f51c8bc99b38716e38296"

Bun.env

An alias for process.env.

Bun.main

An absolute path to the entrypoint of the current program (the file that was executed with bun run).

Bun.main;
// /path/to/script.ts

This is particular useful for determining whether a script is being directly executed, as opposed to being imported by another script.

if (import.meta.path === Bun.main) {
  // this script is being directly executed
} else {
  // this file is being imported from another script
}

This is analogous to the require.main = module trick in Node.js.

Bun.sleep()

Bun.sleep(ms: number)

Returns a Promise that resolves after the given number of milliseconds.

console.log("hello");
await Bun.sleep(1000);
console.log("hello one second later!");

Alternatively, pass a Date object to receive a Promise that resolves at that point in time.

const oneSecondInFuture = new Date(Date.now() + 1000);

console.log("hello");
await Bun.sleep(oneSecondInFuture);
console.log("hello one second later!");

Bun.sleepSync()

Bun.sleepSync(ms: number)

A blocking synchronous version of Bun.sleep.

console.log("hello");
Bun.sleepSync(1000); // blocks thread for one second
console.log("hello one second later!");

Bun.which()

Bun.which(bin: string)

Returns the path to an executable, similar to typing which in your terminal.

const ls = Bun.which("ls");
console.log(ls); // "/usr/bin/ls"

By default Bun looks at the current PATH environment variable to determine the path. To configure PATH:

Read the full file on GitHub · 803 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 803 lines · 8,075 tokens per session scan A 457283f3bcdd

Subscribe to this mod's changes

bun-utils is a cursor rule published in the GitHub repository takuya0206/bigquery-mcp-server (5 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 8,075 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.