scripts/preflight.ts validates that every required env var is set, then checks live connectivity to the database, the Better Auth adapter (instance builds + user table readable), SMTP and Immich. Prints OK/FAIL per check and exits non-zero on any failure. Run it when bringing up the box to catch missing env vars and dead connections before going live. Co-Authored-By: Claude <noreply@anthropic.com>