openrunner

Crates.ioopenrunner
lib.rsopenrunner
version1.0.0
created_at2025-06-08 21:57:10.463565+00
updated_at2025-06-08 21:57:10.463565+00
descriptionA Rust library for running OpenScript
homepagehttps://github.com/openrunner-dev/openrunner-rs
repositoryhttps://github.com/openrunner-dev/openrunner-rs
max_upload_size
id1705294
size67,555
Nik (llamasearchai)

documentation

https://docs.rs/openrunner

README

OpenRunner-RS

Crates.io Docs CI

OpenRunner is a Rust library for running OpenScript scripts from Rust code, with full control over execution, I/O, environment, and process lifecycle.

Features

  • Run OpenScript code from Rust (string or file)
  • Full async support (tokio)
  • Fine-grained control over I/O, env, working directory, timeout, and more
  • Spawn OpenScript processes for long-running jobs
  • Convenience macros for quick scripting
  • Designed to integrate seamlessly with OpenScript and OpenScript-based workflows

Quick Start

Add to your Cargo.toml:

[dependencies]
openrunner = "1.0"

Example:

use openrunner::run;

#[tokio::main]
async fn main() -> openrunner::Result<()> {
    let result = run(r#"echo "Hello from OpenScript!""#, Default::default()).await?;
    println!("Output: {}", result.stdout);
    Ok(())
}

Advanced Usage

See examples/ for more!

API

  • run(script: &str, options: ScriptOptions) -> Result<ExecResult>
  • run_file(path: impl Into<PathBuf>, options: ScriptOptions) -> Result<ExecResult>
  • spawn(script: &str, options: ScriptOptions) -> Result<Child>
  • spawn_file(path: impl Into<PathBuf>, options: ScriptOptions) -> Result<Child>

Macros

  • run_script!
  • spawn_script!
  • run_file_script!

Testing

cargo test

Docker

Run tests in a container:

docker build -t openrunner .
docker run openrunner

License

Dual-licensed MIT or Apache 2.0.

Commit count: 0

cargo fmt