This document is for contributors and maintainers of the Runbeam CLI.
- Rust toolchain (stable) via rustup
- Make for packaging tasks
- Optional cross-compilation tools for Linux musl or cargo-zigbuild
Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup updatecargo build # Debug build
cargo build --release # Release build (optimized)
cargo run -- --help # Show helpExample commands:
cargo run -- list
cargo run -- harmony:add -i 127.0.0.1 -p 8081 -x admin -l dev
cargo run -- harmony:list
cargo run -- harmony:info -l devcargo install --path .
runbeam --helpcargo fmt # Format code
cargo clippy -- -D warnings # Lint with warnings as errors- No tests exist yet
- The
/samplesdirectory is intended for future test files when a test suite is added
Makefile targets:
make build # Debug build
make release # Release build
make package-macos # Package for macOS (current arch) → ./tmp/runbeam-macos-<arch>-v<version>.tar.gz
make package-linux # Package for Linux x86_64 musl → ./tmp/runbeam-linux-x86_64-v<version>.tar.gz
make package-windows # Package for Windows x86_64 → ./tmp/runbeam-windows-x86_64-v<version>.zip
make clean-artifacts # Remove ./tmp directoryOutputs:
- All artifacts and archives are written to
./tmp/ - SHA-256 checksums are generated alongside archives as
.sha256files
Cross-compilation:
- Linux packaging uses static musl builds (
x86_64-unknown-linux-musl) or cargo-zigbuild - Ensure the appropriate toolchain is installed for musl or configure cargo-zigbuild
- On macOS, you can optionally install
zigandcargo-zigbuildfor easier cross-compiles
- Git tags matching
v*pattern trigger the release workflow (e.g.,v0.1.0) - GitHub Actions builds for Linux (musl), macOS (aarch64), Windows (msvc)
- Built artifacts are uploaded to the GitHub Release along with checksums
Tag and push to publish release artifacts:
git tag v0.1.0
git push origin v0.1.0- Structured logging via
tracingandtracing-subscriber - Global flags control verbosity:
-v/-vv/-vvvand-q - You can override with
RUST_LOGenvironment variable
Examples:
RUST_LOG=debug cargo run -- list
cargo run -- -v harmony:add -i 127.0.0.1 -p 8081
cargo run -- -q harmony:list- Binary name is
runbeamas configured in Cargo.toml - Use
./tmp/for temporary files and packaging artifacts (not system/tmp) - Schema directory locations are configurable and can point to custom paths
- Encryption (when implemented): AES-256-GCM with ephemeral public key, IV and auth tag base64-encoded
- The
/samplesdirectory exists for future tests - CLI stores data in user-specific directory:
~/.runbeam/on Linux/macOS, equivalent on Windows
For quick developer commands, architecture notes, and detailed build instructions, see WARP.md in this repository.
main.rs: Initializes structured logging, parses CLI via clap, dispatches to command handlers- Global flags:
-v/--verbose(repeatable) and-q/--quietcontrol logging levels
- Commands are organized under
src/commands/as modules - Current structure:
src/commands/basic.rs: Containslistcommandsrc/commands/harmony/: Contains harmony-related commands
- Command dispatch happens in
main.rsmatching clap subcommands to handler functions
- Create module in
src/commands/and declare insrc/commands/mod.rs - Add clap
Subcommandvariant insrc/cli.rs - Add dispatch logic in
main.rsmatch statement
- Make changes to code
- Test locally:
cargo run -- --helpand test commands - Format and lint:
cargo fmt && cargo clippy -- -D warnings - Test packaging if needed:
make clean-artifacts && make package-macos - Commit and push changes
- For releases, tag and push to trigger CI build