Go to file
2025-08-05 16:39:00 +02:00
_archive/service_manager ... 2025-08-05 15:33:03 +02:00
.github/workflows feat: Add CI/CD workflows for testing and publishing SAL crates 2025-07-01 08:34:20 +03:00
aiprompts ... 2025-04-04 15:05:48 +02:00
docs feat: Convert SAL to a Rust monorepo 2025-06-18 14:12:36 +03:00
examples ... 2025-08-05 16:39:00 +02:00
herodo feat: Add CI/CD workflows for testing and publishing SAL crates 2025-07-01 08:34:20 +03:00
installers ... 2025-06-16 07:30:37 +02:00
packages ... 2025-08-05 16:22:25 +02:00
research/zos ... 2025-08-05 15:33:03 +02:00
rhai ... 2025-08-05 16:04:55 +02:00
rhai_tests feat: Update zinit-client dependency to 0.4.0 2025-07-10 11:27:59 +03:00
scripts feat: Update zinit-client dependency to 0.4.0 2025-07-10 11:27:59 +03:00
src ... 2025-08-05 16:04:55 +02:00
.gitignore feat: Enhance service manager with zinit socket discovery and systemd fallback 2025-07-02 16:37:27 +03:00
build_herodo.sh feat: Add herodo package to workspace 2025-06-23 13:19:20 +03:00
cargo_instructions.md ... 2025-08-05 15:43:13 +02:00
Cargo.toml ... 2025-08-05 16:04:55 +02:00
LICENSE Initial commit 2025-04-02 05:08:51 +00:00
PUBLISHING.md feat: Add CI/CD workflows for testing and publishing SAL crates 2025-07-01 08:34:20 +03:00
README.md docs: Improve README.md with clearer structure and installation 2025-07-13 12:51:08 +03:00
run_rhai_tests.sh feat: Migrate SAL to Cargo workspace 2025-06-24 12:39:18 +03:00

SAL (System Abstraction Layer)

Version 0.1.0 - A modular Rust library for cross-platform system operations and automation.

SAL provides a unified interface for system operations with Rhai scripting support through the herodo tool.

Installation

# Core functionality
cargo add sal-os sal-process sal-text sal-net

# Infrastructure
cargo add sal-git sal-vault sal-kubernetes sal-virt

# Database clients
cargo add sal-redisclient sal-postgresclient sal-zinit-client

# Scripting
cargo add sal-rhai

Meta-package with Features

cargo add sal --features core              # os, process, text, net
cargo add sal --features infrastructure    # git, vault, kubernetes, virt
cargo add sal --features all               # everything

Herodo Script Runner

cargo install herodo

Quick Start

Rust Library Usage

use sal_os::fs;
use sal_process::run;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let files = fs::list_files(".")?;
    println!("Found {} files", files.len());

    let result = run::command("echo hello")?;
    println!("Output: {}", result.stdout);
    Ok(())
}

Herodo Scripting

# Create script
cat > example.rhai << 'EOF'
let files = find_files(".", "*.rs");
print("Found " + files.len() + " Rust files");

let result = run("echo 'Hello from SAL!'");
print("Output: " + result.stdout);
EOF

# Run script
herodo example.rhai

Available Packages

Package Description
sal-os Operating system operations
sal-process Process management
sal-text Text processing
sal-net Network operations
sal-git Git repository management
sal-vault Cryptographic operations
sal-kubernetes Kubernetes management
sal-virt Virtualization tools
sal-redisclient Redis client
sal-postgresclient PostgreSQL client
sal-zinit-client Zinit process supervisor
sal-mycelium Mycelium network client
sal-service-manager Service management
sal-rhai Rhai scripting integration
sal Meta-crate with features
herodo Script executor binary

Building & Testing

# Build all packages
cargo build --workspace

# Run tests
cargo test --workspace

# Run Rhai integration tests
./run_rhai_tests.sh

Core Features

  • System Operations: File/directory management, environment access, OS commands
  • Process Management: Create, monitor, and control system processes
  • Containerization: Buildah and nerdctl integration
  • Version Control: Git repository operations
  • Database Clients: Redis and PostgreSQL support
  • Networking: HTTP, TCP, SSH connectivity utilities
  • Cryptography: Key management, encryption, digital signatures
  • Text Processing: String manipulation and templating
  • Scripting: Rhai script execution via herodo

Herodo Scripting

herodo executes Rhai scripts with access to all SAL modules:

herodo script.rhai                # Run single script
herodo script.rhai arg1 arg2      # With arguments
herodo /path/to/scripts/          # Run all .rhai files in directory

Example Script

// File operations
let files = find_files(".", "*.rs");
print("Found " + files.len() + " Rust files");

// Process execution
let result = run("echo 'Hello SAL!'");
print("Output: " + result.stdout);

// Redis operations
redis_set("status", "running");
let status = redis_get("status");
print("Status: " + status);

License

Licensed under the Apache License 2.0. See LICENSE for details.