About this project

awake is a small macOS command-line utility for keeping a Mac awake while GUI automation runs. It uses a single caffeinate invocation with -disu flags to block display sleep, idle system sleep, AC sleep, and to assert user activity so the screen saver idle timer does not accumulate. Assertions are held only for the requested duration and then released; no system settings are modified. The tool supports durations such as 2h, 90m, 45s, or seconds, background operation with -b, status reporting that shows actual held assertions and running instances, and awake off to stop all instances. It tracks instances by command line rather than pidfile so instances started in other terminals remain controllable. The interface follows the Mac's language, with English and Simplified Chinese included, and can be overridden via AWAKE_LANG. awake includes a terminal UI with a breathing progress indicator, truecolor and 256-color support, NO_COLOR handling, and plain-text output when piped. The animation loop is implemented with zsh builtins to avoid per-frame process forks. It does not prevent manual locks, lid-close sleep, or make permanent changes. Installation is a simple clone and symlink into a PATH directory, requiring only zsh and standard macOS tools.