Keep your computer from going to sleep

The built-in caffeinate command keeps the computer awake for as long as it runs: caffeinate -d stops the display sleeping until you press Control-C, and caffeinate -t 3600 does it for an hour.

How

Stay awake, screen on, until you press Control-C:

caffeinate -d

Stay awake for one hour, then return to normal:

caffeinate -d -t 3600
Or just ask Titan
Keep my computer awake for the next two hours while this downloads. Do it with Titan

Titan is an AI that lives on your computer: tell it what you need and it does it while you watch — you press Return, nothing runs by itself. What is Titan?

Titan isn’t on this computer yet. Get Titan, then press the button again — the task will be waiting, typed in.

Related

Check your laptop battery health