oconnor663/duct.rs
oconnor663/duct.rs has 1,048 GitHub stars and 45 forks. GitHot measured +1 in 7 days. Last checked 2026-11-11 02:08 UTC. Last push 2026-09-20.
a Rust library for running child processes
Measured star growth
- in 24h
- Update delayed
- in 7 days
- +1
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Originalduct.rs

Duct is a library for running child processes. Duct makes it easy to build pipelines and redirect IO like a shell. At the same time, Duct helps you write correct, portable code: whitespace is never significant, errors from child processes get reported by default, and a variety of gotchas, bugs, and platform inconsistencies are handled for you the Right Way™.
Examples
Run a command without capturing any output. Here "hi" is printed directly to the terminal:
use duct::cmd;
cmd!("echo", "hi").run()?;
Capture the standard output of a command. Here "hi" is returned as a
String:
let stdout = cmd!("echo", "hi").read()?;
assert_eq!(stdout, "hi");
Capture the standard output of a pipeline:
let stdout = cmd!("echo", "hi").pipe(cmd!("sed", "s/i/o/")).read()?;
assert_eq!(stdout, "ho");
Merge standard error into standard output and read both incrementally:
use duct::cmd;
use std::io::prelude::*;
use std::io::BufReader;
let big_cmd = cmd!("bash", "-c", "echo out && echo err 1>&2");
let reader = big_cmd.stderr_to_stdout().reader()?;
let mut lines = BufReader::new(reader).lines();
assert_eq!(lines.next().unwrap()?, "out");
assert_eq!(lines.next().unwrap()?, "err");
Children that exit with a non-zero status return an error by default:
let result = cmd!("false").run();
assert!(result.is_err());
let result = cmd!("false").unchecked().run();
assert!(result.is_ok());
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
561,641 starspublic-apis/public-apis
A collective list of free APIs
498,007 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
450,446 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,311 stars