A powerful command-line tool that leverages AI to turn YouTube video transcripts into concise, well-structured summaries. Perfect for researchers, content creators, and anyone who wants to quickly understand video content without watching the full video.
- 🎯 Extract transcripts from any YouTube video with available captions
- 🤖 Generate AI-powered summaries using your choice of local or cloud LLMs
- 🔍 Ask specific questions about video content with the query mode
- 📝 Multiple summary formats (concise or detailed analysis)
- 🌍 Support for videos with auto-generated captions
- ⚡ Real-time streaming output as summaries are generated
- 💾 Save summaries and transcripts to files
- ⚙️ Extensive configuration options
- 🔒 Secure API key management
-
Install YTS:
# Linux/macOS curl -sSL https://raw.githubusercontent.com/conormkelly/yts-cli/main/install.sh | bash
# Windows irm https://raw.githubusercontent.com/conormkelly/yts-cli/main/install.ps1 | iex
-
Choose and set up a provider:
# For local providers (free, runs on your machine): yts config set provider lmstudio # or ollama
# For cloud providers (requires API key): yts config set provider claude yts apikey set claude your-api-key
-
Generate your first summary:
yts https://www.youtube.com/watch?v=dQw4w9WgXcQ
Choose at least one of these LLM providers:
These run models on your own machine:
- Download from lmstudio.ai
- Compatible with most GGUF models
- Free to use, runs locally
- Download from ollama.ai
- Works with llama2, codellama, mistral, etc.
- Free to use, runs locally
These require API keys:
- Get API key from anthropic.com/api
- Get API key from platform.openai.com
curl -sSL https://raw.githubusercontent.com/conormkelly/yts-cli/main/install.sh | bash
irm https://raw.githubusercontent.com/conormkelly/yts-cli/main/install.ps1 | iex
Prerequisites:
- Go >=1.23
# Clone the repository
git clone https://github.com/conormkelly/yts-cli
cd yts-cli
# Build the binary
make build
# Optional: Install globally
make install
# Basic summary (default: short)
yts https://www.youtube.com/watch?v=video_id
# Long summary
yts -l https://www.youtube.com/watch?v=video_id
# Save to file
yts https://www.youtube.com/watch?v=video_id -o summary.txt
Ask specific questions about a video's content:
# Ask a question about the video
yts https://www.youtube.com/watch?v=video_id -q "Does this video explain quantum computing?"
# Save the query result to a file
yts https://www.youtube.com/watch?v=video_id -q "What are the main points about climate change?" -o answer.txt
Query mode uses the video's title and transcript as context to provide accurate answers based solely on the video content. This is particularly useful for:
- Fact-checking clickbait titles
- Finding specific information in long videos
- Evaluating video content before watching
- Extracting technical details from educational content
Title: Understanding Climate Feedback Loops
Question: What are the three main positive feedback loops mentioned?
The three main positive feedback loops mentioned in the video are:
1. Ice-Albedo Feedback Loop: As ice melts due to warming, dark ocean water is exposed, which absorbs more heat than reflective ice, leading to further warming and more ice melt.
2. Water Vapor Feedback Loop: As temperatures rise, more water evaporates into the atmosphere. Since water vapor is a greenhouse gas, this increases warming, creating a self-reinforcing cycle.
3. Permafrost Methane Release: As permafrost thaws in Arctic regions, it releases trapped methane, which is a potent greenhouse gas that causes additional warming, leading to more permafrost thaw.
The video emphasizes that these positive feedback loops have the potential to accelerate climate change beyond current predictions if they reach tipping points.
Title: Understanding Quantum Computing Basics
Core Message: Quantum computing harnesses quantum mechanical phenomena to solve
specific problems exponentially faster than classical computers.
Key Points:
1. Qubits can exist in multiple states simultaneously through superposition
2. Quantum entanglement enables powerful parallel processing capabilities
3. Current practical limitations include decoherence and error correction
4. Most promising applications include cryptography and molecular simulation
Call to Action: Researchers encouraged to explore IBM's quantum computing cloud platform.
Title: Understanding Quantum Computing Basics
1. Executive Summary
Comprehensive introduction to quantum computing fundamentals, explaining how quantum
mechanics enables new computing paradigms. The presentation covers basic principles,
current challenges, and practical applications.
2. Key Concepts Covered
- Quantum superposition and its role in computation
- Entanglement as a computational resource
- Quantum gates and circuit model
- Error correction challenges and solutions
[... continues with more detailed analysis ...]
Get video transcripts with various formatting options:
# Display formatted transcript (default)
yts transcript https://www.youtube.com/watch?v=dQw4w9WgXcQ
# Display raw unformatted transcript
yts transcript --raw https://www.youtube.com/watch?v=dQw4w9WgXcQ
# Include timestamps in the output
yts transcript --timestamps https://www.youtube.com/watch?v=dQw4w9WgXcQ
# Combine flags (raw output with timestamps)
yts transcript --raw --timestamps https://www.youtube.com/watch?v=dQw4w9WgXcQ
# Save to file (works with any flag combination)
yts transcript -o transcript.txt https://www.youtube.com/watch?v=dQw4w9WgXcQ
Flags:
-o, --output
: Save transcript to a file-r, --raw
: Output raw transcript without AI formatting-t, --timestamps
: Include timestamps in the output
Before (raw transcript):
hey guys today were gonna talk about quantum computing its pretty cool and it uses
these things called qubits which are different from regular bits
After:
Hey guys! Today we're gonna talk about quantum computing. It's pretty cool and it
uses these things called qubits, which are different from regular bits.
# Set default provider
yts config set provider lmstudio # or: ollama, claude, openai
# Override for single command
yts -p ollama https://youtube.com/watch?v=video_id
For cloud providers, securely store your API keys:
# Store API keys in system keyring
yts apikey set claude your-api-key
yts apikey set openai your-api-key
# Remove stored keys
yts apikey delete claude
yts apikey delete openai
# Verify key status
yts config view
# View current settings
yts config view
# Edit configuration file
yts config edit
# Set individual values
yts config set providers.claude.temperature 0.7
# Global
provider # Active provider selection
version # Configuration version
# Query Settings
queries.system_prompt # Template for answering questions about videos
# LM Studio Settings
providers.lmstudio.base_url # API endpoint
providers.lmstudio.model # Model name
# Ollama Settings
providers.ollama.base_url # API endpoint
providers.ollama.model # Model name
# Claude Settings
providers.claude.model # Model name
providers.claude.temperature # Generation temperature (0.0-1.0)
providers.claude.max_tokens # Maximum response tokens
providers.claude.timeout_seconds # API timeout
providers.claude.max_retries # Retry attempts
# OpenAI Settings
providers.openai.model # Model name
providers.openai.temperature # Generation temperature
providers.openai.max_tokens # Maximum response tokens
providers.openai.timeout_seconds # API timeout
providers.openai.max_retries # Retry attempts
providers.openai.organization_id # Optional org ID
- Linux:
~/.config/yts/config.json
- macOS:
~/Library/Application Support/yts/config.json
- Windows:
%AppData%\yts\config.json
Override settings using environment variables:
# Provider Selection
export YTS_PROVIDER=claude
# LM Studio
export YTS_LMSTUDIO_URL=http://localhost:1234
export YTS_LMSTUDIO_MODEL=llama-2-13b-chat
# Ollama
export YTS_OLLAMA_URL=http://localhost:11434
export YTS_OLLAMA_MODEL=mistral
# Claude
export YTS_CLAUDE_MODEL=claude-3-sonnet-20240229
export YTS_CLAUDE_TEMPERATURE=0.7
export YTS_CLAUDE_MAX_TOKENS=4096
export YTS_CLAUDE_TIMEOUT=120
# OpenAI
export YTS_OPENAI_MODEL=gpt-4
export YTS_OPENAI_TEMPERATURE=0.7
export YTS_OPENAI_MAX_TOKENS=4096
export YTS_OPENAI_TIMEOUT=120
export YTS_OPENAI_ORG_ID=org-...
-
"No transcript found"
- Verify the video has captions enabled
- For non-English videos, auto-translated captions may not be available
- Some videos have disabled transcripts - try another video
-
"Provider not responding"
- Local providers (LM Studio/Ollama):
- Verify the service is running
- Check the correct port is set
- Ensure model is properly loaded
- Cloud providers (Claude/OpenAI):
- Verify API key is correct
- Check internet connectivity
- Confirm API service status
- Local providers (LM Studio/Ollama):
-
"Rate limiting/Quota exceeded"
- Cloud providers: Check your API quota and limits
- Consider switching to local providers for high-volume use
- Implement exponential backoff in scripts
-
Performance Considerations
- Large videos (>1 hour) may take longer to process
- Local providers are generally slower but free
- Cloud providers offer faster processing but incur costs
- Network speed affects transcript download time
-
Transcript Fetching
- Extracts captions directly from YouTube
- Supports both manual and auto-generated captions
- Handles multiple languages and formats
- Processes raw XML into clean text
-
AI Processing
- Sends raw transcript to chosen LLM
- Uses optimized prompts for different summary types
- Streams completions for real-time feedback
- Implements retry logic and error handling
-
Output Handling
- Real-time streaming to terminal
- Optional file output
- Proper text formatting and sanitization
- Error handling and logging
- Transcript fetching: 1-3 seconds
- Summary generation:
- Local providers: 30-120 seconds
- Cloud providers: 10-30 seconds
- Maximum video length: None (but longer videos = longer processing)
- Transcript availability depends on YouTube
- Rate limits apply for cloud providers
- Local processing speed depends on hardware
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
This tool accesses publicly available YouTube video transcripts. While I believe this falls under fair use:
- Review YouTube's Terms of Service
- Use responsibly and respect rate limits
- Consider YouTube's official API for commercial applications
- Don't use for mass data collection
This project is licensed under the MIT License - see the LICENSE file for details.
- Transcript handling inspired by youtube-transcript-api
- Built with Cobra CLI framework
- Configuration managed with Viper
- Secure key storage by go-keyring