reubeno/brush
{ "createdAt": "2024-05-10T06:17:52Z", "defaultBranch": "main", "description": "🐚bash/POSIX-compatible shell implemented in Rust 🦀", "fullName": "reubeno/brush", "homepage": "https://brush.sh", "language": "Rust", "name": "brush", "pushedAt": "2025-11-27T03:38:06Z", "stargazersCount": 1118, "topics": [ "bash", "posix-shell", "rust", "script", "shell" ], "updatedAt": "2025-11-27T03:38:08Z", "url": "https://github.com/reubeno/brush"}brush (Bo(u)rn(e) RUsty SHell) is a POSIX- and bash-compatible shell,
implemented in Rust. At its core is an embeddable shell interpreter published for reuse
in other Rust projects. 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]!(CONTRIBUTING.md). For more technical details, please consult the [documentation]!(docs/README.md) 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
Section titled “📝 License”Available for use and distribution under the [MIT license]!(LICENSE).
⌨️ Installation
Section titled “⌨️ 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.
🚀 Installing prebuilt binaries from GitHub
We publish prebuilt binaries of brush for Linux (x86_64, aarch64) and macOS (aarch64) to GitHub for official releases. You can manually download and extract the brush binary from one of the archives published there, or otherwise use the GitHub CLI to download it, e.g.:
gh release download --repo reubeno/brush --pattern "brush-x86_64-unknown-linux-gnu.*"After downloading the archive for your platform, you may verify its authenticity using the GitHub CLI, e.g.:
gh attestation verify brush-x86_64-unknown-linux-gnu.tar.gz --repo reubeno/brush🚀 Installing prebuilt binaries via `cargo binstall`
You may use cargo binstall to install pre-built brush binaries. Once you’ve installed cargo-binstall you can run:
cargo binstall brush-shell🔨 Installing from sources
To build from sources, first install a working (and recent) rust toolchain; we recommend installing it via rustup. Then run:
cargo install --locked brush-shell🐧 Installing using Nix
If you are a Nix user, you can use the registered version:
nix run 'github:NixOS/nixpkgs/nixpkgs-unstable#brush' -- --version🐧 Installing on Arch Linux
Arch Linux users can install brush from the official extra repository:
pacman -S brush🍺 Installing using Homebrew
Homebrew users can install using the brush formula:
brew install brush👥 Community
Section titled “👥 Community”brush has a community Discord server, available here.
🔍 Known limitations
Section titled “🔍 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.
If you’re interested, we’d love contributions to improve compatibility, broaden test coverage, or really any other opportunities you can find to help us make this project better.
🧪 Testing strategy
Section titled “🧪 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 [850+ test cases]!(brush-shell/tests/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]!(docs/reference/integration-testing.md).
🙏 Credits
Section titled “🙏 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
Section titled “🔗 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.