CLI Reference
Quick reference
Section titled “Quick reference”rebaze analyze [PATH] # Detect build systemrebaze migrate [PATH] [OPTIONS] # Generate Bazel filesrebaze validate [PATH] # Verify migrationGlobal options
Section titled “Global options”| Option | Description |
|---|---|
-v, --verbose | Enable verbose output |
--version | Print version |
-h, --help | Print help |
rebaze analyze
Section titled “rebaze analyze”Detect the build system of a project.
rebaze analyze /path/to/projectOutput:
Detected build systems: cmake, gradle| Argument | Default | Description |
|---|---|---|
PATH | . | Project root |
Detectable systems: cmake, gradle, maven, make, cargo
rebaze migrate
Section titled “rebaze migrate”Generate Bazel build files from your existing build system.
rebaze migrate /path/to/projectBasic options
Section titled “Basic options”| Option | Description |
|---|---|
--dry-run | Preview without writing files |
-f, --from <SYSTEM> | Force build system (auto-detected) |
-c, --config <FILE> | Path to rebaze.toml |
--unsafe-mode | Skip validation checks |
CMake options
Section titled “CMake options”| Option | Description |
|---|---|
--cmake-build-dir <DIR> | CMake build directory with file-api data |
--cmake-config <NAME> | Configuration (Debug/Release) |
--cmake-file-api-only | Require file-api (fail if unavailable) |
Generator options
Section titled “Generator options”| Option | Description |
|---|---|
--build-generator <TYPE> | Generator: auto, native, or bazelle |
--bazelle-root <DIR> | Path to bazelle workspace |
--bazelle-bin <PATH> | Path to bazelle binary |
Examples
Section titled “Examples”Basic migration:
rebaze migrate .Preview changes:
rebaze migrate . --dry-runWith custom config:
rebaze migrate . --config custom.tomlCMake with File API (most accurate):
cmake -S . -B buildrebaze migrate . --cmake-build-dir buildSpecific CMake configuration:
rebaze migrate . --cmake-build-dir build --cmake-config ReleaseForce native generator:
rebaze migrate . --build-generator nativerebaze validate
Section titled “rebaze validate”Verify generated Bazel files build successfully.
rebaze validate /path/to/project| Option | Description |
|---|---|
--unsafe-mode | Skip bazel build validation |
Runs bazel build //... and verifies Bazel 9.x is being used.
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
0 | Success |
1 | Error |
Environment variables
Section titled “Environment variables”| Variable | Description |
|---|---|
RUST_LOG | Log level: debug, info, warn, error |
Debug logging:
RUST_LOG=debug rebaze migrate .