Feed a YouTube video into your agent's context.
Give the agent a URL. It runs this CLI, gets the captions, and answers from that text. It does not watch the video or guess from memory.
Download a binary from GitHub Releases (linux, macOS, Windows; amd64 and arm64). Archives are named youtube-transcript_<os>_<arch>.tar.gz (.zip on Windows).
Or install from source:
go install github.com/hasangenc0/youtube-transcript/cmd/youtube-transcript@latestInstall the skill with the skills CLI:
npx skills add hasangenc0/youtube-transcript -gThen paste a youtube.com or youtu.be URL and ask for a recap, quotes, or whether it said something.
-g installs for your user account (Claude Code, Cursor, Codex, Copilot, and the other harnesses the CLI supports). Add -y to skip prompts.
npx skills add hasangenc0/youtube-transcript --list
npx skills add https://github.com/hasangenc0/youtube-transcript -gnpx skills copies .agents/skills/summarize-youtube-video. It does not install the Go binary. youtube-transcript still has to be on PATH.
Manual fallback if you are not using the skills CLI:
ln -s "$(pwd)/.agents/skills/summarize-youtube-video" "$SKILLS_DIR/summarize-youtube-video"Typical asks:
- Summarize a talk, lecture, or review you were sent and do not want to watch end to end
- Pull timestamped quotes for notes, an issue, or a post
- Ask whether a long video mentioned a specific claim, product, or person
A two-hour transcript will not fit in most context windows. The skill writes long captions to /tmp and summarizes in timestamp windows, then merges. Do not dump the whole file into one prompt.
youtube-transcript "https://www.youtube.com/watch?v=VIDEO_ID"Prints timestamped captions to stdout. Pipe it, capture it, or let the agent read the command output.
Write a file with -o (prints the path):
youtube-transcript "https://youtu.be/VIDEO_ID" -o ~/Desktop/transcript.txtFrom a clone: go install ./cmd/youtube-transcript. Without installing: go run ./cmd/youtube-transcript URL.
Prefer a language other than English:
youtube-transcript "https://www.youtube.com/watch?v=VIDEO_ID" --lang deIf that language is missing, the program uses the first available track. A bare 11-character video ID works in place of a URL. -o - is stdout.
One caption per line:
[00:00] I've made a lot of content over the
[00:01] years about renting versus owning a
[00:03] home, showing that renters in Canada can
Videos longer than an hour use [HH:MM:SS]. Existing -o files are overwritten.
- Go 1.22 or newer
- Network access to YouTube
- Captions already on the video (manual or auto-generated)
No API key. This talks to YouTube's Innertube player API and timedtext tracks. It does not transcribe audio.
https://www.youtube.com/watch?v=VIDEO_IDhttps://youtu.be/VIDEO_IDhttps://www.youtube.com/shorts/VIDEO_IDhttps://www.youtube.com/embed/VIDEO_IDhttps://www.youtube.com/live/VIDEO_IDm.youtube.comandmusic.youtube.com
Extra query params (t=, feature=) are ignored.
Bad URLs, private or unavailable videos, and videos with no captions print to stderr and exit 1.
YouTube sometimes blocks datacenter IPs. Retry from another network if you get a request or IP error.
go test ./...
go run ./evalPush a version tag. GitHub Actions runs GoReleaser and publishes the archives.
git tag v0.1.0
git push origin v0.1.0