Bazel Central Registry
Overview
Use this skill to query BCR module metadata, update bzlmod dependencies, and inspect dependency trees. The skill bundles the upstream registry.py helper and a thin CLI (bcr_tool.py) that wraps common workflows.
Quick start
- •List direct deps from a workspace (follows
include()chains):- •
python3 scripts/bcr_tool.py list-deps --module-file /path/to/MODULE.bazel
- •
- •Check latest versions from BCR:
- •
python3 scripts/bcr_tool.py latest --module rules_go --module rules_python
- •
- •Dry-run upgrade (print diffs only):
- •
python3 scripts/bcr_tool.py upgrade --module-file /path/to/MODULE.bazel
- •
- •Apply upgrade edits:
- •
python3 scripts/bcr_tool.py upgrade --module-file /path/to/MODULE.bazel --write
- •
- •Best-effort dependency tree (bounded depth):
- •
python3 scripts/bcr_tool.py deps-tree --module-file /path/to/MODULE.bazel --max-depth 2
- •
Tasks
Find modules / versions (local registry clone)
- •Clone or point at a local bazel-central-registry checkout.
- •Search by substring:
- •
python3 scripts/bcr_tool.py find --registry-path /path/to/bazel-central-registry --query rules_
- •
- •List versions for a module:
- •
python3 scripts/bcr_tool.py list-versions --registry-path /path/to/bazel-central-registry --module rules_go
- •
Upgrade modules in MODULE.bazel
- •
upgradereads the rootMODULE.bazel, followsinclude()files, and updatesbazel_dep(..., version = "...")entries to the latest BCR version. - •Use
--moduleto target a subset and--include-overridesto updatesingle_version_overrideentries. - •Always start with a dry-run, then re-run with
--writewhen the diff looks correct.
Analyze dependency tree
- •
list-depsshows direct deps (names + versions) from all included module files. - •
deps-treefetches MODULE.bazel files from BCR for a best-effort transitive tree (bounded by--max-depth). - •For a fully resolved graph (including overrides/extensions), run Bazel directly:
- •
bazel mod graph
- •
Resources
scripts/
- •
registry.py: upstream BCR registry helper (used for metadata and downloads). - •
bcr_tool.py: CLI wrapper for module search, latest version lookup, upgrades, and dependency inspection.