diff --git a/bin/super-cli.py b/bin/super-cli.py index 0ba0d39..efad506 100755 --- a/bin/super-cli.py +++ b/bin/super-cli.py @@ -3145,7 +3145,22 @@ def cmd_swarm_list(args): def cmd_swarm_status(args): - cmd = ["python3", str(BIN_DIR / "box-ctl.py"), "swarm-status", args.swarm_id] + sid = args.swarm_id + if not sid.startswith("sw-"): + sid = "sw-" + sid + # Support prefix matching if exact ID is truncated (e.g. 18 chars) + sw_file = Path(__file__).parent.parent / "swarms.json" + if sw_file.exists(): + try: + import json + data = json.loads(sw_file.read_text(encoding="utf-8")) + if sid not in data: + matches = [k for k in data.keys() if k.startswith(sid)] + if len(matches) == 1: + sid = matches[0] + except Exception: + pass + cmd = ["python3", str(BIN_DIR / "box-ctl.py"), "swarm-status", sid] res = subprocess.run(cmd, capture_output=True, text=True) if args.json: sys.stdout.write(res.stdout)