Why not just use caffeinate?
caffeinate is fine for keeping a MacBook awake during a long download. But it has no UI, no way to check if it's running, and no configuration without killing and restarting it. espresso gives you:
- A live status indicator (running / not running, PID, current interval)
- Start and stop without leaving the terminal
- A lock-screen-only mode — useful when you want the screen to lock but not have the session expire
- Persistent settings between sessions
How it works under the hood
The daemon uses CoreGraphics via Python's ctypes to move the mouse — no third-party packages, no dependencies beyond Python 3 which ships with macOS. The movement is a small random ±5px jitter that snaps back immediately, so it's invisible during normal use but enough to reset the inactivity timer.
The TUI is written from scratch using raw terminal escape codes — no curses, no external library. It runs in the foreground as a manager while the daemon runs as a detached background process.
Installation
One line:
This installs the script to ~/.local/bin/espresso. Then just run espresso.
What's next
The project is open source and actively maintained. Coming up: a Homebrew tap for one-command installation, and potentially a menu bar indicator. If you find it useful, a star on GitHub goes a long way — it helps other people find it.
GitHub: https://github.com/billp/espresso