CaffeinateCat
Keeping a Mac awake with the lid closed, without leaving it broken
Why lid-closed mode needs root, how CaffeinateCat asks for it once for exactly two commands, and the five separate things that make sure your Mac can always sleep again.