Hub Management
The hub daemon is a background process that manages multiple sessions. It starts automatically and usually doesn't need manual intervention, but these commands help when it does.
Hub Lifecycle
- Auto-start: The first
itwillsyncsession spawns the hub daemon - Registration: Each new session registers with the hub automatically
- Auto-shutdown: Hub exits 30 seconds after the last session disconnects
Commands
View Dashboard Info
bash
itwillsync hub infoDisplays:
- QR code for the dashboard URL
- Full dashboard URL with authentication token
- Number of active sessions and their names
Use this when you:
- Need to re-scan the QR code on your phone
- Want to copy the dashboard URL to share with another device
- Lost the terminal output that showed the initial QR code
List Sessions
bash
itwillsync hub statusShows all active sessions with:
- Session name (agent command)
- Status (active, idle)
- Uptime
- Port number
Stop the Hub
bash
itwillsync hub stopSends SIGTERM to the hub daemon process. This also terminates the dashboard — connected phones will lose their connection.
Individual sessions continue running as standalone servers (without the dashboard), unless they were also terminated.
How Sessions Register
When you run itwillsync -- claude:
- CLI checks if hub is running on port 7963 (localhost health check)
- If no hub — spawns it as a detached background process
- Hub writes its config to
~/.itwillsync/hub.json - Session registers via the internal API:
POST http://127.0.0.1:7963/api/sessions - Hub broadcasts the new session to all dashboard clients
- On exit, session unregisters via
DELETE /api/sessions/:id
Troubleshooting
Hub won't start
Check if port 7962 or 7963 is already in use:
bash
lsof -i :7962
lsof -i :7963Stale hub files
If the hub crashed without cleanup, remove stale files:
bash
rm ~/.itwillsync/hub.json ~/.itwillsync/hub.pidCheck if hub is running
bash
curl http://127.0.0.1:7963/api/healthExpected response: {"status":"ok","sessions":N,"uptime":...}