Getting Started with Bro in 5 Minutes
This tutorial takes you from zero to a cached task run. No prior knowledge of Bro — or of any build tool — is required. Every command is meant to be copied and pasted as-is.
You will:
- Install Bro.
- Write a one-task
bro.yaml. - Run it twice and see the second run served from cache.
- Change an input and watch Bro re-run exactly what changed.
- Clean up.
1. Install Bro
Pick one of the following.
Linux / macOS:
curl -fsSL https://hypervapor.org/bro/install.sh | shThe script detects your OS/architecture, downloads the latest release archive, verifies its checksum, and installs bro into /usr/local/bin (falling back to ~/.local/bin without sudo).
Windows (PowerShell):
irm https://hypervapor.org/bro/install.ps1 | iexThe script detects the architecture, verifies the checksum, installs to %LOCALAPPDATA%\Programs\bro, and adds it to your PATH.
Verify the install:
bro versionbro version v0.1.02. Create a project
Bro has no init command — a project is just a directory with a bro.yaml. Create one:
mkdir line-counter && cd line-counter
cat > bro.yaml <<'EOF'
version: "1"
tasks:
count:
cmd: "wc -l < lines.txt > count.txt && cat count.txt"
inputs: ["lines.txt"]
outputs: ["count.txt"]
EOF
printf 'one\ntwo\nthree\n' > lines.txtWhat the task says: run wc -l over lines.txt, write the result to count.txt, and print it. The inputs/outputs declarations are what make the task cacheable: Bro hashes the inputs, and stores/restores the outputs.
Commands run in an embedded POSIX shell, so the same bro.yaml behaves identically on Linux, macOS, and Windows.
3. Run it
bro listcountbro run count[count] $ wc -l < lines.txt > count.txt && cat count.txt
3
[count] done (2ms)
1 tasks, 0 cached, 1 executed, 4ms totalcount.txt now exists and contains 3.
4. Run it again — cache hit
bro run count[count] cached (0ms)
3
1 tasks, 1 cached, 0 executed, 0ms totalNothing was re-executed: Bro hashed lines.txt, found a cache entry for that exact fingerprint, restored count.txt from it, and replayed the recorded output (the 3 you see). On a real project this is where seconds or minutes of build time turn into milliseconds.
5. Change an input — automatic invalidation
printf 'four\n' >> lines.txt
bro run count[count] $ wc -l < lines.txt > count.txt && cat count.txt
4
[count] done (2ms)
1 tasks, 0 cached, 1 executed, 4ms totalChanging a declared input changed the fingerprint, so the task re-ran. Files not listed in inputs never trigger a re-run — declare your inputs completely and Bro never serves you a stale result.
6. Clean up
bro clean --outputscleared cache /path/to/line-counter/.bro/cache
removed 1 declared output path(s)bro clean empties the local cache (.bro/cache); --outputs additionally deletes every declared output path (count.txt here).
Where to go next
examples/in the repository — a shell-only pipeline and a Go project (test → build) you can run immediately.docs/best-practices.md— how to declareinputscorrectly (the part that determines whether your cache is hit or silently missed).docs/technical-specification.md— fullbro.yamlfield reference (Section 3), remote cache setup (Section 9), and the CLI (Section 13).bro run <task> --verboseshows fingerprint computation and cache lookups;bro watch <task>re-runs automatically when inputs change.