This project stores YouTube, Vimeo, and X video transcripts in SQLite, generates summaries with OpenAI, and supports transcript Q&A. It prefers downloaded captions and falls back to local Whisper transcription only when captions are unavailable.
Status: maintained local-first CLI. Transcripts, summaries, Q&A, embeddings, and usage metrics stay in a local SQLite database unless a model request is explicitly made.
- Bun
yt-dlpffmpegwhisper-clifromwhisper.cppOPENAI_API_KEYfor summarization, semantic search, and Q&A
git submodule update --init --recursive
bun installBuild whisper-cli and download a Whisper model before using the local
transcription fallback:
cmake -S whisper.cpp -B whisper.cpp/build
cmake --build whisper.cpp/build --config Release
./whisper.cpp/models/download-ggml-model.sh base.enCreate .env in the project root:
OPENAI_API_KEY=your_openai_api_key_here
WHISPER_CLI_BIN=./whisper.cpp/build/bin/whisper-cli
WHISPER_MODEL_PATH=./whisper.cpp/models/ggml-base.en.bin
TRANSCRIPT_LANGUAGE=enOptional overrides:
MODEL_PROFILE(cheap,balanced, orquality; defaults tocheap)SUMMARY_MODELQA_MODELEMBEDDING_MODELYTDLP_BINFFMPEG_BINTRANSCRIPTS_DBTRANSCRIPT_LANGUAGE(caption and Whisper language; defaults toen)SUMMARY_CHUNK_CONCURRENCY(defaults to3, maximum8)YTDLP_CONCURRENT_FRAGMENTS(Whisper-fallback audio downloads; defaults to8, maximum16)
Model profiles:
cheap:gpt-5.6-lunafor summaries and Q&Abalanced:gpt-5.6-terrafor summaries,gpt-5.6-lunafor Q&Aquality:gpt-5.6-solfor summaries,gpt-5.6-lunafor Q&A
The profiles also set task-appropriate reasoning effort and text verbosity.
Explicit SUMMARY_MODEL and QA_MODEL values override the model while retaining
the selected profile's reasoning and verbosity settings.
bun run youtube
bun run video
bun run doctor
bun run typecheck
bun run testbun run test is scoped to this app's src tests so it does not run unrelated
vendored tests inside whisper.cpp.
An opt-in paid comparison is available for an explicitly selected saved session:
bun run eval --content-id <CONTENT_ID> --profiles cheap,balanced,qualityThe evaluator never chooses content automatically. It requires OPENAI_API_KEY,
makes paid requests, and writes ignored Markdown and JSON results under
eval-results/. Pass --fixture checks.json with optional required and
forbidden string arrays for deterministic content checks.
bun run youtube
bun run videoThe CLI can:
- start a new YouTube, Vimeo, or X video session from a URL
- reopen saved sessions from SQLite
- open the current summary as a proportional-font HTML document with the
ohotkey - export a durable formatted HTML summary from the
emenu - find a saved session semantically with
--find - export stored Q&A to Markdown or JSON
- reuse persisted embeddings for faster semantic find and transcript Q&A
- report and persist model, token usage, latency, and estimated API cost
- validate local dependencies, SQLite, and OpenAI access with
--doctor
Non-interactive usage:
bun run youtube "https://x.com/<USER>/status/<POST_ID>"
bun run video "https://x.com/<USER>/status/<POST_ID>"
bun run youtube --url "https://www.youtube.com/watch?v=<VIDEO_ID>"
bun run youtube --url "https://vimeo.com/<VIDEO_ID>"
bun run youtube --url "https://x.com/<USER>/status/<POST_ID>"
bun run youtube --rerun "https://www.youtube.com/watch?v=<VIDEO_ID>"
bun run youtube --rerun "https://vimeo.com/<VIDEO_ID>"
bun run youtube --rerun "https://x.com/<USER>/status/<POST_ID>"
bun run youtube --find "video about vector databases"
bun run youtube --delete "https://www.youtube.com/watch?v=<VIDEO_ID>"
bun run youtube --delete "https://vimeo.com/<VIDEO_ID>"
bun run youtube --delete "https://x.com/<USER>/status/<POST_ID>"
bun run youtube --doctorThe youtube, video, and start scripts run the same CLI entrypoint:
src/youtube.ts.
Transcripts up to 500,000 characters use one-pass long-context summarization and full-transcript Q&A. Larger transcripts retain chunked summarization and RAG Q&A. If OpenAI rejects a direct summary request for size, the CLI automatically falls back to the chunked path.
The app stores transcripts, summaries, Q&A, and cached embeddings in SQLite.
Schema changes are tracked with SQLite's user_version. Before the first mutation
of an existing database in each process, the app writes a timestamped backup to
db_backups/ and retains the ten newest backups.
Summary and Q&A usage metrics are nullable for old rows. Dollar amounts are
estimates based on the pricing table dated 2026-08-01; arbitrary model overrides
still record tokens and latency but display cost as unavailable.
The application code is split into three main areas:
src/youtube.ts: provider retrieval, summarization, Q&A, and CLI interactionsrc/database.ts: SQLite paths, migrations, backups, and transcript encodingsrc/config.ts: model profiles and environment-driven configurationsrc/openai-metrics.ts: dated token pricing, usage aggregation, and formatting
The application code is available under the MIT License. The whisper.cpp submodule is vendored and remains under its own upstream license.
Run bun run doctor first. It reports missing executables or model files,
database errors, a missing API key, and OpenAI connectivity failures.
- Captions are requested using
TRANSCRIPT_LANGUAGE. If none are available, Whisper uses the same language value. The fallback prefers audio at or below 80 kbps, downloads fragmented streams concurrently, and segments the original audio without a full-file MP3 transcode. - A language-specific Whisper model such as
base.enshould only be used for that language. Use a multilingual Whisper model when changing the language. - Override inaccessible models with
SUMMARY_MODELandQA_MODEL. - Set
TRANSCRIPTS_DBto use a specific database instead of automatic discovery.