Public · macOS · Android · Linux · Windows

Legion Control

Control dual-boot and remote machines from a Mac menu bar, phone, or desktop over plain SSH — no daemon, no open ports.

GitHub ↗
  • node 24
  • swiftui
  • kotlin
  • ssh
SSH JSON contract
Client ssh legion node ~/.legion-control/bin/launcher.mjs status
{
  "ok": true,
  "system": "cachyos",
  "busy": { "active": false, "reasons": [] },
  "services": { "t3-code": { "up": true, "healthy": true, "turns": 0 } },
  "bootTargets": ["cachyos", "windows-11"]
}

Read-only snapshot in one round trip: active OS, health probes, busy state, boot targets.

SSH round trip per action
1
daemons or open ports
0
busy-gated maintenance pass
15 min
  • Four peer clients (macOS menu bar, Android, Linux, Windows) share one config and talk to a single zero-dependency Node ESM agent.
  • Every action runs launcher.mjs over SSH, checks signature and version floor, emits one JSON object, and exits.
  • Fail-closed busy probes inspect live services (such as running T3 Code turns or pending approvals) before allowing updates, sleep, or reboots.
  • Dual-boot switching arms one-shot firmware boot via efibootmgr, bcdedit, or grub-reboot and reads it back before rebooting.

Stateless SSH contract

Built to manage a dual-boot Legion 7 (CachyOS / Windows 11) and desk machines without running a web panel, reverse proxy, or extra auth layer: if SSH works, control works.

Four native clients (SwiftUI on macOS, Kotlin with an embedded SSH client on Android, plus Linux and Windows desktops) invoke a plain Node 24+ ESM agent with zero dependencies. Each command verifies the agent signature and version floor, writes one JSON object to stdout, and exits. Polling stops the moment the UI closes. Clients try the last-seen OS command shape first and fall back across dual-boot targets, so a stale guess costs one round trip and never returns a wrong answer.

Fail-closed busy detection & dual-boot switching

A 15-minute scheduled maintenance pass (systemd, Task Scheduler, or launchd) evaluates every configured busy probe before touching a service or host. For T3 Code, it reads the server's local SQLite state directly to count running turns and pending approvals. Any unreadable probe fails closed: the host counts as busy unless a human passes --force.

OS switching arms one-shot firmware boot (efibootmgr, bcdedit, or grub-reboot) and reads the armed entry back to confirm before issuing the reboot.