一键导入
radius-build-cli
// Build the Radius CLI (rad) binary from source. Use when compiling rad, cross-compiling for another platform, creating a debug build, or verifying the CLI builds correctly after code changes.
// Build the Radius CLI (rad) binary from source. Use when compiling rad, cross-compiling for another platform, creating a debug build, or verifying the CLI builds correctly after code changes.
Perform an automated code review for a GitHub pull request in the Radius repository. Produces a PR analysis document, a PR review document, and a shell script that posts the review comments via the GitHub API. Use when asked to review a PR, generate review feedback for a PR, or create a script that posts PR review comments.
Build Radius container images from source for local development and testing. Push to any container registry that your Kubernetes cluster can pull from.
Install Radius on a Kubernetes cluster from custom-built container images. Works with any cluster and any registry the cluster can pull from.
Update, create, review, and find gaps in contributor documentation including CONTRIBUTING.md, docs/contributing/, and docs/architecture/. Use when a task affects contributor setup, build, test, debug, review, or architecture guidance, or when a code review needs a documentation impact assessment.
Document application architectures with Mermaid diagrams. Use for: generating architecture overviews, component diagrams, sequence diagrams from code, explaining complex Go codebases, answering architecture questions, suggesting architectural improvements, producing entity-relationship diagrams, and distilling code into human-readable descriptions.
| name | radius-build-cli |
| description | Build the Radius CLI (rad) binary from source. Use when compiling rad, cross-compiling for another platform, creating a debug build, or verifying the CLI builds correctly after code changes. |
| argument-hint | Optional: build variant (e.g. debug, linux-amd64) — or leave blank for default release build |
Build the rad CLI binary from source using the project's Makefile build system.
The Radius CLI (rad) is a Go binary located at cmd/rad/main.go. The build system uses GNU Make with
build configuration split across files in the build/ directory. The primary build targets are defined
in build/build.mk and version information is injected via linker flags defined in build/version.mk.
Binaries are written to ./dist/<GOOS>_<GOARCH>/<buildtype>/rad where:
<GOOS> is the target operating system (e.g., darwin, linux, windows)<GOARCH> is the target architecture (e.g., amd64, arm64)<buildtype> is release (default) or debug (when DEBUG=1)Confirm the following tools are available before building:
go version to verify Go is installed. The required version is specified in go.mod.make --version to verify GNU Make is available.git rev-parse --is-inside-work-tree to confirm we are in a Git repository (needed for version injection).If any prerequisite is missing, stop and report clearly which tool needs to be installed.
Determine the build target platform:
go env GOOS to detect the current OS.go env GOARCH to detect the current architecture.Report the detected platform to the user (e.g., darwin/arm64).
Build the rad binary using the Makefile:
make build-rad
This compiles only the rad CLI binary for the current OS and architecture. Version metadata
(commit SHA, Git version, release channel, chart version) is injected automatically via -ldflags.
Build variants:
| Command | Description |
|---|---|
make build-rad | Build rad for the current platform (release mode) |
DEBUG=1 make build-rad | Build rad with debug symbols (-gcflags "all=-N -l") |
make build-rad-<os>-<arch> | Cross-compile for a specific platform (e.g., make build-rad-linux-amd64) |
make build | Build all binaries, packages, and Bicep tooling |
Use make build-rad unless the user explicitly requests a different target, debug build, or cross-compilation.
After the build completes successfully:
Confirm the binary exists at the expected output path:
ls -lh ./dist/$(go env GOOS)_$(go env GOARCH)/release/rad
If DEBUG=1 was used, check ./dist/$(go env GOOS)_$(go env GOARCH)/debug/rad instead.
Run the built binary to verify it executes:
./dist/$(go env GOOS)_$(go env GOARCH)/release/rad version
Report the build results:
rad version outputSummarize the build:
Build complete!
Binary: ./dist/<os>_<arch>/<buildtype>/rad
Version: <version output>
| Goal | Command |
|---|---|
| Build rad (current platform) | make build-rad |
| Debug build | DEBUG=1 make build-rad |
| Cross-compile | make build-rad-<os>-<arch> |
| Build everything | make build |