A URL/article summarizer CLI powered by Groq AI. Fetch any URL, extract the article, and get an AI-powered summary — all from your terminal.
Sign up at console.groq.com and create an API key. No credit card required.
git clone https://github.com/TRINITY-21/tldr.git
cd tldr
pip install -r requirements.txtcp .env.example .envOpen .env and add your API key:
GROQ_API_KEY=gsk_your_key_here
python tldr.py <command> [options]python tldr.py summarize "https://www.paulgraham.com/greatwork.html"╭───────────────────────────────── 📄 Article ─────────────────────────────────╮
│ Title: How to Do Great Work │
│ Date: 2023-01-01 │
│ Words: 11,822 │
│ URL: https://www.paulgraham.com/greatwork.html │
╰──────────────────────────────────────────────────────────────────────────────╯
🤖 Summarizing with llama-3.3-70b-versatile...
The article by Paul Graham discusses how to do great work, emphasizing the
importance of finding something you have natural aptitude for and deep interest
in, then working hard enough to reach the frontier of knowledge.
| Flag | Description | Default |
|---|---|---|
--length brief/detailed |
Summary length | brief |
--bullets |
Key points as a bullet list | off |
--lang <language> |
Translate summary to another language | none |
--save <file> |
Save output to a markdown file | none |
--fast |
Use faster model (llama-3.1-8b) | off |
# Bullet-point key takeaways
python tldr.py summarize "https://example.com/article" --bullets
# Detailed 3-4 paragraph summary
python tldr.py summarize "https://example.com/article" --length detailed
# Summarize in Spanish
python tldr.py summarize "https://example.com/article" --lang spanish
# Save summary to markdown
python tldr.py summarize "https://example.com/article" --bullets --save summary.md
# Use faster model for quicker results
python tldr.py summarize "https://example.com/article" --fastBullet points output:
🤖 Summarizing with llama-3.3-70b-versatile...
• AI adoption in enterprise has doubled since 2024
• Open-source models now rival proprietary ones
• Key bottleneck has shifted from compute to data quality
• Regulation remains fragmented across regions
• Three emerging trends: agents, multimodal, on-device
python tldr.py ask "https://en.wikipedia.org/wiki/Python_(programming_language)" "Who created Python and when?"╭───────────────────────────────── 📄 Article ─────────────────────────────────╮
│ Title: Python (programming language) - Wikipedia │
│ Date: 2001-10-29 │
│ Words: 11,530 │
│ URL: https://en.wikipedia.org/wiki/Python_(programming_language) │
╰──────────────────────────────────────────────────────────────────────────────╯
❓ Who created Python and when?
🤖 Answering with llama-3.3-70b-versatile...
Guido van Rossum created Python. He began working on Python in the late 1980s,
and the first version, Python 0.9.0, was released in 1991.
| Flag | Description |
|---|---|
--save <file> |
Save Q&A to markdown |
--fast |
Use faster model |
# Pipe HTML from curl
curl -s https://example.com/article | python tldr.py summarize -
# Pipe a local file
cat article.html | python tldr.py summarize -| Concern | Tool |
|---|---|
| Language | Python |
| CLI framework | Click |
| Terminal styling | Rich |
| Article extraction | trafilatura |
| AI summarization | Groq (Llama 3.3 70B / Llama 3.1 8B) |
| Env config | python-dotenv |
tldr/
├── tldr.py # CLI entry point — commands and routing
├── extractor.py # Article extraction (URL → clean text + metadata)
├── groq_client.py # Groq API client (prompts, streaming, model selection)
├── display.py # Rich-based terminal output (panels, streaming, errors)
├── .env # Your API key (gitignored)
├── .env.example # Template
├── .gitignore
└── requirements.txt
| Model | Speed | Quality | Free Tier |
|---|---|---|---|
llama-3.3-70b-versatile (default) |
Fast | Best | 1K req/day |
llama-3.1-8b-instant (--fast) |
Fastest | Good | 14.4K req/day |
MIT