#!/usr/bin/env python3
"""
Convenience script to start the Video Production Pipeline web server.

Usage:
    python run_web.py               # http://localhost:8000
    python run_web.py --port 3000   # http://localhost:3000
"""

import argparse
import os
import uvicorn


def main():
    parser = argparse.ArgumentParser(description="Start the web interface")
    parser.add_argument("--host", default=os.getenv("VISIONARYFX_HOST", "0.0.0.0"),
                        help="Bind address (default: 0.0.0.0)")
    parser.add_argument("--port", type=int,
                        default=int(os.getenv("VISIONARYFX_PORT", "8000")),
                        help="Port (default: 8000)")
    parser.add_argument("--reload", action="store_true", help="Enable auto-reload for development")
    args = parser.parse_args()

    print(f"\n  Video Production Pipeline")
    print(f"  http://localhost:{args.port}\n")

    uvicorn.run(
        "web.app:app",
        host=args.host,
        port=args.port,
        reload=args.reload,
    )


if __name__ == "__main__":
    main()
