Quick Start
This guide will help you get started with Bazelle quickly.
Prerequisites
- Bazel 7.0 or later (Bazelisk recommended)
- A project with source files in supported languages
Quick Start
-
Initialize your project
If you’re starting a new Bazel project or don’t have Gazelle configured yet:
Terminal window bazelle initThis will:
- Detect languages used in your project
- Create
MODULE.bazelwith required dependencies - Create
BUILD.bazelwith gazelle targets
-
Generate BUILD files
Run Bazelle to generate BUILD files for your entire project:
Terminal window bazelle update -
Verify the results
Check that your BUILD files are correct:
Terminal window bazel build //...
Using with Bazel
If you prefer to run Bazelle through Bazel, you can use the gazelle target:
# Build the bazelle binarybazel build //cmd/bazelle
# Run on your projectbazel run //cmd/bazelle -- update /path/to/your/project# If you have a gazelle target in your BUILD filebazel run //:gazelleExample Workflow
Here’s a typical development workflow with Bazelle:
# Initial setupbazelle initbazelle update
# During development - use watch modebazelle watch
# In CI - verify BUILD files are up to datebazelle update --checkNext Steps
- Learn about Installation options
- Explore Configuration options
- See CLI Reference for all commands