Standalone YouTube transcript skill and CLI toolkit (no MCP server).
This repository is designed for agent workflows where transcript retrieval is handled by Python, and summary/insight generation is handled by AI (preferably in a sub-agent to save context).
This skill works with any agent host that can:
- load
skills.sh-style skills (SKILL.md) - execute local Python commands
- optionally run an AI sub-agent/tool for summarization
SKILL.md: agent instructions for transcript workflowsyoutube_transcript_tool.py: Python CLI for transcript/language retrievaltests/: unit tests for parsing, mode routing, and payload shape
This project intentionally avoids MCP transport.
- Retrieval: done locally with Python +
youtube-transcript-api - Summarization: done by AI agents after retrieval
- Context optimization: use sub-agents when available so raw transcript tokens do not bloat the main conversation context
- Python 3.10+
youtube-transcript-api
python3 -m venv .venv
./.venv/bin/pip install youtube-transcript-apiIf your shell supports activation, you can also do:
source .venv/bin/activate
pip install youtube-transcript-apiThis repository is for skills.sh-compatible agent environments.
Install from GitHub:
npx skills add https://github.com/fabriqaai/fabriqaai-youtube-transcript --skill youtube-transcriptAfter install, restart your agent host so the skill is reloaded.
Expected result:
- skill is installed under your host's skills directory
SKILL.mdis discoverable by the agent
Examples by host:
- Codex:
~/.codex/skills/youtube-transcript - Agent setups that use project-local skills:
.agents/skills/youtube-transcript
python3 youtube_transcript_tool.py \
--mode transcript \
--url "https://www.youtube.com/watch?v=VIDEO_ID" \
--lang en \
--include-timestamps truepython3 youtube_transcript_tool.py \
--mode transcript \
--url "VIDEO_ID" \
--include-timestamps falsepython3 youtube_transcript_tool.py \
--mode languages \
--url "https://youtu.be/VIDEO_ID"Use this two-step flow for high-quality results and better context control:
- Retrieve transcript text:
python3 youtube_transcript_tool.py \
--mode transcript \
--url "VIDEO_ID" \
--include-timestamps false \
--json true- Summarize with AI:
- Preferred: delegate to a sub-agent if available.
- Fallback: summarize in the current agent.
Sub-agent-first approach keeps large transcript content out of your main context window.
--mode(required):transcript,languages,analyze--url(required): YouTube URL or 11-char video ID--lang(defaulten): preferred transcript language--include-timestamps(defaulttrue): timestamped entries in transcript mode--analysis-type(defaultsummary): only foranalyzemode--max-items(default5): output limit for analysis mode--json(defaulttrue): JSON output for machine-friendly pipelines
Note: this skill's recommended summary path is AI summarization after transcript retrieval (preferably in a sub-agent).
{
"ok": true,
"mode": "transcript",
"video_id": "dQw4w9WgXcQ"
}{
"ok": false,
"error": {
"code": "no_transcript",
"message": "...",
"hint": "Try another language or use --mode languages"
}
}invalid_video_idtranscripts_disabledno_transcriptvideo_unavailablerate_limiteddependency_missingtranscript_fetch_failedapi_compat_errortranscript_parse_error
The script supports multiple package API styles to remain resilient across versions:
- static-style calls such as
YouTubeTranscriptApi.get_transcript(...) - list calls such as
YouTubeTranscriptApi.list_transcripts(...) - instance-style variants such as
api.list(...)/api.fetch(...)
This compatibility layer helps avoid breakage when package internals evolve.
Run tests:
python3 -m unittest discover -s tests -vCurrent tests cover:
- boolean parsing
- YouTube ID normalization
- mode routing logic
- fallback language selection
- summary payload shape
- error payload shape
.
├── README.md
├── SKILL.md
├── tests/
│ └── test_youtube_transcript_tool.py
└── youtube_transcript_tool.py