from __future__ import annotations

from app.core.mongo_runtime import clear_mongo_runtime, init_mongo_runtime
from app.startup import ensure_admin_user


def main() -> int:
    runtime = init_mongo_runtime()
    try:
        result = ensure_admin_user(runtime.sync_database)
        print(f"Admin bootstrap status: {result['status']} ({result['username']})")
        return 0
    finally:
        clear_mongo_runtime(runtime)


if __name__ == "__main__":
    raise SystemExit(main())
