Check on the Mac from your iPhone
The Mac is in the bag with the lid shut, on your phone’s hotspot, and you want to know whether it’s still awake and what the battery is doing, or put it to sleep. Two Shortcuts on the phone do it over SSH. Nothing in Nuit Blanche talks to the phone: this is macOS’s Remote Login and the hotspot’s own network. Anything marked "check on your setup" is written from Apple’s documentation, not tried on every Mac and phone.
On the Mac, once
- Remote Login. System Settings › General › Sharing, turn on Remote Login. Leave it open to all users or pick your account.
- The Mac’s name on the network. In Terminal,
scutil --get LocalHostNameprints it; add.local. A Mac calledMy-MacBook-AirisMy-MacBook-Air.local. Use the name rather than an address: Personal Hotspot keeps the Mac on the same subnet as the phone (the phone is the router,172.20.10.1, and the Mac gets a172.20.10.xaddress), which is why the phone can reach it at all, but the Mac’s address on that link changes from one connection to the next. The Bonjour name works on the hotspot link (check on your setup);ipconfig getifaddr en0on the Mac shows the current address if you ever need it. While the Mac is tethered this way,nuitblanche status --jsonreports"hotspot": true. - Joining the hotspot. Instant Hotspot puts your iPhone’s hotspot in the Mac’s Wi-Fi menu without the password. It needs both devices signed in with the same Apple Account and Wi-Fi and Bluetooth on, on both (Apple’s support article 109321). On macOS 26 or later, Wi-Fi Settings › Ask to join hotspots › Automatic makes the Mac join the hotspot by itself whenever no Wi-Fi network is available and the phone is nearby. That’s what moves the Mac from the office Wi-Fi to your phone when you walk out, and it’s Apple’s behaviour as Apple documents it, not something Nuit Blanche does. Before macOS 26 the choice is Ask to Join, so join the hotspot by hand before you close the lid (check on your setup).
Try it before you need it: with the Mac on the hotspot and the lid open, ssh <you>@<name>.local nuitblanche status from another machine, or from the phone with the Shortcut below.
On the iPhone
Two shortcuts in the Shortcuts app. Each is one action, Run Script Over SSH (under Scripting), with these fields:
| Field | Value |
|---|---|
| Host | My-MacBook-Air.local, your Mac’s name from above |
| Port | 22 |
| User | your Mac account name (whoami in Terminal) |
| Authentication | Password, your Mac login. Or SSH Key: the action makes its own key and shows the public half; add that line to ~/.ssh/authorized_keys on the Mac (check on your setup) |
| Script | /usr/local/bin/nuitblanche status |
Add a Show Result action after it so the output comes up on screen:
on (3h 59m left)
held by Claude Code · nuit-blanche (pid 47338), 3h 59m left
36% battery, about 5h 19m at this rate
The second shortcut is the same with /usr/local/bin/nuitblanche off --all. It prints Sleeps normally again. and, with the lid shut, the Mac goes to sleep right away. The connection drops behind it, so a connection error after that line is the Mac doing what you asked (check on your setup).
Name them Mac status and Mac sleep, put them on the Home Screen or in a widget, or ask Siri. The first time each runs, the action asks you to accept the Mac’s host key, and Shortcuts may ask you to allow scripting actions in its settings.
off --all drops every session’s hold. That’s the point from the bag, but if an agent is mid-task it stops where it is. Run the status shortcut first.
When it doesn’t answer
- The shortcut times out or can’t connect. The Mac is asleep, or it isn’t on the hotspot. If Nuit Blanche put it to sleep, the menu says why when you open the lid:
Timer ended at 03:00,Went to sleep at 20% battery (14:32),All sessions done (14:32),Went to sleep: offline for 15 minutes (14:32). If the Mac never joined the hotspot, the lid closed before it switched networks: check the Ask to join hotspots setting above. - **
statussaysoff.** The Mac is awake for some other reason: the lid is open, or it’s on power with a display. A third shortcut with/usr/local/bin/nuitblanche on 4h --as phoneturns it on, namedphonein the menu. - The name doesn’t resolve. Use the
172.20.10.xaddress from step 2 as the host for now, and expect to update it: it can change the next time the Mac joins the hotspot.