Licensing
By contributing to zerobrew, you agree your contributions will be dual-licensed under either Apache OR MIT, at the licensee’s choice.Prerequisites
Rust 1.90+
Install the latest stable Rust toolchain
macOS or Linux
Development requires either platform
A Note on LLM Usage
While we encourage the use of LLMs for thinking through problems, helping with tests, and even writing code, we cannot accept PRs with no clear guidance or thought put into them. If you need help or want to walk through an issue or idea with maintainers, join the community Discord - we’re happy to assist!Project Structure
zerobrew is organized as a Cargo workspace with three crates:zb_core
Core data models and domain logic (formula resolution, bottle selection)
zb_io
I/O operations (API client, downloads, extraction, installation)
zb_cli
Command-line interface
Development Workflow
We prefer that PRs are linked to an open issue or previously discussed through other channels. If you’re introducing changes that aren’t tracked, reach out in Discord or open an issue first.General Flow
Make your changes
Ensure at minimum:
- Code is formatted:
cargo fmt --all - No clippy warnings:
cargo clippy --workspace --all-targets -- -D warnings - Unit tests pass:
cargo test --workspace - Integration tests pass:
cargo test --workspace -- --ignored
These will run in CI, but it’s best to clean up your code before opening a PR to ensure a quick turnaround!
Commit with clear messages
Follow our commit hygiene guidelines
Using Just
This project includes aJustfile. Install just and use these commands:
$ZEROBREW_BIN:
Commit Hygiene
Follow this format for commit messages:Examples
Allowed Prefixes
| Prefix | Description |
|---|---|
fix | Fixes a bug or regression |
feat | New feature |
chore | Housekeeping (deps, typos in docs, etc.) |
tests | Added, changed, or removed tests |
ci | Changes to CI |
refactor | Refactored code |
perf | Performance related |
build | Changes to build system (external deps, tooling, scripts) |
Atomic Commits
Write isolated, atomic commits. If your PR touches various parts of the codebase, ensure commits are contained and cleanly separated, properly describing which changes belong where.Testing
Unit Tests
Unit Tests
- Colocate with code in
mod testsblocks - Use
tempfilefor filesystem tests - Tests should be deterministic and not rely on external network access
Integration Tests
Integration Tests
- Use
wiremockfor HTTP mocking - Run with:
cargo test --workspace -- --ignored - Or use:
just testfor all tests
Running Benchmarks
To benchmark performance:Useful Options
Notes
- Defaults to the quick package list (22 packages); use
--fullfor all 100 --full [dir]writes all formats (txt/json/csv/html) to the directory--outputinfers format from file extension when--formatis omitted- Output includes cold + warm cache speedups per package
macOS Homebrew Permissions
On macOS, Homebrew should be installed with a user-writable prefix. Ifjust bench fails with a permission error, fix it:
Questions?
Open an Issue
Ask questions or report problems on GitHub
Join Discord
Connect with maintainers and the community