diff --git a/AI.dev/CHEATSHEETS/long-running-jobs.md b/AI.dev/CHEATSHEETS/long-running-jobs.md index 8f81587e..b543d20d 100644 --- a/AI.dev/CHEATSHEETS/long-running-jobs.md +++ b/AI.dev/CHEATSHEETS/long-running-jobs.md @@ -73,6 +73,25 @@ caffeinate -dimsu "" 2>&1 | `| tee ~/phase3.log` captures the full run to disk so you have the log even if the scrollback is gone. +### Shortcut: the `longrun` helper + +The ByteLyst alias set (`learning_ai_devops_tools/aliases/`) ships a `longrun` helper that +does all of the above in one command — detached `tmux` + `caffeinate` (macOS) + a +timestamped log: + +```bash +longrun phase3 "" +# -> starts a detached, kept-awake, logged session named "phase3" +ta phase3 # reattach (alias for tmux attach -t) +tail -f ~/longrun-phase3-*.log # follow output +tmux kill-session -t phase3 # stop it + +awake # macOS: run any command keeping the machine awake +``` + +Install the aliases via `learning_ai_devops_tools/aliases/install.sh` (see that folder's +README). + --- ## Best practices for an unattended agent run