rules_multirun 0.14.0Latest published 1d ago
MODULE.bazel
bazel_dep(name = "rules_multirun", version = "0.14.0")
README

rules_multirun

These rules provide a simple interface for running multiple commands in parallel with a single bazel run invocation. This is especially useful for running multiple linters or formatters with a single command.

Usage

Setup the tools you want to run:

load("@rules_multirun//:defs.bzl", "command", "multirun")
load("@rules_python//python:defs.bzl", "py_binary")

sh_binary(
    name = "some_linter",
    ...
)

py_binary(
    name = "some_other_linter",
    ...
)

command(
    name = "lint-something",
    command = ":some_linter",
    arguments = ["check"], # Optional arguments passed directly to the tool
)

command(
    name = "lint-something-else",
    command = ":some_other_linter",
    environment = {"CHECK": "true"}, # Optional environment variables set when invoking the command
    data = ["..."] # Optional runtime data dependencies
)

multirun(
    name = "lint",
    commands = [
        "lint-something",
        "lint-something-else",
    ],
    jobs = 0, # Set to 0 to run in parallel, defaults to sequential
)

Run the multirun target with bazel:

$ bazel run //:lint

See the full API docs for more info.

Usage with platform transitions

In case if the multirun rule requires a transition to other configuration than target then a new multirun-like rule can be defined as in the following example

load("@rules_multirun//:defs.bzl", "multirun_with_transition")

def _aws_deploy_platforms_impl(settings, attr):
    return {"//command_line_option:platforms": [":aws_lambda"]}

aws_deploy_transition = transition(
    implementation = _aws_deploy_platforms_impl,
    inputs = [],
    outputs = ["//command_line_option:platforms"],
)

aws_deploy = multirun_with_transition(
    aws_deploy_transition,
    "@bazel_tools//tools/allowlists/function_transition_allowlist"
)

and used in a BUILD file

aws_deploy(
    name = "staging",
    commands = [
       ...
    ]
)

Installation

Go to the releases page to grab the WORKSPACE snippet for the latest release.

Acknowledgements

This is a fork of the original multirun rules. Those rules have a dependency on golang to run, which may not be desired, these rules use a python script instead.

About

Bazel rules for running multiple commands in parallel in a single bazel invocation

@keith/rules_multirun@keith
Homepage
113stars
Thursday, June 11, 2026 (1 day ago)
@publish-to-bcr-bot#9232 rules_multirun@0.14.0 (#9232)

Languages

Shell16.1%
Python11.5%

Maintainers

@keith

Versions

0.14.0 +9.6mo2026-06-11
0.13.0 +3.9mo7% 112025-08-26
0.12.0 +1.1mo2% 42025-05-01
0.11.0 +4.0mo2025-03-27
0.10.0 +8.3mo4% 62024-11-26
0.9.0 +22d84% 1392024-03-22
0.8.1 +4d2024-02-28
0.7.0 +8.2mo1% 22024-02-23
0.6.1 +3.8mo2% 32023-06-22
0.6.0 +3d2023-02-28
0.5.0 +9d2023-02-24
0.4.1 +1.0mo2023-02-14
0.3.22023-01-15