Skip to content

CLI Reference

Terminal window
rebaze analyze [PATH] # Detect build system
rebaze migrate [PATH] [OPTIONS] # Generate Bazel files
rebaze validate [PATH] # Verify migration
OptionDescription
-v, --verboseEnable verbose output
--versionPrint version
-h, --helpPrint help

Detect the build system of a project.

Terminal window
rebaze analyze /path/to/project

Output:

Detected build systems: cmake, gradle
ArgumentDefaultDescription
PATH.Project root

Detectable systems: cmake, gradle, maven, make, cargo


Generate Bazel build files from your existing build system.

Terminal window
rebaze migrate /path/to/project
OptionDescription
--dry-runPreview without writing files
-f, --from <SYSTEM>Force build system (auto-detected)
-c, --config <FILE>Path to rebaze.toml
--unsafe-modeSkip validation checks
OptionDescription
--cmake-build-dir <DIR>CMake build directory with file-api data
--cmake-config <NAME>Configuration (Debug/Release)
--cmake-file-api-onlyRequire file-api (fail if unavailable)
OptionDescription
--build-generator <TYPE>Generator: auto, native, or bazelle
--bazelle-root <DIR>Path to bazelle workspace
--bazelle-bin <PATH>Path to bazelle binary

Basic migration:

Terminal window
rebaze migrate .

Preview changes:

Terminal window
rebaze migrate . --dry-run

With custom config:

Terminal window
rebaze migrate . --config custom.toml

CMake with File API (most accurate):

Terminal window
cmake -S . -B build
rebaze migrate . --cmake-build-dir build

Specific CMake configuration:

Terminal window
rebaze migrate . --cmake-build-dir build --cmake-config Release

Force native generator:

Terminal window
rebaze migrate . --build-generator native

Verify generated Bazel files build successfully.

Terminal window
rebaze validate /path/to/project
OptionDescription
--unsafe-modeSkip bazel build validation

Runs bazel build //... and verifies Bazel 9.x is being used.


CodeMeaning
0Success
1Error
VariableDescription
RUST_LOGLog level: debug, info, warn, error

Debug logging:

Terminal window
RUST_LOG=debug rebaze migrate .