Skip to content
ocx
install

rules_ocx

Bazel module extension that provisions pinned CLI tools, such as jq or shellcheck, as runnable targets through the OCX package manager.

MODULE.bazel
bazel_dep(name = "rules_ocx", version = "0.5.0")
ocx = use_extension("@rules_ocx//ocx:extensions.bzl", "ocx")
# Provision the workspace toolchain from ocx.toml and ocx.lock.
ocx.project(
name = "tools",
ocx_toml = "//:ocx.toml",
ocx_lock = "//:ocx.lock",
)
use_repo(ocx, "tools")

Every executable a package declares becomes a target such as @tools//:shellcheck.

Start the tutorial to run shellcheck in a Bazel test without installing it.

Source, issues and examples live in the GitHub repository.