beOS Pro CLI
This directory contains the code for beos-cli, the command-line interface for administering a beOS Pro installation. It provides a modular, pipeline-based architecture for orchestrating complex system operations.
Key responsibilities include:
- Cluster management: Installing, upgrading, restarting, and maintaining a beOS Pro cluster.
- Node management: Adding to or removing nodes from a beOS Pro cluster.
Execution Model
For most commands, beos-cli is executed through a four-tier hierarchy:
Pipeline ➜ Module ➜ Task ➜ Action
Example: install pipeline
Pipeline: Install beOS Pro
├── ...other modules
└── Module: Bootstrap OS
├── ...other tasks
├── Task: Check Prerequisites
│ └── Action: run-precheck.sh
└── Task: Configure System
└── Action: apply-sysctl
Repository layout
cli/
├── cmd/ # Cobra command definitions
│ ├── main.go # CLI entry point
│ └── ctl/
│ ├── root.go
│ ├── os/ # OS-level maintenance commands
│ ├── node/ # Cluster node operations
│ └── gpu/ # GPU management
└── pkg/
├── core/
│ ├── action/ # Re-usable action primitives
│ ├── module/ # Module abstractions
│ ├── pipeline/ # Pipeline abstractions
│ └── task/ # Task abstractions
└── pipelines/ # Pre-built pipelines
│ ├── ... # actual modules and tasks for various commands and components
Build from source
Prerequisites
- Go 1.24+
- GoReleaser (optional, for cross-compiling and packaging)
Sample commands
# Clone the repo and enter the CLI folder
cd cli
# 1) Build for the host OS/ARCH
go build -o beos-cli ./cmd/main.go
# 2) Cross-compile for Linux amd64 (from macOS, for example)
GOOS=linux GOARCH=amd64 go build -o beos-cli ./cmd/main.go
# 3) Produce multi-platform artifacts (tar.gz, checksums, etc.)
goreleaser release --snapshot --clean
Development workflow
Add a new command
- Create the command file in
cmd/ctl/<category>/. - Define a pipeline in
pkg/pipelines/. - Implement modules & tasks inside the relevant
pkg/sub-packages.
Test your build
- Upload the self-built
beos-clibinary to a machine that's running beOS Pro. - Replace the existing CLI binary on the machine using
sudo cp -f beos-cli /usr/local/bin. - Execute arbitrary commands using
beos-cli