| Crates.io | lightweight-command-runner |
| lib.rs | lightweight-command-runner |
| version | 0.1.3 |
| created_at | 2025-02-09 03:17:39.39485+00 |
| updated_at | 2025-07-12 22:44:03.395976+00 |
| description | A rust crate providing an asynchronous command runner using tokio, supporting cross-platform execution. |
| homepage | |
| repository | https://github.com/klebs6/klebs-general |
| max_upload_size | |
| id | 1548617 |
| size | 21,900 |
lightweight-command-runner is a Rust crate providing an efficient and asynchronous interface for executing system commands. Built on top of the tokio runtime, it facilitates seamless command execution with minimal resource footprint.
To utilize this crate, implement the CommandRunner trait for your objects or use the provided DefaultCommandRunner struct.
use lightweight_command_runner::{CommandRunner, DefaultCommandRunner};
use tokio::process::Command;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let runner = DefaultCommandRunner;
let command = Command::new("echo").arg("Hello, World!");
let handle = runner.run_command(command);
let output = handle.await??;
println!("Command executed with output: {:?}", output);
Ok(())
}
tokio runtime.This project is licensed under either the MIT license or Apache License 2.0, at your option.
For more details and to contribute, visit the GitHub repository.
For any inquiries, reach out to the author, klebs, at tpk3.mx@gmail.com.