A small macOS CLI for time-boxed closed-lid awake sessions.
Use it when you start local Codex work, close your laptop for a short commute, and want macOS to restore normal sleep behavior automatically after a set time.
git clone https://github.com/AlankritVerma01/codex-commute.git
cd codex-commute
./install.shIf needed:
export PATH="$HOME/.local/bin:$PATH"codex-commute doctor
codex-commute doctor --test-disablesleepThe second command briefly enables and restores the closed-lid backend. It
requires sudo.
codex-commute
codex-commute 40m --detach
codex-commute status
codex-commute stop
codex-commute 40m --watch-agent-sec ~/projects/agent-sec --min-battery 25
codex-commute 10m --dry-run
codex-commute logs
codex-commute restoreIn the interactive wizard, bare durations are minutes. In advanced options,
bare log intervals are seconds. agent-sec is only an optional local project
watcher when that checkout exists on your machine.
Logs are written to:
~/Library/Logs/codex-commute/
Closed-lid wake can create heat and battery drain. Keep sessions short and avoid heavy builds in a bag.
Codex Commute:
- uses a timer
- logs status while running
- supports detached sessions with
--detach - restores normal sleep settings on timeout, Ctrl-C,
stop, or low battery - only calls
sleepnowafter timeout or low battery when the lid appears closed - does not install a daemon
- does not permanently change sleep settings
MIT