No description
Find a file
despiegk 672eecb198
All checks were successful
Build / build (linux-amd64, false, x86_64-unknown-linux-gnu) (push) Successful in 4m35s
Build / build (darwin-amd64, true, x86_64-apple-darwin, true) (push) Successful in 4m50s
Build / build (darwin-arm64, true, aarch64-apple-darwin, true) (push) Successful in 4m56s
Build / build (linux-arm64, true, aarch64-linux-gnu-gcc, aarch64-unknown-linux-gnu) (push) Successful in 5m2s
...
2025-12-15 08:10:56 +01:00
.claude ... 2025-12-14 13:16:32 +01:00
.forgejo/workflows ... 2025-12-15 07:51:58 +01:00
_archive ... 2025-12-14 14:31:22 +01:00
aiprompts ... 2025-12-15 04:32:41 +01:00
config init 2025-12-08 08:46:44 +01:00
docs Update kubernetes, buildah, and hetzner modules 2025-12-09 05:41:27 +01:00
examples ... 2025-12-15 04:32:41 +01:00
examples_rust/ai init 2025-12-08 08:46:44 +01:00
herodo ... 2025-12-14 14:31:22 +01:00
installers ... 2025-12-08 14:37:59 +01:00
packages ... 2025-12-15 06:04:41 +01:00
patches ... 2025-12-15 08:01:20 +01:00
research/zos init 2025-12-08 08:46:44 +01:00
rhai ... 2025-12-14 15:42:25 +01:00
rhai_tests ... 2025-12-09 06:07:21 +01:00
rhailib ... 2025-12-14 14:31:22 +01:00
scripts ... 2025-12-15 08:10:56 +01:00
src ... 2025-12-14 15:32:39 +01:00
.gitignore init 2025-12-08 08:46:44 +01:00
build_herodo.sh init 2025-12-08 08:46:44 +01:00
Cargo.toml ... 2025-12-15 08:01:16 +01:00
CLAUDE.md init 2025-12-08 08:46:44 +01:00
LICENSE init 2025-12-08 08:46:44 +01:00
publish_all.sh .. 2025-12-14 14:37:01 +01:00
publish_batches.sh ... 2025-12-14 13:16:32 +01:00
PUBLISHING.md init 2025-12-08 08:46:44 +01:00
README.md ... 2025-12-15 05:20:58 +01:00
run_rhai_tests.sh init 2025-12-08 08:46:44 +01:00

Herocode Herolib Rust Repository

Quick Install

Install herodo with a single command:

curl -sL https://forge.ourworld.tf/geomind_research/herolib_rust/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"

Verify installation:

herodo --help

Overview

This repository contains the Herocode Herolib Rust library and a collection of scripts, examples, and utilities for building, testing, and publishing the SAL (System Abstraction Layer) crates. The repository includes:

  • Rust crates for various system components (e.g., os, process, text, git, vault, kubernetes, etc.).
  • Rhai scripts and test suites for each crate.
  • Utility scripts to automate common development tasks.

Scripts

The repository provides three primary helper scripts located in the repository root:

Script Description Typical Usage
scripts/publish-all.sh Publishes all SAL crates to crates.io in the correct dependency order. Handles version bumping, dependency updates, dryrun mode, and ratelimiting. ./scripts/publish-all.sh [--dry-run] [--wait <seconds>] [--version <ver>]
build_herodo.sh Builds the herodo binary from the herodo package and optionally runs a specified Rhai script. ./build_herodo.sh [script_name]
run_rhai_tests.sh Executes all Rhai test suites across the repository, logging results and providing a summary. ./run_rhai_tests.sh

Below are detailed usage instructions for each script.


1. scripts/publish-all.sh

Purpose

  • Publishes each SAL crate in the correct dependency order.
  • Updates crate versions (if --version is supplied).
  • Updates path dependencies to version dependencies before publishing.
  • Supports dryrun mode to preview actions without publishing.
  • Handles ratelimiting between crate publishes.

Options

Option Description
--dry-run Shows what would be published without actually publishing.
--wait <seconds> Wait time between publishes (default: 15s).
--version <ver> Set a new version for all crates (updates Cargo.toml files).
-h, --help Show help message.

Example Usage

# Dry run  no crates will be published
./scripts/publish-all.sh --dry-run

# Publish with a custom wait time and version bump
./scripts/publish-all.sh --wait 30 --version 1.2.3

# Normal publish (no dryrun)
./scripts/publish-all.sh

Notes

  • Must be run from the repository root (where Cargo.toml lives).
  • Requires cargo and a loggedin cargo session (cargo login).
  • The script automatically updates dependencies in each crates Cargo.toml to use the new version before publishing.

2. build_herodo.sh

Purpose

  • Builds the herodo binary from the herodo package.
  • Copies the binary to a systemwide location (/usr/local/bin) if run as root, otherwise to ~/hero/bin.
  • Optionally runs a specified Rhai script after building.

Usage

# Build only
./build_herodo.sh

# Build and run a specific Rhai script (e.g., `example`):
./build_herodo.sh example

Details

  • The script changes to its own directory, builds the herodo crate (cargo build), and copies the binary.
  • If a script name is provided, it looks for the script in:
    • src/rhaiexamples/<name>.rhai
    • src/herodo/scripts/<name>.rhai
  • If the script is not found, the script exits with an error.

3. run_rhai_tests.sh

Purpose

  • Runs all Rhai test suites across the repository.
  • Supports both the legacy rhai_tests directory and the newer */tests/rhai layout.
  • Logs output to run_rhai_tests.log and prints a summary.

Usage

# Run all tests
./run_rhai_tests.sh

Output

  • Colored console output for readability.
  • Log file (run_rhai_tests.log) contains full output for later review.
  • Summary includes total modules, passed, and failed counts.
  • Exit code 0 if all tests pass, 1 otherwise.

General Development Workflow

  1. Build: Use build_herodo.sh to compile the herodo binary.
  2. Test: Run run_rhai_tests.sh to ensure all Rhai scripts pass.
  3. Publish: When ready to release, use scripts/publish-all.sh (with --dry-run first to verify).

Prerequisites

  • Rust toolchain (cargo, rustc) installed.
  • Rhai interpreter (herodo) built and available.
  • Git for version control.
  • Cargo login for publishing to crates.io.

License

See LICENSE for details.


Happy coding!