Argument parsing, subcommand dispatch, and pipeline invocation.
Source: screencastgen/cli.py
Entry point: screencastgen (console script) or python -m screencastgen
The CLI is the primary user-facing entry point. It builds an argparse parser with subcommands, parses arguments, and dispatches to the appropriate pipeline runner.
main(argv=None) -> intTop-level entry point. Parses args and dispatches to the selected subcommand runner.
_build_parser() -> argparse.ArgumentParserConstructs the argument parser with subcommands:
audio — Run the Audio Pipelinehighlight — Run the Highlight Pipelinelipsync — Run the Lipsync Pipelinevisualize — Run the Visualization Pipelinedownload-models — Download ML models via Modelsdoctor — Validate the active environment via DoctorRegisters backend-specific arguments from TTS Registry and alignment/lipsync provider args.
run_audio_pipeline(args) -> intrun_highlight_pipeline(args) -> intrun_lipsync_pipeline(args) -> intThin wrappers that delegate to the corresponding pipeline runner in Audio Pipeline, Highlight Pipeline, Lipsync Pipeline.
run_visualization_pipeline(args) -> intDelegates to Visualization Pipeline.
run_download_models(args) -> intDelegates to download_selected_models() in Models.
run_doctor(args) -> intDelegates to run_doctor() in Doctor. The diagnostic module is imported only when the command runs.
cli.py
├── screencastgen.__init__ (version)
├── Constants (defaults)
├── Audio Pipeline (run_audio_pipeline)
├── Highlight Pipeline (run_highlight_pipeline, parse_resolution)
├── Lipsync Pipeline (run_lipsync_pipeline)
├── Visualization Pipeline (run_visualization_pipeline)
├── Pipeline Common (extract_and_chunk, synthesize_chunks)
├── Models (register/download)
├── Doctor (environment diagnostics)
├── TTS Registry (backend names, arg registration)
├── Aligner (provider names)
└── Lipsync Facade (provider names)
# Audio only
screencastgen audio MyBook.pdf --backend qwen --device cuda
# Highlighted text video
screencastgen highlight MyBook.pdf --backend qwen
# Lip-sync video
screencastgen lipsync MyBook.pdf --backend qwen --ref-audio voice.wav --ref-video face.mp4 --format reader
# Generated visualization
screencastgen visualize --prompt "Explain tangent slope" --renderer manimgl
# Remote GPU
screencastgen audio MyBook.pdf --backend remote --tts-server-url http://gpu:8100
# Download models
screencastgen download-models --backend qwen --package whisperx
# Validate an installed profile without changing it
screencastgen doctor --profile remote-client --server-url http://gpu:8100
screencastgen-server)