rtk-ai/rtk

Feature request: add support for Bazel/Bazelisk

Open

#1,061 opened on Apr 7, 2026

View on GitHub
 (2 comments) (1 reaction) (0 assignees)Rust (2,914 forks)batch import
area:clieffort-largeenhancementhelp wantedpriority:low

Repository metrics

Stars
 (48,085 stars)
PR merge metrics
 (Avg merge 11d 1h) (45 merged PRs in 30d)

Description

Summary

Bazel (and Bazelisk) builds can be extremely verbose and would benefit from RTK filtering for Java/JVM developers using Bazel as their build system.

Why Bazel needs a dedicated Rust module (not just TOML)

Bazel sends most of its output (progress, errors, summaries) to stderr, not stdout. TOML filters only capture stdout, so they miss ~90% of Bazel's output. A dedicated Rust module using runner::run_filtered can capture and filter both streams.

Commands that should be supported

  • bazel build / bazelisk build — strip [X / Y] progress lines, INFO: noise, Loading:, Analyzing:, repo cache info; keep ERROR: and build result
  • bazel test / bazelisk test — show only PASSED/FAILED per target and summary; strip progress noise
  • bazel query / cquery / aquery — strip INFO: and Loading: lines, keep target labels
  • bazel run — same filtering as build
  • bazel clean — compact output

Estimated savings

Operation Raw output Filtered Savings
bazel build (success) ~30 lines 1 line ~95%
bazel build (failure) ~30 lines 3-5 lines (errors only) ~85%
bazel test (all pass) ~20 lines 1 line ~95%
bazel query //... ~10+ INFO lines + targets targets only ~50-80%

Reference implementation

I have a working implementation in my fork: https://github.com/tructxn/rtk/commit/58fb4ef

Key files:

  • src/cmds/jvm/bazel_cmd.rs — dedicated Rust module with build/test/query/run/clean filters (13 unit tests)
  • src/cmds/jvm/mod.rs — JVM ecosystem module
  • src/filters/bazel-build.toml, bazel-test.toml, bazel-query.toml — TOML fallback filters for hook rewrite path
  • src/main.rsCommands::Bazel with BazelCommands subcommands

All 1363 tests pass. Regex matches both bazel and bazelisk via ^bazel(isk)?.

Contributor guide