diff --git a/skills/remote.py b/skills/remote.py index e690db9..a66e5fe 100644 --- a/skills/remote.py +++ b/skills/remote.py @@ -253,9 +253,24 @@ def cmd_screenshot_window(args): return out_path +def _script_commit() -> str: + """Return the git commit hash of remote.py itself.""" + import subprocess, os + try: + r = subprocess.run( + ["git", "log", "-1", "--format=%h", "--", __file__], + capture_output=True, text=True, + cwd=os.path.dirname(os.path.abspath(__file__)) + ) + return r.stdout.strip() or "unknown" + except Exception: + return "unknown" + + def cmd_status(args): - """Show relay, server, and client version/commit in one call.""" + """Show relay, remote.py, and client commit in one call.""" import requests as _requests + # 1. Relay (public endpoint, no auth) try: r = _requests.get(f"{BASE_URL}/version", timeout=10) @@ -272,12 +287,14 @@ def cmd_status(args): client = {"commit": str(e)} relay_commit = relay.get("commit", "?") + script_commit = _script_commit() client_commit = client.get("commit", "?") - in_sync = "✅" if relay_commit == client_commit else "⚠️ " + all_same = relay_commit == script_commit == client_commit - print(f" relay {relay_commit}") - print(f" client {client_commit}") - print(f" {in_sync} {'in sync' if relay_commit == client_commit else 'OUT OF SYNC — client needs update'}") + print(f" relay {relay_commit}") + print(f" remote.py {script_commit}") + print(f" client {client_commit}") + print(f" {'✅ all in sync' if all_same else '⚠️ OUT OF SYNC'}") def cmd_server_version(_args):