"""Typed CLI context."""

import typer
from mm_clikit import CoreContext
from mm_clikit import use_context as _use_context

from mb_stash.cli.output import Output
from mb_stash.core import Core


def use_context(ctx: typer.Context) -> CoreContext[Core, Output]:
    """Extract typed core context from Typer context."""
    return _use_context(ctx, CoreContext[Core, Output])


def password_prompt() -> str:
    """Prompt user for master password."""
    result: str = typer.prompt("Enter master password", hide_input=True)
    return result
