From b55e55bbd967c2cb6bdc1be9db7d600387b6f21a Mon Sep 17 00:00:00 2001 From: danielctc <22890049+danielctc@users.noreply.github.com> Date: Sun, 31 May 2026 14:31:50 +0100 Subject: [PATCH] feat(cli): add bun and bunx command support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bun is among the most common unhandled commands in `rtk discover` (bun run alone shows ~350 invocations/month on bun-first projects), yet npm, npx and pnpm are all routed. Add bun/bunx rewrite rules, a bun output filter that strips the `bun run v…` banner and the `$ ` echo line, and bunx intelligent routing into the existing tsc/eslint/prisma/next/prettier/playwright filters, mirroring the npx handler. bun build and bun install are deliberately left unrouted so bundler and installer output is never altered. --- README.md | 2 + src/cmds/js/bun_cmd.rs | 116 +++++++++++++++++++++++++++++++++++++++ src/core/tracking.rs | 4 +- src/discover/registry.rs | 28 ++++++++++ src/discover/rules.rs | 18 ++++++ src/main.rs | 48 +++++++++++++++- 6 files changed, 212 insertions(+), 4 deletions(-) create mode 100644 src/cmds/js/bun_cmd.rs diff --git a/README.md b/README.md index 492589ef8..f4370a1a1 100644 --- a/README.md +++ b/README.md @@ -202,6 +202,8 @@ rtk rubocop # Ruby linting (JSON, -60%+) ### Package Managers ```bash rtk pnpm list # Compact dependency tree +rtk bun run typecheck # bun scripts (strip banner + $ echo) +rtk bunx tsc # bunx with routing (tsc/eslint/prisma…) rtk pip list # Python packages (auto-detect uv) rtk pip outdated # Outdated packages rtk bundle install # Ruby gems (strip Using lines) diff --git a/src/cmds/js/bun_cmd.rs b/src/cmds/js/bun_cmd.rs new file mode 100644 index 000000000..1386716c2 --- /dev/null +++ b/src/cmds/js/bun_cmd.rs @@ -0,0 +1,116 @@ +//! Filters bun output, mirroring the npm/npx filters which don't cover bun. +//! +//! `bun run