Start
Install Brevi
Brevi turns programs into Rust and calls rustc to build them, so it needs the Rust toolchain on the machine as well as the brevi binary itself. The install script sets up both.
Requirements#
| What | Why | Notes |
|---|---|---|
rustc (Rust stable) | Brevi compiles every program through it | Installed by the script if missing. Any recent stable works; CI tests stable daily and beta and nightly weekly. |
python3 (optional) | The CPython fallback of brevi run, and programs that import libraries such as numpy | Not needed for programs that use only the standard library. Library programs need libpython where they run, unless built with --standalone. |
| Linux, macOS or Windows | Prebuilt binaries for x86-64 and ARM64 Linux, Apple silicon and Intel Macs, and x86-64 Windows | Library calls through CPython and --standalone builds are not available on Windows yet. |
Linux and macOS: the install script#
curl -fsSL https://raw.githubusercontent.com/ets-public/brevi/main/install.sh | sh
The script:
- installs the Rust toolchain with rustup (minimal profile) if
rustcis not on the PATH; - downloads the prebuilt
brevifor this machine from the latest GitHub release; - verifies the download against the release's
SHA256SUMS(withsha256sumorshasum -a 256) and installs it into~/.cargo/bin; - builds it with
cargo installinstead when no release fits (setBREVI_FROM_SOURCE=1to always build from source); - prints
brevi --version.
If the checksum does not match, or the download cannot be verified because SHA256SUMS or a checksum tool is missing, the script stops and installs nothing.
Check it worked:
$ brevi --version
brevi 0.24.6
$ printf 'print(sum(range(10)))\n' > hello.py && brevi run hello.py
45
Windows#
- Install Rust with rustup. It also asks for the Microsoft C++ build tools, which
rustcneeds to link programs. - Download
brevi-x86_64-pc-windows-msvc.zipfrom the latest GitHub release, unzip it, and putbrevi.exeon your PATH (for example in%USERPROFILE%\.cargo\bin, next torustc). - In PowerShell or cmd:
brevi --version.
Standard-library programs build and run natively on Windows. Python files that import packages such as numpy run with CPython instead, because the library bridge does not run on Windows yet.
Release downloads#
Every GitHub release carries these archives, each with the brevi binary, LICENSE, README.md and BREVI.md:
| Platform | Archive |
|---|---|
| Linux x86-64 | brevi-x86_64-unknown-linux-gnu.tar.gz |
| Linux ARM64 | brevi-aarch64-unknown-linux-gnu.tar.gz |
| macOS, Apple silicon | brevi-aarch64-apple-darwin.tar.gz |
| macOS, Intel | brevi-x86_64-apple-darwin.tar.gz |
| Windows x86-64 | brevi-x86_64-pc-windows-msvc.zip |
Each release also carries SHA256SUMS, with the SHA-256 of every archive. The install script checks its download against it.
Docker#
The repository's Dockerfile bundles brevi with the Rust toolchain:
docker build -t brevi .
docker run --rm -i -v "$PWD:/w" -w /w brevi run main.py < input.txt
docker run --rm -i brevi mcp # the MCP server over stdio
From source#
git clone https://github.com/ets-public/brevi
cd brevi
cargo build --release
./target/release/brevi run examples/shapes.bv
Or cargo install --git https://github.com/ets-public/brevi brevi. See Contributing for the test suite.
Package managers: coming#
The names are reserved and the packaging is ready in packaging/, but nothing is published yet. Until then, use the release binaries above.
| Channel | Command, once published |
|---|---|
| npm | npx brevi mcp |
| PyPI | pip install brevi, or uvx brevi mcp |
| Homebrew | brew install ets-public/brevi/brevi |
| crates.io | cargo install brevi |
| MCP registry | io.github.ets-public/brevi |
Where Brevi keeps things#
Brevi caches built programs and its runtime libraries in ~/.cache/brevi ($BREVI_CACHE moves it, BREVI_CACHE_MB caps it, default 1024 MB), so checking or running an unchanged program again replays the last result in about 10 ms. The very first build, and the first after a Rust update, also builds Brevi's runtime once, which takes about 5 to 15 seconds; after that a new small program builds in well under a second. Deleting the folder is always safe.
Next#
Using Brevi covers the commands. To connect a coding agent, go to For AI agents.