Breviv0.24

Start

Install Brevi

View as Markdown

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#

WhatWhyNotes
rustc (Rust stable)Brevi compiles every program through itInstalled 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 numpyNot needed for programs that use only the standard library. Library programs need libpython where they run, unless built with --standalone.
Linux, macOS or WindowsPrebuilt binaries for x86-64 and ARM64 Linux, Apple silicon and Intel Macs, and x86-64 WindowsLibrary 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:

  1. installs the Rust toolchain with rustup (minimal profile) if rustc is not on the PATH;
  2. downloads the prebuilt brevi for this machine from the latest GitHub release;
  3. verifies the download against the release's SHA256SUMS (with sha256sum or shasum -a 256) and installs it into ~/.cargo/bin;
  4. builds it with cargo install instead when no release fits (set BREVI_FROM_SOURCE=1 to always build from source);
  5. 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#

  1. Install Rust with rustup. It also asks for the Microsoft C++ build tools, which rustc needs to link programs.
  2. Download brevi-x86_64-pc-windows-msvc.zip from the latest GitHub release, unzip it, and put brevi.exe on your PATH (for example in %USERPROFILE%\.cargo\bin, next to rustc).
  3. 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:

PlatformArchive
Linux x86-64brevi-x86_64-unknown-linux-gnu.tar.gz
Linux ARM64brevi-aarch64-unknown-linux-gnu.tar.gz
macOS, Apple siliconbrevi-aarch64-apple-darwin.tar.gz
macOS, Intelbrevi-x86_64-apple-darwin.tar.gz
Windows x86-64brevi-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.

ChannelCommand, once published
npmnpx brevi mcp
PyPIpip install brevi, or uvx brevi mcp
Homebrewbrew install ets-public/brevi/brevi
crates.iocargo install brevi
MCP registryio.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.