- Update README.md to provide a clearer structure and improved installation instructions. This makes it easier for users to understand and use the library. - Remove outdated and unnecessary sections like the workspace structure details, publishing status, and detailed features lists. The information is either not relevant anymore or can be found elsewhere. - Simplify installation instructions to focus on the core aspects of installing individual packages or the meta-package with features. - Add a dedicated section for building and running tests, improving developer experience and making the process more transparent. - Modernize the overall layout and formatting for better readability. |
||
---|---|---|
.github/workflows | ||
aiprompts | ||
docs | ||
examples | ||
git | ||
herodo | ||
installers | ||
kubernetes | ||
mycelium | ||
net | ||
os | ||
postgresclient | ||
process | ||
redisclient | ||
rhai | ||
rhai_tests | ||
scripts | ||
service_manager | ||
src | ||
text | ||
vault | ||
virt | ||
zinit_client | ||
.gitignore | ||
build_herodo.sh | ||
Cargo.toml | ||
LICENSE | ||
PUBLISHING.md | ||
README.md | ||
run_rhai_tests.sh |
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
Individual Packages (Recommended)
# 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.