import argparse
import time
from .core import init_radar


def main():
    parser = argparse.ArgumentParser(description="RADAR AI CLI")

    parser.add_argument("--project-id", required=True)
    parser.add_argument("--secret", required=True)
    parser.add_argument("--service", default="backend")

    args = parser.parse_args()

    init_radar(
        project_id=args.project_id,
        secret=args.secret,
        service=args.service,
    )

    print("🚀 RADAR running... Press Ctrl+C to stop.")

    try:
        while True:
            time.sleep(60)
    except KeyboardInterrupt:
        print("🛑 RADAR stopped.")