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

  1. Remote Login. System Settings › General › Sharing, turn on Remote Login. Leave it open to all users or pick your account.
  2. The Mac’s name on the network. In Terminal, scutil --get LocalHostName prints it; add .local. A Mac called My-MacBook-Air is My-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 a 172.20.10.x address), 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 en0 on the Mac shows the current address if you ever need it. While the Mac is tethered this way, nuitblanche status --json reports "hotspot": true.
  3. 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:

FieldValue
HostMy-MacBook-Air.local, your Mac’s name from above
Port22
Useryour Mac account name (whoami in Terminal)
AuthenticationPassword, 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