llm plugin
YouTube transcripts in llm CLI
The llm-getyoutubetranscript plugin adds a yt: fragment to Simon Willison's llm tool, so you can pipe any YouTube video's transcript into a prompt with one flag. yt-timed: adds a timestamp to every line.
Set it up
- 1
Install the plugin
In the same environment as llm:
llm install llm-getyoutubetranscript - 2
Store your key
Create a key on the developers page (100 free credits, no card), then save it in llm's key store:
llm keys set getyoutubetranscript - 3
Prompt with a video
Use the yt: fragment with a URL or video ID:
llm -f yt:https://youtu.be/5e37ZT3SQbk "summarize this video in five bullet points"
Things to try
- llm -f yt-timed:dQw4w9WgXcQ "list the key moments with their timestamps"
- llm -f yt:dQw4w9WgXcQ@es "resume este video" (any caption language after @)
- Combine two videos in one prompt with two -f flags and ask how they differ.
Good to know
- Quote the argument if the URL contains ? or &, so your shell leaves it alone.
Links
Questions about llm CLI
Can I use an environment variable instead?
Yes, export GETYOUTUBETRANSCRIPT_API_KEY. A key in llm's key store takes priority over the variable.
What does it cost?
Each transcript, search or channel page uses one credit from your account, and failed requests are not charged. New accounts get 100 free credits, no card, and paid plans add more credits each month.
Use it in your other tools
LangChainAgent tools and a document loader, for Python and LangChain.js.LlamaIndexDrop-in replacement for YoutubeTranscriptReader.HaystackA fetcher component for pipelines and agents.CrewAITranscript, search and channel tools for your crew.Vercel AI SDKTools for generateText and streamText, also usable in Mastra.Pythonpip install getyoutubetranscript. Transcripts, search, channels.Node.jsTyped client for Node.js servers, serverless functions and scripts.