# rustybox (v0.4.0)

> A free-range, non-GMO fork of BusyBox written entirely in Rust. One
> fully-static binary, dual-arch (x86_64 + aarch64), memory-safe applets on
> uutils, ripgrep, walkdir, RustCrypto, tar, flate2, bzip2, and xz2.
> Official userland for kernel8 (8b-is/kernel8), vakedkernel 🜂, and Entheai (entropy-om/entheai).
> Dual editions: Full GPL-2.0 (`rustybox`, 399 applets) & 100% MIT (`rustybox-core`, 93 memory-safe applets on Linux / 91 on macOS).

## Agent Search Endpoint

- Endpoint: `https://rustybox.io/.well-known/search`
- Methods: RFC 10008 `HTTP QUERY` (plain text or JSON body), `GET ?q=<query>`, `POST` (JSON or plain text)
- Response format: Ranked `text/markdown; charset=utf-8` passages with relevance scores and canonical URL anchors (or `application/json` with `Accept: application/json`)

## Editions & Licensing

- **rustybox-core (MIT)**: 93 memory-safe applets on Linux (91 on macOS) built strictly on permissive crates (uutils coreutils, ripgrep search crates, walkdir/globset, RustCrypto sha1/sha2/sha3/md5, flate2/bzip2/xz2/tar). Zero BusyBox GPL code compiled.
- **rustybox (GPL-2.0-only)**: Complete BusyBox-lineage multicall binary with 399 applets (including `ash`, `hush`, `awk`, `sed`, `vi`, `wget`, `ip`, `ifconfig`, `mount`, `umount`, `init`).

## v0.4.0 Verified Performance & Benchmarks

Measured head-to-head on stripped `rustybox-core` release binaries (`aarch64-apple-darwin`, `rustc 1.99.0-nightly`):
- **Release binary size (`rustybox-core`):** 9.53 MB -> **8.93 MB** (**-6.4%**)
- **`sha256sum` (64 MiB):** 400.12 ms (160.0 MB/s) -> **48.59 ms (1,317.3 MB/s)** (**8.24x faster**)
- **`grep -n` (32 MiB, ~82k matches):** 130.23 ms (245.8 MB/s) -> **19.62 ms (1,631.2 MB/s)** (**6.64x faster**)
- **`grep -F` (32 MiB fixed-string):** 114.95 ms (278.4 MB/s) -> **17.86 ms (1,792.3 MB/s)** (**6.44x faster**)
- **`gunzip -c` (16 MiB -> stdout):** 38.20 ms (419.6 MB/s) -> **16.10 ms (995.5 MB/s)** (**2.37x faster**)
- **`tar -cf` (2,000 files):** 96.29 ms -> **61.01 ms** (**1.58x faster**)
- **`tar -tf` (2,000 files):** 17.52 ms -> **12.07 ms** (**1.45x faster**)
- **`grep -r` (2,000-file tree):** 78.67 ms -> **54.82 ms** (**1.43x faster**)
- **`gzip -c` (16 MiB -> stdout):** 46.62 ms (343.8 MB/s) -> **33.45 ms (479.1 MB/s)** (**1.39x faster**)
- **`find` (2,000 files, multi-pred):** 17.39 ms -> **14.85 ms** (**1.17x faster**)
- **`xargs -n 1000` (20k tokens):** 53.05 ms -> **47.18 ms** (**1.12x faster**)
- **Symlink `argv[0]` dispatch (incl. macOS spawn):** 10.26 ms -> **9.94 ms** (**1.03x faster**, compile-time sorted `O(log N)` zero-alloc dispatch)
- **`cat` (64 MiB):** 17.49 ms (3,658.5 MB/s) -> **17.09 ms (3,743.9 MB/s)** (**1.02x faster**)
- **`wc -l` (32 MiB):** 12.57 ms (2,545.6 MB/s) -> **12.45 ms (2,570.7 MB/s)** (**1.01x faster**)

## Agentic Harness Primitives

Built to bound autonomous coding agents inside minimal Linux containers (`FROM scratch`) and microVMs:
- `timeout`: deterministic wall-clock deadlines with `SIGTERM` → `SIGKILL` escalation (`exit 124`)
- `flock`: advisory file locking for safe parallel agent writes
- `xargs`: safe zero-copy command batching (`-0/--null`, `-n/--max-args`, `-t/--verbose`)
- `watch`: periodic state and integrity polling
- `grep` / `egrep` / `fgrep`: embedded ripgrep engine
- `find`: safe `walkdir` + `globset` traversal
- `sha256sum` / `sha512sum` / `sha3sum`: pure-Rust RustCrypto digests

## Install (Static musl)

```sh
# x86_64 static musl (MIT core)
curl -LO https://github.com/8b-is/rustybox/releases/latest/download/rustybox-core-x86_64-unknown-linux-musl
chmod +x rustybox-core-x86_64-unknown-linux-musl && ./rustybox-core-x86_64-unknown-linux-musl --version

# aarch64 static musl (MIT core)
curl -LO https://github.com/8b-is/rustybox/releases/latest/download/rustybox-core-aarch64-unknown-linux-musl
chmod +x rustybox-core-aarch64-unknown-linux-musl && ./rustybox-core-aarch64-unknown-linux-musl --version

# Docker FROM scratch (~3.2 MB with -slim UPX build)
# FROM scratch
# COPY rustybox-core-slim-x86_64-unknown-linux-musl /bin/rustybox
# ENTRYPOINT ["/bin/rustybox"]

# Build from source
cargo build --release -p rustybox-core
```

## Security & Supply Chain

- Active CVEs: 0 (compared to 64 historical upstream BusyBox C memory CVEs)
- Provenance: keyless Sigstore `cosign` source archive signing
- Compression: `wild` linker + `upx --best --lzma` (~4 MB with symbols; `*-slim` stripped ~3.2 MB)
- Live CVE status JSON: `https://rustybox.io/cve-status.json`
- Full CVE audit report: `https://rustybox.io/docs/cve-report.html`

## Links

- [Homepage](https://rustybox.io/)
- [Documentation](https://rustybox.io/docs/)
- [Source Code](https://github.com/8b-is/rustybox)
- [Releases](https://github.com/8b-is/rustybox/releases)
- [Resurrection Story](https://pocoo.vaked.dev/posts/2026-07-20-resurrecting-rustybox.html)
- [Sponsor](https://github.com/sponsors/8b-is)
