// the find
matklad/xshell
xshell is a Rust library for writing shell-script-like code in Rust — running commands, reading files, manipulating the working directory — all cross-platform. It's for Rust projects that need build scripts, CI helpers, or xtask binaries and don't want to shell out to bash or pull in a heavy scripting runtime.
The `cmd!` macro interpolates Rust variables directly into command strings with compile-time checking, so you can't accidentally inject a string with spaces that splits into multiple arguments — a real footgun in naïve shell scripting. The `Shell` context object makes cwd explicit and scoped, which kills the 'which directory am I in?' bug class that plagues bash scripts. Cross-platform by design: path handling, env vars, and process spawning all go through Rust's stdlib rather than assuming POSIX. From matklad (the rust-analyzer guy), so the API design is thoughtful and the macro implementation is clean.
830 stars and 39 forks is pretty modest for something this fundamental — the ecosystem hasn't really converged on it, and dax (a Deno-based alternative, linked in the README itself) has pulled some of the mindshare. No piping between commands: you can't do `cmd!(sh, "grep foo") | cmd!(sh, "wc -l")` in a composable way, which is the whole point of shell pipelines. The library is small by design, but that means no process supervision, no parallel execution primitives, and no structured output parsing — anything beyond basic scripting needs you to reach for something else. Changelog shows the last meaningful change was 2023; the 2024 commit is probably a minor fix, so it's stable but not actively growing.