Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计异常

bunBun 运行时

Agent Skill

bun 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

485

周安装

20

GitHub Stars

3

下载量

158
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:bun(Bun 运行时)
来源仓库:https://github.com/fellipeutaka/leon
仓库路径:skills/bun
安装命令:
npx skills add https://github.com/fellipeutaka/leon --skill bun
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/fellipeutaka/leon --skill bun

简介

bun 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。

  • 可结合来源仓库、安装命令和原始 README 继续核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 当前顶部介绍为空,原始 SKILL.md 摘录未提供。
  • bun 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Bun

Quick Start

# Install
curl -fsSL https://bun.sh/install | bash

# Init project
bun init

# Run TypeScript directly
bun run index.ts

# Watch mode (hard restart on change)
bun --watch index.ts

# Hot reload (preserves global state, no restart)
bun --hot server.ts

Package Management

bun install                    # install all deps
bun add express                # add dependency
bun add -d @types/node         # add dev dependency
bun remove lodash              # remove
bun update                     # update all
bun update --latest            # ignore semver ranges
bunx prettier --write .        # execute package binary (npx equivalent)
bun patch express              # patch a dependency in node_modules

Workspaces

// root package.json
{ "workspaces": ["packages/*"] }

// child package.json
{ "dependencies": { "shared": "workspace:*" } }
bun install --filter "pkg-*"   # install filtered workspaces

Environment Variables

.env files auto-loaded in order: .env.env.$(NODE_ENV).env.local

Bun.env.API_KEY       // Bun-native
process.env.API_KEY   // Node.js compat
import.meta.env.API_KEY
bun --env-file=.env.staging run start

HTTP Server

Bun.serve({
  port: 3000,
  routes: {
    "/": new Response("Home"),
    "/users/:id": (req) => Response.json({ id: req.params.id }),
    "/api/posts": {
      GET: () => Response.json([]),
      POST: async (req) => Response.json(await req.json(), { status: 201 }),
    },
    "/api/*": Response.json({ error: "Not found" }, { status: 404 }),
    "/favicon.ico": Bun.file("./favicon.ico"),
  },
  fetch(req) {
    return new Response("Not Found", { status: 404 });
  },
});

WebSocket Upgrade

Bun.serve({
  fetch(req, server) {
    if (server.upgrade(req, { data: { userId: "123" } })) return;
    return new Response("Not a WebSocket", { status: 400 });
  },
  websocket: {
    open(ws) { ws.subscribe("chat"); },
    message(ws, msg) { ws.publish("chat", msg); },
    close(ws) {},
  },
});

Fullstack (HTML Imports)

import homepage from "./index.html";

Bun.serve({
  routes: { "/": homepage },
  development: true, // enables HMR
});

See references/http-server.md for cookies, static routes, TLS, server lifecycle, metrics.

Databases

Bun.sql (Postgres / MySQL / SQLite)

import { sql, SQL } from "bun";

// Auto-reads DATABASE_URL / POSTGRES_URL / MYSQL_URL
const users = await sql`SELECT * FROM users WHERE active = ${true}`;

// Explicit connection
const pg = new SQL("postgres://user:pass@localhost:5432/mydb");
const mysql = new SQL("mysql://user:pass@localhost:3306/mydb");
const sqlite = new SQL(":memory:");

// Insert with object helper
const [user] = await sql`INSERT INTO users ${sql({ name: "Alice", email: "a@b.com" })} RETURNING *`;

// Bulk insert
await sql`INSERT INTO users ${sql([user1, user2, user3])}`;

// Transactions
await sql.begin(async (tx) => {
  const [u] = await tx`INSERT INTO users ${sql({ name: "Bob" })} RETURNING *`;
  await tx`INSERT INTO accounts (user_id) VALUES (${u.id})`;
});

bun:sqlite (Sync, Embedded)

import { Database } from "bun:sqlite";

const db = new Database("app.db");
db.run("CREATE TABLE IF NOT EXISTS kv (key TEXT PRIMARY KEY, val TEXT)");
const row = db.query("SELECT * FROM kv WHERE key = ?").get("foo");
const all = db.query("SELECT * FROM kv").all();

// Class mapping
class User { id!: number; name!: string; }
const users = db.query("SELECT * FROM users").as(User).all();

Bun.redis

import { redis } from "bun";

await redis.set("key", "value", { ex: 60 });
const val = await redis.get("key");
await redis.del("key");
await redis.hmset("user:1", { name: "Alice", role: "admin" });

See references/database.md for transactions, savepoints, MySQL/SQLite specifics, Redis pub/sub, connection options.

Shell ($)

import { $ } from "bun";

// Run and print to stdout
await $`echo "Hello"`;

// Capture output
const text = await $`ls -la`.text();
const data = await $`cat config.json`.json();
for await (const line of $`cat file.txt`.lines()) { }

// Pipes
await $`cat file.txt | grep "pattern" | wc -l`;

// Redirect from/to JS objects
await $`cat < ${new Response("data")} > ${Bun.file("out.txt")}`;

// Error handling
const { exitCode } = await $`may-fail`.nothrow().quiet();

// Config
$.cwd("/tmp");
$.env({ ...process.env, NODE_ENV: "production" });

Security: Interpolated variables are auto-escaped (no shell injection). Use {raw: str} to bypass.

See references/shell.md for builtins, command substitution, brace expansion.

File I/O & S3

// Read
const file = Bun.file("data.json");
const json = await file.json();       // also: .text(), .bytes(), .stream(), .arrayBuffer()
console.log(file.size, file.type);    // size in bytes, MIME type

// Write
await Bun.write("out.txt", "hello");
await Bun.write(Bun.file("copy.bin"), Bun.file("src.bin")); // copy file

// Incremental write
const writer = Bun.file("log.txt").writer();
writer.write("line 1\n");
writer.write("line 2\n");
writer.end();

// S3
import { s3 } from "bun";
const obj = s3.file("data.json");
const data = await obj.json();
await obj.write(JSON.stringify({ ok: true }));
const url = obj.presign({ expiresIn: 3600, method: "PUT" });
await obj.delete();

// s3:// protocol
const res = await fetch("s3://bucket/file.txt");

// Glob
const glob = new Bun.Glob("**/*.ts");
for await (const path of glob.scan(".")) console.log(path);

See references/file-io.md for S3 credentials, multipart uploads, streams, hashing, semver.

Testing

import { test, expect, describe, mock, spyOn, beforeEach } from "bun:test";

describe("math", () => {
  test("adds", () => expect(1 + 1).toBe(2));

  test.each([
    [1, 2, 3],
    [4, 5, 9],
  ])("%i + %i = %i", (a, b, expected) => {
    expect(a + b).toBe(expected);
  });

  test.skip("wip", () => {});
  test.todo("implement later");
});

// Mock functions
const fn = mock(() => 42);
fn();
expect(fn).toHaveBeenCalled();

// Module mocking
mock.module("./db", () => ({
  query: mock(() => []),
}));

// Spies
const spy = spyOn(console, "log");
console.log("test");
expect(spy).toHaveBeenCalledWith("test");

// Snapshots
test("snap", () => {
  expect({ a: 1, b: "hello" }).toMatchSnapshot();
});
bun test                          # run all tests
bun test --watch                  # watch mode
bun test --coverage               # with coverage
bun test --update-snapshots       # update snapshots
bun test --bail                   # stop on first failure
bun test --test-name-pattern "add" # filter by name

See references/testing.md for all matchers, lifecycle hooks, type testing, retry/repeats, DOM testing.

Bundler & Compile

// Bundle for browser
const result = await Bun.build({
  entrypoints: ["./src/index.ts"],
  outdir: "./dist",
  splitting: true,
  minify: true,
  sourcemap: "linked",
  target: "browser", // or "bun", "node"
});

if (!result.success) {
  for (const log of result.logs) console.error(log);
}
# Compile to standalone executable
bun build --compile --minify --sourcemap --bytecode ./app.ts --outfile myapp

# Cross-compile
bun build --compile --target=bun-linux-x64 ./app.ts --outfile myapp-linux
bun build --compile --target=bun-darwin-arm64 ./app.ts --outfile myapp-mac
// Embed files in executable
import icon from "./icon.png" with { type: "file" };
import db from "./data.db" with { type: "sqlite", embed: "true" };

See references/bundler.md for all build options, plugins, cross-compile targets, Windows options, Transpiler API.

Child Processes

// Async
const proc = Bun.spawn(["ls", "-la"], {
  cwd: "/tmp",
  stdout: "pipe",
});
const output = await new Response(proc.stdout).text();
await proc.exited;

// Sync
const { stdout, exitCode } = Bun.spawnSync(["echo", "hi"]);

// Timeout + abort
const ctrl = new AbortController();
Bun.spawn(["sleep", "100"], { signal: ctrl.signal, timeout: 5000 });

// IPC between bun processes
const child = Bun.spawn(["bun", "worker.ts"], {
  ipc(msg) { console.log("from child:", msg); },
});
child.send({ type: "start" });

Configuration (bunfig.toml)

# Common options
preload = ["./setup.ts"]
logLevel = "warn"

[run]
shell = "bun"                    # use Bun's shell instead of system shell
bun = true                       # alias node to bun in scripts

[test]
preload = ["./test-setup.ts"]
coverage = true
coverageThreshold = 0.8
retry = 2

[install]
exact = true                     # pin exact versions
frozenLockfile = true            # CI: fail if lockfile out of date
auto = "fallback"                # auto-install missing packages

See references/configuration.md for full bunfig.toml reference.

Reference Index

TopicReference
HTTP server, routing, WebSockets, cookies, fullstackreferences/http-server.md
Bun.sql, bun:sqlite, Bun.redisreferences/database.md
TCP, UDP, DNS, fetchreferences/networking.md
Bun Shell ($)references/shell.md
bun:test, mocking, snapshots, coveragereferences/testing.md
Bun.build, compile to executable, pluginsreferences/bundler.md
Bun.file, S3, Glob, streams, hashing, semverreferences/file-io.md
bunfig.toml full referencereferences/configuration.md
Workers, HTMLRewriter, FFI, C compiler, secrets, Node.js compatreferences/advanced.md

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.27%
按下载量换算60

Claude

28.13%
按下载量换算44

Cursor

18.49%
按下载量换算29

Gemini CLI

8.69%
按下载量换算14

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills