Free and open source, for macOS 14+

Unrestor keeps your MacBook awake with the lid shut for exactly as long as a command, a process, or a timer needs it. Then it lets go, and your Mac sleeps again.

Homebrew brew install --cask GAM3RG33K/tap/unrestor

Then run sudo unrestor install once, and unrestor run -- your-command any time.

Wraps whatever you already run

How it works

Three steps, then walk away.

No settings to hunt for and nothing to remember to switch off. A hold belongs to the thing that asked for it.

# once
brew install --cask GAM3RG33K/tap/unrestor
sudo unrestor install

# check
unrestor status
Background service: running
STEP 01

Install it once

One Homebrew command, plus a one-time password prompt to set up the small background service.

unrestor run -- npm run build
unrestor run --for 2h -- claude
unrestor watch 4821
unrestor hold --for 90m

or flip the menu-bar switch
STEP 02

Wrap what you run

Put unrestor run -- in front of any command, watch a process by id, or hold with a timer.

Sleep blocked yes
Holding npm run build
Power battery, 96%
Service runninglid closed
STEP 03

Close the lid

The work keeps going. When it ends, or a limit is hit, your Mac goes back to sleep on its own.

Install and launch
brew install --cask GAM3RG33K/tap/unrestor
sudo unrestor install            # one time: the background service
unrestor run -- npm run build    # close the lid and walk away
Features

Small on purpose. Careful by design.

It does one job, keeping the Mac awake while work runs, and spends the rest of its effort making sure it never overstays.

It lets go by itself

A hold lives and dies with the command, process, or timer that asked for it. Quit, crash, or lose the connection and the service releases it and restores your original setting, even after a reboot.

Works on battery

Lid closed, no charger needed. Power-only is there if you want it.

On battery
On power
Low Power Mode, optional

Limits that always win

Pick a battery floor from 10% to 50%. The service enforces it, along with a heat limit, so nothing running on your Mac can switch them off.

A switch, timers, and a countdown

The menu-bar app keeps a live countdown for timed holds, with one-tap timers from 30 minutes to 8 hours.

30m1h2h4h8h
1:59:42left

Private by design

Nothing to sign up for and nothing sent anywhere.

No account
No analytics
No tracking

Updates that respect your install

The app looks for a new release once a day (you can turn that off). Homebrew installs update through Homebrew, so its records stay correct.

Safety

Small enough to read in one sitting.

Keeping a Mac awake lid-closed needs a tiny root service. So we made it tiny, wrote down exactly what it can and can't do, and put all of it in the open.

Three commands, nothing moreHELLO 1  HOLD floor=20  RELEASE
Only you can talk to itA private socket, locked to the user who installed it.
It can't run your codeOne system setting, fixed arguments, no shell.
The service owns the limitsBattery floor, heat, and a ten-second lease are enforced on its side.
Open source

A personal project, shared openly.

Unrestor is something I built for myself, then opened up. I'm keeping the code and the workflow my own, so it's open to read and fork, not to contributions.

Fork it

Apache-2.0. Use it, change it, ship your own version, commercially or not. Give it its own name and icon.

No outside PRs

Pull requests from outside are rejected, however good they are. It's what keeps this repo mine.

Issues welcome

Bug reports and ideas are read. There's no guarantee of a reply, a fix, or a timeline.

FAQ

Questions, answered.

Does it work with the lid closed and no charger?
Yes. A hold keeps the Mac awake on battery or on power. A battery floor you choose, never below 10%, lets the Mac sleep again before the battery runs flat.
What if my terminal closes or my Mac crashes mid-hold?
The hold ends. The background service releases it when the connection closes, when it stops being renewed for ten seconds, or at the next launch after a crash or reboot, and it puts your original sleep setting back.
What does the background service do, and is it safe?
It runs as root, accepts three text commands on a private socket that only the installing user can reach, and changes one system setting with fixed arguments. It can't run your commands or read your files. The details are in SECURITY.md.
Is it notarized by Apple?
No. Notarization needs a paid developer account. Releases are ad-hoc signed and built in the open by GitHub Actions, and the Homebrew install clears the download warning for you. You can also build it yourself from source.
Does it track me?
No. There's no account, no analytics, and no telemetry. The only network request is an optional once-a-day look at this project's public release page, which you can turn off in the menu.
How do I remove it?
Run sudo unrestor uninstall to stop the service and restore your sleep setting, then brew uninstall --cask unrestor.
Which Macs and macOS versions work?
macOS 14 (Sonoma) or later, on Apple silicon and Intel.
Can I contribute?
Not code. Unrestor is open source but not open for contributions, and outside pull requests are rejected. Forks are welcome, and issues are welcome with no guarantee of a reply or a fix.

Close the lid. Keep going.

Homebrew brew install --cask GAM3RG33K/tap/unrestor