import asyncio
import functools


def async_entrypoint(async_func):
    """Decorator required for entrypoint functions (after the Typer app decorator).
    Allows running async functions as entrypoints."""
    def wrapper(*args, **kwargs):
        loop = asyncio.get_event_loop()
        return loop.run_until_complete(async_func(*args, **kwargs))
    return functools.update_wrapper(wrapper, async_func)