from dataclasses import dataclass
from typing import cast

import typer
from rich.console import Console


@dataclass
class AppContext:
    console: Console
    verbose: bool = False


def get_context(ctx: typer.Context) -> AppContext:
    return cast(AppContext, ctx.obj)
