vocal_helper.cli_click module

Vocal Helper — click-based command-line interface.

Twin of vocal_helper.cli_argparse: same public surface (identical subcommand names, identical flag semantics), but implemented with click so users who already have a click-native shell setup (bash / zsh completion via click.shell_completion, colored --help, nested command groups) can plug it in without friction. Installed as the vocal-helper-click entry point in pyproject.toml.

Design notes

  • Subcommands mirror vocal-helper (the argparse twin) so both CLIs expose the same operations under symmetric, predictable names.

  • Flags reuse the argparse names (--whisper-model, --language, --diar-backend, …) rather than the more idiomatic click positional style — consistency across the two CLIs beats micro-idiomaticity.

  • Async work is wrapped in asyncio.run() inside each command; click itself stays sync.

Usage Example

>>> #   vocal-helper-click mic --llm --jsonl
>>> #   vocal-helper-click file meeting.wav --offline --language en
>>> #   vocal-helper-click url "https://youtu.be/…" --language fr
>>> #   vocal-helper-click transcribe clip.wav --language en

Author

Warith Harchaoui, Ph.D. , https://linkedin.com/in/warith-harchaoui/

vocal_helper.cli_click.main()[source]

Console entry point (vocal-helper-click).

click’s own main() only special-cases ClickException/Abort (and a broken pipe); a plain library exception would otherwise propagate as a raw Python traceback instead of a clean CLI error. This wraps the whole invocation and translates that last case into a one-line stderr message + exit 1 — click’s own control flow (usage errors, --help, an explicit sys.exit in a subcommand) already raises SystemExit, a BaseException this does not catch, so it passes through untouched.

Return type:

None