brush (Bo(u)rn(e) RUsty SHell) is a POSIX- and bash-compatible shell,
implemented in Rust. It's built and tested on Linux, macOS, and WSL. Native Windows support is experimental.
brush is functional for interactive use as a daily driver! It executes most sh and bash scripts we've
encountered. Known limitations are tracked with filed issues. Out of an abundance of caution,
we wouldn't recommend using it yet in production scenarios in case it doesn't behave identically
to your existing stable shell. (If you do find any behavioral differences, though, please report them with an
issue!)
Contributions and feedback of all kinds are welcome! For more guidance, please consult our contribution guidelines. For more technical details, please consult the documentation in this repo.
This project was originally borne out of curiosity and a desire to learn. We're doing our best to keep that attitude :).
๐ License
Available for use and distribution under the MIT license.
โจ๏ธ Installation
When you run brush, it should look exactly as bash does on your system: it processes your .bashrc and
other standard configuration. If you'd like to distinguish the look of brush from the other shells
on your system, you may author a ~/.brushrc file.
๐จ Building from sources
We don't (yet) publish binary releases of brush (but will Real Soon Now). To build from sources, first install a working rust toolchain; we recommend installing it via rustup. Then run:
๐ง Nix
If you are a Nix user, you can also use the registered version.
๐ง Arch Linux
Arch Linux users can install brush from the AUR with their AUR helper of choice, e.g.
๐ฅ Community
brush has a community Discord server, available here.
๐ Known limitations
There are some known gaps in compatibility. Most notably:
-
Some
setandshoptoptions. Thesetbuiltin is implemented, as isset -xand many frequently usedset/shoptoptions, but a number aren't fully implemented. For example,set -ewill execute but its semantics aren't applied across execution. -
The
historybuiltin and support for programmatically manipulating command history. This is something we're actively working on, with promises for supporting shell extensions like atuin.
If you feel so inclined, we'd love contributions toward any of the above, with broadening test coverage, deeper compatibility evaluation, or really any other opportunities you can find to help us make this project better.
๐งช Testing strategy
This project is primarily tested by comparing its behavior with other existing shells, leveraging the latter as test oracles. The integration tests implemented in this repo include 675+ test cases run on both this shell and an oracle, comparing standard output and exit codes.
For more details, please consult the reference documentation on integration testing.
๐ Credits
There's a long list of OSS crates whose shoulders this project rests on. Notably, the following crates are directly relied on for major portions of shell functionality:
reedline- for readline-like input and interactive usageclap- command-line parsing, used both by the top-level brush CLI as well as built-in commandsfancy-regex- relied on for everything regextokio- async, well, everythingnixrust crate - higher-level APIs for Unix/POSIX system APIs
For testing, performance benchmarking, and other important engineering support, we use and love:
pprof-rs- for sampling-based CPU profilingcriterion.rs- for statistics-based benchmarkingbash-completion- for its completion test suite and general completion support!
๐ Links: other shell implementations
There are a number of other POSIX-ish shells implemented in a non-C/C++ implementation language. Some inspirational examples include:
nushell- modern Rust-implemented shell (which also provides thereedlinecrate we use!)rusty_bashmvdan/shOilsfish(as of 4.0)
We're sure there are plenty more; we're happy to include links to them as well.