rtk-ai/rtk

feat: add Bun runtime support (bun test, bun run, bunx)

Open

#832 opened on 2026年3月25日

GitHub で見る
 (4 comments) (12 reactions) (0 assignees)Rust (2,914 forks)batch import
area:clieffort-largeeffort-mediumenhancementhelp wantedpriority:medium

Repository metrics

Stars
 (48,085 stars)
PR merge metrics
 (平均マージ 11d 1h) (30d で 45 merged PRs)

説明

Context

Bun is a fast JavaScript runtime used as the default in many modern projects. RTK has no support for it — no Rust module, no TOML filter, no rewrite rule.

RTK already supports Node.js ecosystem tools (npm, pnpm, vitest, tsc, eslint, prettier, next, playwright, prisma) but the Bun equivalents are missing.

Scope

Command Description Expected savings
rtk bun test Bun's built-in test runner (similar to vitest) 85-90%
rtk bun run <script> Script runner (similar to npm run) 70-80%
rtk bun install Package install (similar to pnpm install) 80-90%
rtk bunx <pkg> Package executor (similar to npx) 70-80%
rtk bun build Bundler output 75-85%

Rewrite rules

The hook should rewrite:

  • bun testrtk bun test
  • bun run <script>rtk bun run <script>
  • bun installrtk bun install
  • bunx <pkg>rtk bunx <pkg>
  • bun buildrtk bun build

Implementation

Options:

  1. Rust module (src/bun_cmd.rs) with sub-enum — best for bun test (structured output parsing)
  2. TOML filters for simpler commands (bun install, bun build)
  3. Hybrid — Rust for test, TOML for the rest

References

  • Vitest module (similar test runner): src/vitest_cmd.rs
  • pnpm module (similar package manager): src/pnpm_cmd.rs
  • npm module: src/npm_cmd.rs

コントリビューターガイド