A tiny macOS menu bar keep-awake tool for agent coding sessions.
Tired of your Mac dozing off while a long-running coding agent does its thing?
cafe parks a coffee cup in your menu bar. Click it, pick a mode, and your
Mac stays awake until you switch it off. The icon's color tells you the state
at a glance — no more guessing whether caffeinate is still running.
Built in pure Rust on top of the system caffeinate, with no web view and
no dependencies beyond macOS itself — just a ~400 KB binary that lives in
your menu bar.
- Three modes (mutually exclusive, in the menu):
Mode caffeinateflagsIcon color Effect Off — gray no sleep prevention Idle Only -iwarm yellow prevents idle system sleep; display may dim Idle + Display -dideep orange prevents idle sleep and keeps the display on - Color-coded icon — the coffee cup (SF Symbol
cup.and.saucer.fill) is tinted via a hierarchical symbol configuration, so the color is always visible and reliable across macOS versions (including macOS 26 / Tahoe). - No leaked processes. The
caffeinatechild is tracked and killed on every mode change and on quit/panic (Dropguarantee). - Starts off. Always launches in
Offfor safety — you opt in each time. - Remembers your last mode in
~/Library/Application Support/cafe/config.json(for UX continuity; it is not auto-applied on launch). - Menu bar only. Runs as an accessory — no Dock icon, no main window.
- macOS 11.0 (Big Sur) or newer
- Rust 1.74+ (only needed to build from source)
git clone https://github.com/Anthemty/cafe.git
cd cafe
./make-app.sh # produces dist/cafe.app
open dist/cafe.appThe first time you run it, macOS may show "cafe cannot be opened because the developer cannot be verified" (it's unsigned). To bypass: right-click the app → Open → Open in the dialog. This one-time approval sticks.
cargo build --release
./target/release/cafeA coffee cup appears in the menu bar. Click it, pick a mode, and your Mac stays awake until you switch back to Off or Quit.
💡 The raw binary has no app icon;
make-app.shis the way to get the full experience (app icon, proper name in Force Quit, clean LSUIElement behavior).
cafe spawns and supervises a single caffeinate child process, restarting it
with different flags when you switch modes:
mode change ──► Supervisor::enter(mode) ──► kill old child ──► spawn new child
│
(caffeinate flags from Mode::caffeinate_args)
The supervisor is pure Rust with no AppKit dependency and is fully unit-tested
using sleep as a stand-in for caffeinate. The GUI layer is thin: an
NSStatusItem + NSMenu whose actions call back into the supervisor.
src/
main.rs NSApp setup, status item + menu, action callbacks (define_class!)
supervisor.rs caffeinate child-process lifecycle (spawn / kill / reap)
state.rs Mode enum + JSON persistence
icon.rs SF Symbol + per-mode hierarchical color
make-app.sh Build the .app bundle and generate the app icon
resources/ Generated icon assets (AppIcon.icns)
cargo build # debug build
cargo test # run supervisor unit tests
cargo clippy # lint
./make-app.sh # full release .appYou can — but you'll forget it's running, leave for the night, and come back to a hot laptop with a dead battery. cafe makes the state visible (the icon color) and trivial to toggle off.
Possible future additions (not yet implemented):
- Launch at login
- Global hotkey to toggle modes
- Auto-detect running agent processes (Claude Code, Cursor, …) and arm automatically
- Timer mode ("keep awake for the next 2 hours")
Contributions are welcome! Please open an issue first to discuss what you'd like
to change. Run cargo fmt, cargo clippy, and cargo test before submitting.
This project is licensed under the MIT License.
Copyright © 2026 Anthemty.