bacon
A background Rust code checker that reruns cargo check, test, or clippy automatically on save.
bacon is a background code checker for Rust projects. It watches your source
files and automatically reruns cargo check, cargo clippy, cargo test, or
any other command when changes are detected — displaying errors and warnings in
a clean, distraction-free terminal UI.
The key philosophy is that it runs in a separate terminal, out of your way, so you can keep your editor focused and just glance over to see if your code compiles.
Features
- Automatic re-checking — watches source files and reruns on every save
- Multiple jobs — switch between
check,clippy,test, and custom commands with a keypress - Clean output — filters and formats compiler errors for readability
- Configurable — define custom jobs in a
bacon.tomlper project - Summary mode — shows just the error/warning count when the terminal is narrow
- Vim-style navigation — scroll through errors without leaving the terminal
Installation
cargo install bacon
# Debian / Fedora — no official package; use cargo install or download a binary from the releases page.Usage
Run bacon in your project root and it will start checking immediately:
# Run cargo check in the background
bacon
# Run clippy instead
bacon clippy
# Run tests
bacon test
# Run a specific test
bacon test -- my_test_nameSwitching jobs at runtime
While bacon is running, press:
c— switch tocargo checkl— switch tocargo clippyt— switch tocargo testr— rerun the current job manuallyq— quit
Configuration
Create a bacon.toml in your project root to define custom jobs:
[jobs.check]
command = ["cargo", "check", "--all-targets", "--all-features"]
watch = ["src", "tests", "benches"]
[jobs.clippy]
command = ["cargo", "clippy", "--all-targets", "--all-features"]
[jobs.test]
command = ["cargo", "test"]
need_stdout = true
[jobs.doc]
command = ["cargo", "doc", "--no-deps"]
need_stdout = false
[keybindings]
d = "job:doc"