comicbox.formats.base.online.prompt

source module comicbox.formats.base.online.prompt

Default CLI selector — a questionary-based interactive prompt.

Used when no programmatic selector is registered and stdin is a TTY. Falls back to a plain input() loop in non-TTY environments and when questionary import fails.

Layout matches the Phase 4 spec

Ambiguous match for Existing: series=<…> issue=#<…> year=<…> publisher=<…>

  1. # () score= [:] publisher=<…>, pages=<…>, cover_date=<…>

s. Skip this file m. Enter ID manually o. Session options … q. Abort entire run

Display rules

  • Top 9 candidates max.
  • cover_score shown in parens after score when hashing was invoked.
  • Honors --terse / -Q quiet by trimming auxiliary lines.

Session options (nested under o) let the user switch the rest of this run to unattended mode or change the match policy (ask / careful / auto / eager). These exist as flat SelectorResult actions in the API but are tucked behind a submenu in the CLI so the primary prompt stays uncluttered.

Functions

source cli_selector(profile: ComicProfile, candidates: Sequence[Candidate], ctx: SelectorContext)SelectorResult

Default CLI prompt selector.

Uses questionary.select when available + TTY; falls back to a plain input() loop otherwise. Loops on m and o (session options submenu) until the user enters a valid id, skips, or aborts.