"""Entry point for the TUI application."""

import argparse
import sys


def main() -> int:
    """Run the TUI application."""
    parser = argparse.ArgumentParser(
        description="Proxmox VM Template Builder TUI"
    )
    parser.add_argument(
        "--config-dir",
        metavar="DIR",
        help=(
            "Path to external config directory with user overrides. "
            "Defaults to ~/.config/proxmox-template-builder/ or "
            "$PROXMOX_BUILDER_CONFIG_DIR."
        ),
    )
    args = parser.parse_args()

    from tui.app import LinuxAutomationApp

    app = LinuxAutomationApp(user_config_dir=args.config_dir)
    app.run()
    return 0


if __name__ == "__main__":
    sys.exit(main())
