Dependency Management
Add, remove, update, and search for Bazel modules. Check for outdated dependencies and update them with a single command.
bz is a CLI tool for managing Bazel modules (Bzlmod). It helps you manage MODULE.bazel dependencies, query the Bazel Central Registry, analyze your dependency graph, and ensure security compliance.
# Quick startbz init --name=my_project # Initialize modulebz mod add rules_go@0.50.1 # Add dependenciesbz mod list # List dependenciesbz mod graph # Visualize dependency treebz audit # Scan for vulnerabilitiesDependency Management
Add, remove, update, and search for Bazel modules. Check for outdated dependencies and update them with a single command.
Dependency Analysis
Visualize your dependency graph in ASCII, DOT, Mermaid, or JSON. Understand why modules are included with bz mod why.
Security & Compliance
Scan for vulnerabilities with OSV integration. Check license compliance. Generate SPDX and CycloneDX SBOMs.
Air-gap Support
Full offline mode with local cache. Download dependencies for air-gapped environments. Verify cache completeness.
Registry Sync
Mirror modules from BCR to internal registries. Starlark-based configuration for complex sync workflows.
Developer Experience
Shell completions, JSON output for scripting, environment diagnostics with bz doctor, colored output.
bz mod add rules_go@0.50.1 rules_python@0.35.0bz mod rm rules_gobz mod updatebz mod outdatedbz mod graph # ASCII treebz mod graph --format=dot | dot -Tpng -o deps.pngbz mod stats # Dependency statisticsbz mod why protobuf # Why is protobuf included?bz audit # Vulnerability scanbz audit --severity=high # Only high/criticalbz mod licenses # List all licensesbz mod licenses --check --deny=GPL-3.0bz sbom --format=cyclonedx # Generate SBOMbz cache download # Download dependenciesbz cache verify # Verify cachebz mod list --offline # Use cache only| Command | Description |
|---|---|
bz init | Initialize a new MODULE.bazel |
bz mod add | Add dependencies |
bz mod rm | Remove dependencies |
bz mod list | List dependencies |
bz mod info | Show module information |
bz mod update | Update dependencies |
bz mod outdated | Check for updates |
bz mod search | Search registry |
bz mod graph | Dependency graph |
bz mod stats | Dependency statistics |
bz mod why | Explain dependency path |
bz mod licenses | License information |
bz mod sync | Sync registries |
bz audit | Vulnerability scan |
bz sbom | Generate SBOM |
bz cache download | Download to cache |
bz cache verify | Verify cache |
bz cache stats | Cache statistics |
bz cache clear | Clear cache |
bz doctor | Environment diagnostics |
bz registry ping | Test connectivity |
bz completion | Shell completions |
bz version | Version info |
Air-gapped Setup
Use bz in environments without internet access. Download dependencies, transfer them, and work offline.
Security Pipeline
Integrate vulnerability scanning and license compliance into your CI/CD pipeline.
Mirror BCR
Create a local mirror of Bazel Central Registry for faster builds and reliability.