A Rust library for running child processes with shell-like pipelines and robust error handling.
Duct is a Rust library for running child processes, enabling developers to build command pipelines and redirect IO with a shell-like API. It solves the problem of platform inconsistencies and error handling in process execution, providing a robust and portable alternative to manual process spawning.
Rust developers who need to execute external commands, build pipelines, or manage child processes in system tools, build scripts, or automation tasks.
Developers choose Duct for its combination of shell-like convenience and Rust's safety guarantees, with built-in handling of common pitfalls and cross-platform inconsistencies that typically require manual workarounds.
a Rust library for running child processes
Enables building command pipelines with a shell-like fluent syntax, as shown in examples like cmd!("echo", "hi").pipe(cmd!("sed", "s/i/o/")), simplifying complex process chains.
Defaults to treating non-zero exit codes as errors, promoting correct error reporting, with overrides available via .unchecked(), as demonstrated in the false command example.
Handles OS-specific inconsistencies transparently, addressing common gotchas and bugs across platforms, ensuring portable code without manual workarounds.
Passes arguments directly without shell interpretation, eliminating whitespace-related bugs and injection vulnerabilities, a core feature highlighted in the philosophy.
Supports merging stderr into stdout, incremental output reading via .reader(), and other IO controls, as illustrated in the BufReader example for streaming output.
The API is primarily synchronous, blocking threads during process execution, which can hinder integration with async Rust runtimes and require additional complexity for non-blocking operations.
Adds an external library dependency, increasing project size and complexity for tasks that could be handled by Rust's lighter-weight standard process utilities.
Lacks built-in asynchronous features, forcing developers to implement custom threading or rely on external crates for async process management, a gap not addressed in the README.
A Rust crate for cooking up terminal user interfaces (TUIs) 👨🍳🐀 https://ratatui.rs
A full featured, fast Command Line Argument Parser for Rust
A command line progress reporting library for Rust
A Text User Interface library for the Rust programming language
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.