Skip to content

stacksjs/barista

Barista Logo

GitHub Actions macOS

Barista

Keep your Mac awake. One click from the menu bar.

Barista is a tiny, native macOS menu bar app that prevents your Mac from sleeping — a free, modern replacement for Caffeine, Amphetamine and KeepingYouAwake. One click to caffeinate, pick a duration (15m, 30m, 1h, 4h, 8h, 12h, or indefinite), and your Mac stays awake until you say otherwise. Built with stx + Craft so it stays out of the way: 1.4MB binary, under 100ms startup, no Electron.

As a bonus, Barista also tidies up your menu bar.

Why Barista

Barista Caffeine.app Amphetamine KeepingYouAwake
Price Free, MIT Paid Free (Mac App Store) Free, MIT
Binary size ~1.4 MB ~3 MB ~15 MB ~5 MB
Cold start <100 ms ~150 ms ~300 ms ~150 ms
Runtime Native (Zig) Native Native Native
Bonus: menu bar tidying Yes No No No
Source Open Closed Closed Open

Features

  • Caffeinate, primarily — Prevent system sleep, display sleep and idle sleep with customizable durations (15m, 30m, 1h, 4h, 8h, 12h, indefinite). One click from the menu bar to toggle, with a live countdown in the tray.
  • Caffeinate on startup — Optional: start the app already caffeinated, so your Mac is awake the moment you log in.
  • Global hotkey — Toggle caffeinate (or the menu bar) without reaching for the mouse.
  • Menu bar management (bonus) — Collapse and organize menu bar items, with optional auto-collapse and an always-hidden section.
  • Launch at login — Start Barista when you log in.
  • Native performance — Built with Craft's native webview (1.4MB binary, <100ms startup, no Electron).
  • Beautiful UI — Dark-themed popup window with intuitive controls.

Get Started

bun install
bun run dev

Development

# Run the app in development mode
bun run dev

# Lint
bun run lint
bun run lint:fix

# Build for production
bun run build

Architecture

Barista is built as a native macOS menubar app using:

  • stx — Template engine for the UI (.stx files)
  • Craft — Native webview framework (Zig-powered, Electron alternative)
  • @stacksjs/desktop — Desktop APIs (power management, preferences, system tray)
app.ts                 Entry point: starts server + Craft window
src/barista.stx        UI template (popup window)
src/server.ts          Local HTTP server (API + template rendering)
src/caffeinate.ts      Caffeinate process management
src/menu.ts            System tray menu builder
src/preferences.ts     App preferences (JSON storage)

Contributing

We welcome contributions! Please feel free to submit a Pull Request.

Credits

Sponsors

We would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.

License

The MIT License (MIT). Please see LICENSE for more information.

Made with 💙

About

☕ A lightweight macOS utility that serves up a perfectly organized menubar. #caffeinated

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Contributors