vocal_helper.cli module
Vocal Helper — the vocal-helper command-line interface.
Thin wrapper around the async vocal_helper.Pipeline /
vocal_helper.OfflinePipeline orchestrators that exposes the
toolkit as subcommands under a single entry point, built with
click.
Subcommands
mic— live microphone input (needs the[mic]extra)file— replay a mono 16 kHz WAV through the pipelineurl— stream from any URL yt-dlp can reach ([stream]extra)transcribe— one-shot transcription of a WAV file
Every pipeline subcommand accepts a common core of --whisper-model /
--language / --diar-backend / --llm / --jsonl levers ; see
vocal-helper <subcommand> --help for the full surface.
Design notes
Async work is wrapped in
asyncio.run()inside each command ; click itself stays sync.This module also owns the diarization decisions the HTTP surface shares (
_route_backend(),_choose_file_diar()), so the study-grounded router is enforced from exactly one place.
Usage Example
>>> # vocal-helper mic --llm --jsonl
>>> # vocal-helper file meeting.wav --offline --language en
>>> # vocal-helper url "https://youtu.be/…" --language fr
>>> # vocal-helper transcribe clip.wav --language en
- vocal_helper.cli.main()[source]
Console entry point (
vocal-helper).click’s own
main()only special-casesClickException/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 explicitsys.exitin a subcommand) already raisesSystemExit, aBaseExceptionthis does not catch, so it passes through untouched.- Return type:
None