Skip to content

bacon

bacon is a background Rust code checker. It watches for file changes and continuously runs cargo check, cargo clippy, or cargo test in a TUI.


Terminal window
# Via cargo
cargo install --locked bacon
# macOS
brew install bacon

Terminal window
# Start bacon with default job (build)
just watch
# Or run directly with a specific job
bacon check # Fast type checking
bacon clippy # Lints
bacon test # Run tests
bacon doc # Build docs

KeyAction
cSwitch to check job
bSwitch to build job
tSwitch to test job
lSwitch to clippy job
dSwitch to doc job
fSwitch to fmt job
pSwitch to proto generation
qQuit
wToggle wrap
EscBack / clear

JobCommand
checkcargo check --lib --bins
buildcargo build --lib --bins --release
testcargo test --lib
clippycargo clippy --lib --bins -- -D warnings
doccargo doc --lib --no-deps
fmtcargo fmt

Watch individual example crates:

JobPackage
ex-cartcart aggregate
ex-customercustomer aggregate
ex-fulfillmentfulfillment aggregate
ex-inventoryinventory-svc aggregate
ex-orderorder aggregate
ex-productproduct aggregate
ex-proj-accountingaccounting projector
ex-proj-webweb projector
ex-proj-logginglogging projector
ex-saga-cancelcancellation saga
ex-saga-fulfillfulfillment saga
ex-saga-loyaltyloyalty-earn saga
ex-e2ee2e tests
JobDescription
ex-rustFull Rust workspace check
ex-goGo examples build
ex-pythonPython examples lint
JobDescription
protoGenerate all language protos
proto-rustGenerate Rust protos only
proto-pythonGenerate Python protos only
proto-goGenerate Go protos only
JobBinary
bin-aggregateangzarr-aggregate
bin-sagaangzarr-saga
bin-projectorangzarr-projector
bin-gatewayangzarr-gateway
bin-streamangzarr-stream
bin-event-projectorangzarr-event-projector

Configuration is in bacon.toml at the project root. Jobs define:

  • command - The command to run
  • need_stdout - Whether to capture stdout (true for tests)
  • on_change_strategy - How to handle file changes (kill_then_restart)
  • watch - Optional custom watch paths (defaults to Rust sources)