No description
Find a file
2026-01-29 20:07:50 +00:00
.claude feat: enhance RPC generator with domain references and CRUD detection 2026-01-13 06:41:26 +01:00
.forgejo/workflows initial workflow with services (#69) 2026-01-29 16:07:30 +00:00
.vscode temp 2025-12-30 03:56:51 +01:00
aiprompts refactor: update hetzner, postgres, and hero_embedder clients with improved Rhai bindings 2026-01-25 12:39:22 +01:00
docs docs: adding a cross-reference to docs/onboarding.md in the "Creating New SAL Packages" section 2026-01-26 18:31:20 +02:00
installers clean up build_package.sh 2026-01-21 15:26:08 +02:00
packages chore: update herolib_otoml git URL to new forge location 2026-01-29 14:56:24 -05:00
patches working nicely 2025-12-18 08:30:11 +01:00
research/zos working nicely 2025-12-18 08:30:11 +01:00
scripts clean up build_package.sh 2026-01-21 15:26:08 +02:00
.gitignore no more workspace 2025-12-18 08:17:58 +01:00
.test Test 2026-01-02 09:58:52 +01:00
Cargo.toml chore: update repository references to new forge location 2026-01-28 08:28:20 +01:00
ci-containers.conf initial workflow with services (#69) 2026-01-29 16:07:30 +00:00
ci_rhai.sh initial workflow with services (#69) 2026-01-29 16:07:30 +00:00
ci_rust.sh initial workflow with services (#69) 2026-01-29 16:07:30 +00:00
CLAUDE.md logging implemented 2025-12-17 20:27:53 +01:00
LICENSE init 2025-12-08 08:46:44 +01:00
Makefile refactor: update hetzner, postgres, and hero_embedder clients with improved Rhai bindings 2026-01-25 12:39:22 +01:00
network_topology.md adjust mycelium topology 2026-01-21 17:57:04 +02:00
README.md chore: update repository references to new forge location 2026-01-28 08:28:20 +01:00
test_mycelium.rhai adjust mycelium topology 2026-01-21 17:57:04 +02:00

Herocode Herolib Rust

A comprehensive System Abstraction Layer (SAL) and automation framework built in Rust, featuring a powerful Rhai-based scripting engine.

Quick Install

Install herodo (the Rhai runner) with a single command:

curl -sL https://forge.ourworld.tf/lhumina_code/hero_lib/raw/branch/main/scripts/install.sh | bash

This will:

  • Detect your platform (Linux/macOS, amd64/arm64)
  • Download the appropriate binary
  • Install to ~/hero/bin/
  • Add the path to your ~/.profile

After installation, start a new terminal or run:

export PATH="$HOME/hero/bin:$PATH"

Project Overview

Herolib provides a unified interface for system operations across different platforms. It is designed to be used both as a Rust library and as a scriptable automation tool via Rhai.

Key Packages

Package Description
os Core system operations: Filesystem, Git, Network, Process management, and System Profiling.
mos Multi-OS Service layer: Network namespaces, VETH setup, Dashboard UI, and System Facts.
virt Virtualization and Containerization: CloudHypervisor integration and Buildah/Nerdctl wrappers.
clients Integrated API clients for Redis, Postgres, MQTT, VastAI, Hetzner, Mycelium, and more.
crypt Cryptographic primitives, HTTP signatures, and key management (Ed25519, Symmetric).
vault Secure key and address management for various cryptographic applications.
core Common utilities, HeroScript DSL, Text processing, and Logger.
ai AI integration for chat, embeddings, and transcription.

Development & CI

The project uses a multi-stage CI pipeline to ensure both Rust code and Rhai scripts are fully functional.

Build & Management

The project uses a centralized Makefile for all common tasks.

Command Description
make build PKG=<name> Build a specific package (e.g., make build PKG=core)
make install PKG=<name> Build and install a package binary to ~/hero/bin/
make run PKG=<name> Build and run a package binary (e.g., make run PKG=mos)
make docs PKG=<name> Generate documentation for a specific package
make build-all Build all packages in the workspace
make install-all Install all available binaries
make docs-all Generate documentation for all packages
make herodo Specialized target to build the herodo shell
make test Run full CI (Rust tests + Rhai scripts)
make test-rust Run Rust unit and integration tests
make test-rhai Run Rhai script tests
make clean Clean all build artifacts

CI Scripts

Script Description
ci.sh Main CI Entry Point: Runs all Rust unit tests and triggers the Rhai CI runner.
ci_rhai.sh Rhai Test Runner: Executes all valid Rhai scripts in the repository with exclusion management and reporting.

Test Tracking

We maintain a real-time status of all Rhai scripts in RHAI_TRACKING.md. This file tracks which scripts are CI-ready, which are intentionally skipped, and their current execution status.

Automation with Rhai

Herolib exposes most of its functionality to the Rhai scripting language. This allows you to write powerful system automation scripts without recompiling Rust code.

Example: Checking Package Installation

if !package_is_installed("git") {
    print("Installing git...");
    package_install("git");
} else {
    print("Git is already installed.");
}

Running Scripts

Use the herodo command to run any Rhai script:

herodo path/to/script.rhai

Prerequisites

  • Rust toolchain (latest stable)
  • Git
  • Cargo login (only for maintainers publishing to crates.io)

License

See LICENSE for details.


Happy coding!