Run a long command, then let your Mac sleep when it's done
There is a specific shape of job that keep-awake tools handle badly: the one with a clear beginning and a clear end. A migration, a test suite, an overnight export. You want the Mac awake for exactly as long as that command runs, and not a second longer. Run & Watch a Command is built for precisely that, so you can run a command then let Mac sleep the moment it finishes.
The problem with manual keep-awake
The usual ritual is two steps you have to remember in the right order. Turn keep-awake on, start the job, and later, hopefully, turn keep-awake off once it is done. The second step is the one that slips.
Forget it and the Mac sits awake for hours after a forty-minute job finished, draining or just not resting. Turn it off too early and you cut the job off at the knees. Neither is the behavior you actually wanted.
What you wanted was simpler than the controls allow: keep the Mac awake while this one command runs, then stop. Tie the keep-awake state to the life of the work itself, not to a switch you flip by hand.
Hand the command to LidRun instead
Run & Watch a Command flips the model around. Instead of you managing the keep-awake state, you hand LidRun the command and it manages the state for you. It holds keep-awake for the command's entire lifetime and releases the instant the command exits.
While the command runs, LidRun captures its output, so you are not staring at a terminal hoping it is still alive. The session shows in the menu bar the whole time, so you can step away knowing the Mac is up for exactly the right reason.
And when it ends, you get the part that actually matters: the exit code and how long it took. A clean exit, a failure, the duration of the run, all reported back, and LidRun can notify you so you do not have to keep checking. Then it releases, and the Mac is free to sleep again.
Guía relacionadaSet up the lidrun CLI for your dev workflowThe same thing from the command line
If you live in the terminal, the CLI does the same job in one prefix. Run lidrun -- your-command and LidRun holds a short-lived keep-awake assertion just for that command, then releases it when the command exits.
It is the natural way to wrap something you are already about to type. lidrun -- ./run-migrations.sh, or lidrun -- npm test, and the keep-awake lives and dies with the command, with the app's battery and thermal limits still applying underneath.
Either path, the GUI runner or the CLI wrapper, ends in the same place: the work finishes, the result is reported, and the Mac is allowed to sleep instead of being left awake by a switch nobody flipped back.
Where this fits
Think of the jobs you start and then go do something else. A long database migration you want to confirm completed cleanly. A full test suite that takes twenty minutes and you would rather not babysit. A data export kicked off before bed that should run overnight and be done by morning.
For all of those, the report at the end is half the value. Knowing the exit code and the duration tells you whether the migration applied, whether the suite passed, whether the export actually finished, without you having scrolled through output the whole time.
It runs inside the same safety governor as everything else. If charge drops past your threshold or thermal pressure climbs too high during a long command, LidRun lets the Mac sleep rather than pushing the hardware. So for an overnight job, mains power and a hard, ventilated surface are still the right call. It helps reduce risk on a long unattended run; it does not promise to push a command through no matter what the hardware is doing.
LidRun mantiene tu trabajo en marcha con la tapa cerrada, con protección de batería y temperatura integrada.
Preguntas frecuentes
Yes. Run & Watch a Command holds keep-awake for the command's entire lifetime and releases it the moment the command exits, so the Mac stays up for exactly as long as the job runs.
It reports the exit code and the duration of the run, and it can notify you. That lets you confirm whether a migration, test suite, or export finished cleanly without watching the terminal the whole time.
Yes. Run lidrun -- your-command and LidRun holds a short-lived keep-awake assertion just for that command, releasing it when the command exits. The app's battery and thermal limits still apply.
The run is gated by the safety governor. If charge drops past your threshold or thermal pressure climbs too high, LidRun lets the Mac sleep instead of pushing the hardware, so mains power is still recommended for overnight jobs.