INNER CODE UNIT · Python
cmd_doctor
ghost-in-the-droid/android-agent · gitd/cli.py:678
def cmd_doctor(args):
"""Print a green/red preflight checklist and exit non-zero on any failure."""
checks = collect_doctor_checks()
print("Ghost in the Droid — doctor\n")
for c in checks:
icon = _DOCTOR_ICON.get(c["status"], "?")
line = f" {icon} {c['name']}: {c['detail']}"
print(line)
if c["hint"] and c["status"] != "ok":
print(f" → {c['hint']}")
failed = [c for c in checks if c["status"] == "fail"]
warned = [c for c in checks if c["status"] == "warn"]
print()
if failed:
print(f"{len(failed)} problem(s) must be fixed before Ghost will run.")
return 1
if warned:
print(f"Ready, with {len(warned)} warning(s).")