Skip to content

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

  1. Initialize your project

    If you’re starting a new Bazel project or don’t have Gazelle configured yet:

    Terminal window
    bazelle init

    This will:

    • Detect languages used in your project
    • Create MODULE.bazel with required dependencies
    • Create BUILD.bazel with gazelle targets
  2. Generate BUILD files

    Run Bazelle to generate BUILD files for your entire project:

    Terminal window
    bazelle update
  3. 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:

Terminal window
# Build the bazelle binary
bazel build //cmd/bazelle
# Run on your project
bazel run //cmd/bazelle -- update /path/to/your/project

Example Workflow

Here’s a typical development workflow with Bazelle:

Terminal window
# Initial setup
bazelle init
bazelle update
# During development - use watch mode
bazelle watch
# In CI - verify BUILD files are up to date
bazelle update --check

Next Steps