CLI Reference
Complete argument reference for transcript_to_pdf.py — the PDF generation engine powering this app.
Overview
Direct render, no LLM
2 LLM calls, title + summaries
Multi-agent LLM analysis
Input Modes
Pick one input source. When --youtube is given alone (no other input), the transcript is auto-fetched from YouTube.
--inputfiledefault: —Path to a transcript file (.txt .vtt .srt). Triggers the full multi-agent LLM pipeline.
--input-dirdirdefault: —Directory of transcript files. Batch-processes every .txt/.vtt/.srt found inside.
--textstringdefault: —Direct transcript text as a CLI string. Useful for piping short content.
--markdownfiledefault: —Markdown file for direct PDF rendering. No LLM calls — instant conversion.
--smartfiledefault: —Transcript file for the lightweight Smart pipeline (2 LLM calls: title generation + per-section summaries).
--youtubeurldefault: —YouTube URL. When used as the sole input, auto-fetches the transcript via youtube-transcript-api (free, no API key). When combined with --input/--text, only embeds the link in the PDF.
stdinpipedefault: —Pipe content via stdin: cat file.txt | python3 transcript_to_pdf.py
Output Options
--titlestringdefault: auto-detectedDocument title. In YouTube mode, auto-extracted from the video page if not provided.
--output-dirpathdefault: ./outputOutput directory for generated PDFs and intermediate markdown files.
--langstringdefault: auto / zh-HantTarget language code. In YouTube mode, auto-detected from the video title: Chinese title → zh-Hant, English title → en. Explicit --lang always overrides auto-detection.
--no-bgflagdefault: falseSkip the yellow Deep-Research background template. Outputs a clean white PDF.
LLM Tuning Parameters
These control the SIM (Standardized Intent Management) pipeline — how deeply the LLM analyzes, how faithfully it preserves the source, and how freely it translates.
--richnessfloatrange: 0.0 – 10.0 | default: 7.0Thinking depth scale. Controls how much the LLM expands beyond the source material.
0.0Absolute loyalty — 1:1 mapping of source
< 5.0Paraphrasing zone — restructures without adding
≥ 5.0Inference zone — adds analysis and context
≥ 7.0Triggers brainstormer + researcher agents
--loyaltyfloatrange: 0.0 – 1.0 | default: 0.8Faithfulness validation threshold. The loyalty validator checks if the output stays true to the source.
At 1.0, the validation step is skipped entirely.
--expressivefloatrange: 0.0 – 1.0 | default: 0.5Translation freedom. How freely the translator can rephrase when converting between languages.
--elegancyfloatrange: 0.0 – 1.0 | default: 0.5Stylistic polish level. Higher values produce more literary, refined output language.
YouTube Auto-Fetch
When --youtube URL is the only input (no --input or --text), the script fetches the transcript directly from YouTube using the free youtube-transcript-api library. No API key required.
zh-Hantpreferredzh-TWzh-Hanszh-CNzhenfallbackTitle — extracted from YouTube page og:title
Output lang — CJK in title → zh-Hant, else → en
Override — explicit --lang always wins
LLM Provider Chain
For transcript and smart modes, the script tries providers in order until one succeeds. Markdown mode needs no LLM.
Examples
python3 transcript_to_pdf.py --markdown document.md
python3 transcript_to_pdf.py --markdown document.md --title "My Report" --no-bgpython3 transcript_to_pdf.py --youtube "https://www.youtube.com/watch?v=VIDEO_ID"
python3 transcript_to_pdf.py --youtube "https://youtu.be/VIDEO_ID" --lang en --no-bgpython3 transcript_to_pdf.py --smart transcript.txt
python3 transcript_to_pdf.py --smart transcript.txt --title "Video Title"python3 transcript_to_pdf.py --input transcript.txt \
--title "Deep Analysis" --youtube "https://youtu.be/xxx" \
--richness 9 --loyalty 0.6 --expressive 0.7 --elegancy 0.8echo "# Hello World" | python3 transcript_to_pdf.py
cat transcript.txt | python3 transcript_to_pdf.py --title "My Doc" --lang enpython3 transcript_to_pdf.py --input-dir ./transcripts/ --lang zh-Hant