glance-cli 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +200 -686
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to glance-cli will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.8.1] - 2026-01-02
9
+
10
+ ### Changed
11
+ - Streamlined README for better npm presentation
12
+ - Minor documentation improvements
13
+
8
14
  ## [0.8.0] - 2026-01-02
9
15
 
10
16
  ### Added
package/README.md CHANGED
@@ -1,17 +1,13 @@
1
1
  # glance-cli
2
2
 
3
- **AI-powered web reader for your terminal** – Fetch any webpage, extract clean content, summarize with AI (local or cloud), or ask questions about it.
3
+ **AI-powered web reader for your terminal** – Fetch any webpage, extract clean content, and get instant AI summaries.
4
4
 
5
- - **100% FREE by default**: Auto-detects and uses Ollama (local AI) - no API keys needed!
6
- - **Local-first**: Run offline with Ollama models (e.g., Llama 3, Mistral, Gemma)
7
- - **Optional cloud support**: OpenAI (GPT series) and Google Gemini for premium quality
8
- - **Smart fallback**: Automatically uses best available service (prefers free)
9
- - **Voice output**: Listen to summaries with free system TTS or premium ElevenLabs
10
- - **Production-ready**: Expert prompt engineering, comprehensive error handling, intelligent caching
11
- - **Privacy-focused**: Your data stays local with Ollama - no cloud required
12
- - **Built with Bun**: Lightning-fast startup, TypeScript, battle-tested
5
+ - **100% FREE by default** Uses local Ollama (no API keys needed!)
6
+ - **Privacy-first** Your data stays on your machine
7
+ - **Lightning fast** Built with Bun and TypeScript
8
+ - **Production-ready** Smart caching, error handling, and retry logic
13
9
 
14
- `glance` turns any webpage into terminal-friendly insights — no browser needed.
10
+ Turn any webpage into terminal-friendly insights — no browser needed.
15
11
 
16
12
  [![npm version](https://badge.fury.io/js/glance-cli.svg)](https://www.npmjs.com/package/glance-cli)
17
13
  [![Downloads](https://img.shields.io/npm/dm/glance-cli.svg)](https://www.npmjs.com/package/glance-cli)
@@ -19,504 +15,253 @@
19
15
 
20
16
  ---
21
17
 
22
- ## Highlights
23
-
24
- ### 🎯 **Expert Prompt Engineering**
25
- Advanced prompt templates engineered for superior AI results:
26
- - **Structured outputs** with quality constraints
27
- - **Anti-hallucination** measures (only facts from source)
28
- - **Task-specific optimization** (TL;DR, key points, ELI5, Q&A)
29
- - **10x better results** than generic prompts
30
-
31
- ### 🛡️ **Production-Grade Reliability**
32
- Built for real-world use:
33
- - **Automatic retries** with exponential backoff
34
- - **Timeout protection** (no infinite hangs)
35
- - **Comprehensive error handling** with actionable hints
36
- - **Graceful degradation** on failures
37
- - **Memory leak prevention** (guaranteed resource cleanup)
38
-
39
- ### 💾 **Intelligent Caching**
40
- Smart caching for speed and cost savings:
41
- - **TTL-based expiration** (24h default, configurable)
42
- - **Automatic compression** (70% space savings)
43
- - **LRU eviction** (100MB max, configurable)
44
- - **Cache statistics** (hit rate, size, performance metrics)
45
- - **Tag-based organization** for easy management
46
-
47
- ### 📊 **Rich Content Extraction**
48
- Advanced content detection and extraction:
49
- - **Intelligent scoring algorithm** (picks best content, not first)
50
- - **Structure preservation** (headings, lists, paragraphs)
51
- - **Comprehensive metadata** (20+ fields including author, dates, reading time)
52
- - **Table extraction** with structure preservation
53
- - **Code block detection** with language identification
54
- - **Link categorization** (internal/external/anchor)
55
-
56
- ### 🎨 **Multiple Output Formats**
57
- Export in any format you need:
58
- - **Terminal** – Colorful, emoji-rich display
59
- - **Markdown** – Perfect for documentation
60
- - **JSON** – Structured data for APIs
61
- - **HTML** – Styled, embeddable webpages
62
- - **Plain Text** – Script-friendly, pipeable
63
-
64
- ### 🎙️ **Voice/TTS Output**
65
- Listen to summaries instead of reading:
66
- - **ElevenLabs integration** – Premium, natural-sounding voices
67
- - **Local TTS fallback** – Works offline (macOS Say, Windows SAPI, Linux espeak)
68
- - **Audio export** – Save summaries as MP3 files
69
- - **Multiple voices** – Choose from various voice profiles
70
- - **No API key required** – Falls back to system TTS automatically
71
-
72
- ---
73
-
74
- ## 📦 Installation
18
+ ## Quick Start
75
19
 
76
- ### Via npm (global)
77
20
  ```bash
21
+ # Install
78
22
  npm install -g glance-cli
79
- ```
80
23
 
81
- ### Via Bun (recommended fastest)
82
- ```bash
83
- bun add -g glance-cli
24
+ # Use immediately (works without setup!)
25
+ glance https://example.com
84
26
  ```
85
27
 
86
- ### Standalone Binary (no Node/Bun required)
87
- Download pre-compiled binaries from [Releases](https://github.com/jkenley/glance-cli/releases).
88
-
89
- **macOS/Linux:**
28
+ **For 100% free local AI:**
90
29
  ```bash
91
- curl -L https://github.com/jkenley/glance-cli/releases/latest/download/glance-$(uname -s)-$(uname -m) -o /usr/local/bin/glance
92
- chmod +x /usr/local/bin/glance
93
- ```
30
+ # One-time setup (~4GB download)
31
+ curl -fsSL https://ollama.com/install.sh | sh
32
+ ollama pull llama3
94
33
 
95
- **Windows:**
96
- Download the `.exe` from [Releases](https://github.com/jkenley/glance-cli/releases) and add to PATH.
34
+ # Now completely free forever
35
+ glance https://nextjs.org/docs --tldr
36
+ ```
97
37
 
98
38
  ---
99
39
 
100
- ## 🆓 Free Setup (No API Keys!)
101
-
102
- Want to use glance completely free? Just install Ollama:
40
+ ## 🎯 Why Glance?
103
41
 
104
- ```bash
105
- # 1. Install Ollama (one-time setup)
106
- curl -fsSL https://ollama.com/install.sh | sh # macOS/Linux
107
- # Or download from: https://ollama.com/download
108
-
109
- # 2. Download a model (one-time, ~4GB)
110
- ollama pull llama3
111
-
112
- # 3. That's it! Glance will auto-detect and use it
113
- glance https://example.com
114
- ```
42
+ | Feature | Glance + Ollama | Traditional AI Tools |
43
+ |---------|-----------------|---------------------|
44
+ | **Cost** | $0 forever | $20-100/month |
45
+ | **Privacy** | 100% local | Cloud-based |
46
+ | **Speed** | 2-3 seconds | 10-30 seconds |
47
+ | **Setup** | 2 minutes | Instant (with $$) |
115
48
 
116
- **Why Ollama?**
117
- - ✅ **100% FREE** - No API costs ever
118
- - ✅ **Private** - Runs entirely on your machine
119
- - ✅ **No internet required** - Works offline after model download
120
- - ✅ **Fast** - Optimized for your hardware (CPU/GPU)
49
+ Perfect for developers who want fast, private, and free AI summarization in their terminal.
121
50
 
122
51
  ---
123
52
 
124
- ## Quick Start
53
+ ## 📖 Basic Usage
125
54
 
126
- ### Basic Usage (Works Without Any API Keys!)
55
+ ### Summary Modes
127
56
  ```bash
128
57
  # Quick summary
129
- glance https://example.com
58
+ glance https://nextjs.org/docs
59
+
60
+ # One-sentence TL;DR
61
+ glance https://techcrunch.com/article --tldr
130
62
 
131
- # Ask a specific question
132
- glance https://react.dev --ask "What are React Server Components?"
63
+ # Bullet point key insights
64
+ glance https://blog.example.com --key-points
133
65
 
134
- # Get key points with emojis
135
- glance https://blog.example.com --key-points --emoji
66
+ # Simple explanation
67
+ glance https://complex-topic.com --eli5
136
68
 
137
- # TL;DR in one sentence
138
- glance https://news.ycombinator.com --tldr
69
+ # Ask specific questions
70
+ glance https://nextjs.org/docs --ask "What's the App Router?"
71
+ ```
139
72
 
140
- # Listen to summary (text-to-speech)
141
- glance https://article.com --read
73
+ ### AI Models
142
74
 
143
- # Save audio summary
144
- glance https://podcast.com --key-points --audio-output summary.mp3
75
+ **Free Local AI (Recommended):**
76
+ ```bash
77
+ glance https://example.com --model llama3
78
+ # Popular models: llama3, mistral, phi3, gemma2
79
+ # List available: glance --list-models
145
80
  ```
146
81
 
147
- ### Local Models (Free & Private)
82
+ **Optional Cloud AI:**
148
83
  ```bash
149
- # Use Ollama with Llama 3
150
- glance https://example.com --model llama3 --stream
84
+ # OpenAI (requires API key)
85
+ export OPENAI_API_KEY=sk-...
86
+ glance https://example.com --model gpt-4o-mini
151
87
 
152
- # Available models: llama3, mistral, phi3, gemma2, codellama, etc.
153
- # List installed models:
154
- glance --list-models
88
+ # Google Gemini (requires API key)
89
+ export GEMINI_API_KEY=...
90
+ glance https://example.com --model gemini-2.0-flash-exp
155
91
  ```
156
92
 
157
- ### Check Available Services
93
+ **Smart Detection:**
158
94
  ```bash
159
- # See what services you have available
95
+ # See what services you have
160
96
  glance --check-services
161
97
 
162
- # Force free-only mode (never use paid APIs)
98
+ # Force free-only
163
99
  glance https://example.com --free-only
164
100
 
165
- # Prefer quality (use paid APIs if available)
101
+ # Prefer quality (use paid if available)
166
102
  glance https://example.com --prefer-quality
167
103
  ```
168
104
 
169
- ### Advanced Features
105
+ ### Output Options
170
106
  ```bash
171
- # Export to Markdown with metadata
172
- glance https://example.com --export article.md --include-metadata
107
+ # Export to Markdown
108
+ glance https://nextjs.org/docs --export notes.md
173
109
 
174
- # Capture screenshot + summary
175
- glance https://example.com --screenshot page.png
110
+ # Export to JSON
111
+ glance https://api-docs.com --json -o data.json
176
112
 
177
- # Full render for JavaScript-heavy sites
178
- glance https://react-app.com --full-render
113
+ # Save as audio (text-to-speech)
114
+ glance https://article.com --audio-output summary.mp3
179
115
 
180
- # Multiple languages supported
181
- glance https://lemonde.fr --tldr -l fr # French
182
- glance https://elpais.com -k -l es # Spanish
183
- glance https://example.ht -l ht # Haitian Creole
116
+ # Read aloud immediately
117
+ glance https://blog.com --read
184
118
  ```
185
119
 
186
- ---
187
-
188
- ## 🎯 Core Features
189
-
190
- ### AI Summarization
191
-
192
- | Mode | Flag | Description | Best For |
193
- |------|------|-------------|----------|
194
- | **Standard** | (default) | Comprehensive 250-400 word summary | Most use cases |
195
- | **TL;DR** | `-t`, `--tldr` | One powerful sentence (max 25 words) | Quick insights |
196
- | **Key Points** | `-k`, `--key-points` | 6-10 substantive bullet points | Structured overviews |
197
- | **ELI5** | `--eli5` | Simple explanation with analogies | Complex topics |
198
- | **Custom Q&A** | `-q`, `--ask "question"` | Answer specific questions | Targeted information |
199
-
200
- **Examples:**
201
- ```bash
202
- # Standard summary
203
- glance https://arxiv.org/abs/2401.12345
204
-
205
- # TL;DR for quick scanning
206
- glance https://techcrunch.com/article --tldr
207
-
208
- # Key points for meeting notes
209
- glance https://docs.example.com --key-points --export notes.md
210
-
211
- # ELI5 for learning
212
- glance https://quantum-computing-paper.com --eli5
213
-
214
- # Custom questions
215
- glance https://api-docs.com --ask "How do I authenticate?"
216
- ```
217
-
218
- ### AI Models
219
-
220
- #### 🆓 Local Models (Ollama) – **FREE & Private** (Recommended!)
120
+ ### Advanced Features
221
121
  ```bash
222
- # Install Ollama first: https://ollama.ai
223
- ollama pull llama3
224
-
225
- # Use with glance (auto-detected as default!)
226
- glance https://example.com # Automatically uses Ollama if available
227
- glance https://example.com --model llama3 --stream
228
- ```
122
+ # Screenshot + summary
123
+ glance https://example.com --screenshot page.png --tldr
229
124
 
230
- **Popular FREE models:**
231
- - `llama3` – Meta's flagship (best overall) - **RECOMMENDED**
232
- - `mistral` – Fast and capable
233
- - `phi3` – Lightweight, good for resource-constrained
234
- - `gemma2` – Google's open model
235
- - `codellama` – Optimized for code
236
-
237
- **Cost:** $0.00 forever! Runs on your machine.
238
-
239
- #### 💰 Cloud Models (Optional - Costs Money)
125
+ # JavaScript-heavy sites (SPAs)
126
+ glance https://react-app.com --full-render
240
127
 
241
- **OpenAI (Paid):**
242
- ```bash
243
- export OPENAI_API_KEY=sk-... # Costs ~$0.0015 per summary
244
- glance https://example.com --model gpt-4o
245
- glance https://example.com --model gpt-4o-mini # Cheaper option
246
- ```
128
+ # Multiple languages
129
+ glance https://lemonde.fr --tldr -l fr # French
130
+ glance https://elpais.com -k -l es # Spanish
247
131
 
248
- **Google Gemini (Free tier available, then paid):**
249
- ```bash
250
- export GEMINI_API_KEY=...
251
- glance https://example.com --model gemini-2.0-flash-exp # Has free tier
252
- glance https://example.com --model gemini-1.5-pro # Premium
132
+ # Streaming output
133
+ glance https://long-article.com --stream
253
134
  ```
254
135
 
255
- **Note:** Glance automatically detects and prefers FREE local models. Use `--prefer-quality` to prioritize paid services.
136
+ ---
256
137
 
257
- ### Output Formats
138
+ ## 🎨 Output Formats
258
139
 
259
140
  ```bash
260
- # Terminal (default) - colorful, interactive
141
+ # Terminal (default) - colorful, emoji-rich
261
142
  glance https://example.com
262
143
 
263
- # Markdown - for documentation
264
- glance https://example.com --markdown -o article.md
144
+ # Markdown
145
+ glance https://example.com -o article.md
265
146
 
266
- # JSON - for APIs and scripts
267
- glance https://example.com --json -o data.json
147
+ # JSON (for scripting)
148
+ glance https://example.com -o data.json
268
149
 
269
- # HTML - embeddable webpage
150
+ # HTML (embeddable)
270
151
  glance https://example.com --format html -o page.html
271
152
 
272
- # Plain text - pipeable, script-friendly
153
+ # Plain text (pipeable)
273
154
  glance https://example.com --format plain | grep "keyword"
274
155
  ```
275
156
 
276
- **Auto-detection:**
277
- ```bash
278
- # Format auto-detected from extension
279
- glance url -o output.md # Markdown
280
- glance url -o output.json # JSON
281
- glance url -o output.html # HTML
282
- glance url -o output.txt # Plain text
283
- ```
157
+ ---
284
158
 
285
- ### Caching System
159
+ ## 💾 Smart Caching
286
160
 
287
- Intelligent caching for speed and cost savings:
161
+ Glance automatically caches results to save time and API costs:
288
162
 
289
163
  ```bash
290
- # Cache enabled by default (24h TTL)
164
+ # First request: ~3 seconds
291
165
  glance https://example.com
292
- glance https://example.com # ⚡ Instant from cache
293
-
294
- # View cache statistics
295
- glance --cache-stats
296
- # Output:
297
- # Total Entries: 234
298
- # Total Size: 45.2 MB / 100 MB (45%)
299
- # Cache Hits: 892
300
- # Cache Misses: 108
301
- # Hit Rate: 89.2%
302
- # Compression: 72% savings
303
-
304
- # Clear expired entries
305
- glance --cache-cleanup
306
-
307
- # Clear all cache
308
- glance --clear-cache
309
-
310
- # Disable cache for specific request
311
- glance https://example.com --no-cache
312
- ```
313
-
314
- **Cache Features:**
315
- - ✅ Automatic compression (70% space savings)
316
- - ✅ TTL-based expiration (default 24h)
317
- - ✅ LRU eviction (max 100MB)
318
- - ✅ Hit rate tracking
319
- - ✅ Atomic writes (corruption-proof)
320
-
321
- ### Content Extraction
322
166
 
323
- Advanced extraction with intelligent content detection:
324
-
325
- ```bash
326
- # Extract main content with metadata
327
- glance https://article.com --metadata
328
-
329
- # Extract all links (categorized)
330
- glance https://example.com --links
331
-
332
- # Extract tables from data pages
333
- glance https://data-table.com --tables
334
-
335
- # Get structured metadata (author, dates, etc.)
336
- glance https://blog.com --metadata --json
337
- ```
338
-
339
- **Metadata includes:**
340
- - Title, description, keywords
341
- - Author, publication date, publisher
342
- - Reading time estimation
343
- - OpenGraph and Twitter Cards
344
- - Structured data (JSON-LD, Schema.org)
345
- - Word count, paragraph count
346
- - Language detection
347
-
348
- ### Screenshots
349
-
350
- ```bash
351
- # Capture screenshot
352
- glance https://example.com --screenshot page.png
353
-
354
- # Custom size and format
355
- glance https://example.com --screenshot output.jpg --width 1280 --height 720
356
-
357
- # Full page screenshot
358
- glance https://example.com --screenshot full.png --full-page
359
- ```
360
-
361
- ### Voice/TTS Output
362
-
363
- Transform any summary into audio for listening on-the-go:
364
-
365
- ```bash
366
- # Read summary aloud (plays immediately)
367
- glance https://article.com --read
368
-
369
- # Save as audio file
370
- glance https://blog.com --audio-output summary.mp3
371
-
372
- # Use specific voice
373
- glance https://news.com --read --voice alloy
167
+ # Cached request: ~0.1 seconds
168
+ glance https://example.com
374
169
 
375
- # List available voices
376
- glance --list-voices
170
+ # View cache stats
171
+ glance --cache-stats
377
172
 
378
- # Combine with other features
379
- glance https://techcrunch.com --tldr --read --emoji
380
- glance https://paper.com --key-points --audio-output points.mp3
173
+ # Clear cache
174
+ glance --clear-cache
381
175
  ```
382
176
 
383
- **Voice Options:**
384
- - **ElevenLabs** (with API key): Premium natural voices
385
- - `alloy` (Rachel) - warm, friendly
386
- - `echo` (Clyde) - professional
387
- - `nova` (Charlie) - energetic
388
- - `shimmer` (Charlotte) - clear, articulate
389
- - `onyx` (Callum) - deep, authoritative
390
- - `fable` (Gigi) - expressive
391
-
392
- - **Local TTS** (no API key needed):
393
- - **macOS**: System voices via `say` command
394
- - **Windows**: SAPI voices
395
- - **Linux**: espeak or festival
396
-
397
- **Setup:**
398
- ```bash
399
- # Optional: For premium ElevenLabs voices
400
- export ELEVENLABS_API_KEY=your-api-key
401
-
402
- # Works without API key using system TTS
403
- glance https://example.com --read
404
- ```
177
+ **Cache features:**
178
+ - 24-hour TTL (configurable)
179
+ - 70% compression
180
+ - LRU eviction (100MB max)
181
+ - Hit rate tracking
405
182
 
406
183
  ---
407
184
 
408
- ## 🛠️ Advanced Usage
409
-
410
- ### Streaming Output
185
+ ## 🛠️ Common Use Cases
411
186
 
412
- Real-time output for long content:
187
+ ### 1. Quick Documentation Lookup
413
188
  ```bash
414
- glance https://long-article.com --stream
189
+ glance https://nextjs.org/docs --ask "How do I use Server Actions?"
415
190
  ```
416
191
 
417
- ### Custom Timeouts
418
-
192
+ ### 2. Morning News Briefing
419
193
  ```bash
420
- # Increase timeout for slow sites
421
- glance https://slow-site.com --timeout 60000 # 60 seconds
194
+ glance https://news.ycombinator.com --tldr --read
422
195
  ```
423
196
 
424
- ### Full Rendering
425
-
426
- For JavaScript-heavy sites (SPAs, React apps):
197
+ ### 3. Research & Note-Taking
427
198
  ```bash
428
- glance https://react-app.com --full-render
429
-
430
- # With custom wait strategy
431
- glance https://spa.com --full-render --wait-until load
199
+ glance https://research-paper.com --key-points --export notes.md
432
200
  ```
433
201
 
434
- ### Batch Processing
435
-
202
+ ### 4. Batch Processing
436
203
  ```bash
437
- # Process multiple URLs
438
204
  cat urls.txt | while read url; do
439
- glance "$url" --tldr --export "summaries/$(echo $url | md5).md"
205
+ glance "$url" --tldr >> daily-summary.md
440
206
  done
441
207
  ```
442
208
 
443
- ### Piping and Scripting
444
-
209
+ ### 5. API Documentation
445
210
  ```bash
446
- # Extract and grep
447
- glance https://docs.com --format plain | grep "API"
448
-
449
- # Extract links and process
450
- glance https://example.com --links --json | jq '.[] | .href'
451
-
452
- # Chain with other tools
453
- glance https://article.com | wc -w # Word count
211
+ glance https://api-docs.com --ask "How do I authenticate?" --format plain
454
212
  ```
455
213
 
456
214
  ---
457
215
 
458
- ## 📚 Complete Options
459
-
460
- ```
461
- Usage: glance <url> [options]
462
-
463
- Core:
464
- -t, --tldr One-line TL;DR (max 25 words)
465
- -k, --key-points 6-10 key insights as bullet points
466
- --eli5 Explain like I'm 5 (simple with analogies)
467
-
468
- Questions:
469
- -q, --ask "question" Ask anything about the page
470
-
471
- AI Models:
472
- -m, --model <name> Model to use (default: gpt-4o-mini)
473
- OpenAI: gpt-4o, gpt-4o-mini
474
- Gemini: gemini-2.0-flash-exp, gemini-1.5-pro
475
- Ollama: llama3, mistral, phi3, gemma2, etc.
476
- -l, --language <code> Output language: en, fr, es, ht (default: en)
477
- --max-tokens <n> Limit output length
478
- -e, --emoji Add relevant emojis
479
-
480
- Voice/TTS:
481
- --read, --speak Read summary aloud (text-to-speech)
482
- --voice <name/id> Voice to use (alloy, echo, nova, etc.)
483
- --audio-output <file> Save audio to MP3 file
484
- --list-voices List available voices
485
-
486
- Output:
487
- --markdown Markdown format
488
- -j, --json JSON format
489
- --format <type> Output format: terminal, markdown, json, html, plain
490
- -o, --export <file> Save to file (auto-detects format from extension)
491
- --stream Live streaming output
492
- --include-metadata Include full metadata in output
493
-
494
- Cache:
495
- -c, --cache Enable cache (default: true)
496
- --no-cache Disable cache for this request
497
- --clear-cache Clear all cache
498
- --cache-cleanup Remove expired entries
499
- --cache-stats Show cache statistics
500
-
501
- Advanced:
502
- -r, --full-render Render JavaScript (slower, for SPAs)
503
- --timeout <ms> Request timeout in milliseconds
504
- --screenshot <file> Save screenshot
505
- --width <n> Screenshot width (default: 1920)
506
- --height <n> Screenshot height (default: 1080)
507
- --raw-html Print raw HTML
508
- --links List all links
509
- --tables Extract tables
510
- --metadata Show page metadata
511
- --list-models List available Ollama models
512
-
513
- Debug:
514
- -v, --verbose Verbose logging (shows performance breakdown)
515
- -d, --dry-run Preview content without AI processing
516
-
517
- Help:
518
- -h, --help Show this help
519
- -V, --version Show version number
216
+ ## 📚 All Options
217
+
218
+ ```bash
219
+ # Summary modes
220
+ glance <url> # Standard summary
221
+ glance <url> --tldr # One sentence
222
+ glance <url> --key-points # Bullet points
223
+ glance <url> --eli5 # Simple explanation
224
+ glance <url> --ask "question" # Custom Q&A
225
+
226
+ # AI models
227
+ --model <name> # llama3, gpt-4o-mini, gemini-2.0-flash-exp
228
+ --list-models # Show available Ollama models
229
+ --check-services # Show available AI/voice services
230
+ --free-only # Never use paid APIs
231
+ --prefer-quality # Use premium services when available
232
+
233
+ # Output
234
+ -o, --export <file> # Save to file (auto-detects format)
235
+ --markdown # Markdown format
236
+ --json # JSON format
237
+ --format <type> # terminal, markdown, json, html, plain
238
+ --stream # Live streaming output
239
+
240
+ # Voice/Audio
241
+ --read, --speak # Read aloud (text-to-speech)
242
+ --audio-output <file> # Save as MP3
243
+ --voice <name> # Choose voice (alloy, echo, nova, etc.)
244
+ --list-voices # Show available voices
245
+
246
+ # Advanced
247
+ --screenshot <file> # Capture screenshot
248
+ --full-render # Render JavaScript (for SPAs)
249
+ --metadata # Show page metadata
250
+ --links # Extract all links
251
+ --tables # Extract tables
252
+ -l, --language <code> # Output language (en, fr, es, ht)
253
+ -e, --emoji # Add emojis
254
+
255
+ # Cache
256
+ --cache-stats # Show cache statistics
257
+ --cache-cleanup # Remove expired entries
258
+ --clear-cache # Clear all cache
259
+ --no-cache # Skip cache for this request
260
+
261
+ # Other
262
+ -v, --verbose # Show detailed logs
263
+ -h, --help # Show help
264
+ -V, --version # Show version
520
265
  ```
521
266
 
522
267
  ---
@@ -526,349 +271,118 @@ Help:
526
271
  ### Environment Variables
527
272
 
528
273
  ```bash
529
- # AI Providers
274
+ # AI Providers (optional)
530
275
  export OPENAI_API_KEY=sk-...
531
276
  export GEMINI_API_KEY=...
532
- export GOOGLE_API_KEY=... # Alternative for Gemini
533
277
 
534
- # Voice/TTS (optional)
535
- export ELEVENLABS_API_KEY=... # For premium voices
278
+ # Voice (optional)
279
+ export ELEVENLABS_API_KEY=...
536
280
 
537
- # Ollama (optional, default shown)
281
+ # Ollama (optional, auto-detected)
538
282
  export OLLAMA_ENDPOINT=http://localhost:11434
539
283
 
540
284
  # Cache (optional)
541
285
  export GLANCE_CACHE_DIR=~/.glance/cache
542
286
  export GLANCE_CACHE_TTL=86400000 # 24h in ms
543
- export GLANCE_MAX_CACHE_SIZE=104857600 # 100MB
544
- ```
545
-
546
- ### Configuration File (coming soon)
547
-
548
- `.glancerc` support planned for v1.1:
549
- ```json
550
- {
551
- "defaultModel": "gpt-4o-mini",
552
- "defaultLanguage": "en",
553
- "cacheEnabled": true,
554
- "cacheTTL": 86400000,
555
- "maxCacheSize": 104857600
556
- }
557
287
  ```
558
288
 
559
289
  ---
560
290
 
561
- ## 📖 Examples
562
-
563
- ### Content Summarization
564
-
565
- ```bash
566
- # Summarize a blog post
567
- glance https://blog.example.com/post
568
-
569
- # Get key points from documentation
570
- glance https://docs.python.org/3/tutorial/ --key-points
571
-
572
- # Quick TL;DR of news article
573
- glance https://techcrunch.com/article --tldr --emoji
574
- ```
291
+ ## 🚀 Examples
575
292
 
576
293
  ### Learning & Research
577
-
578
294
  ```bash
579
- # Understand a complex topic
580
- glance https://quantum-computing.com --eli5
295
+ # Understand a new framework
296
+ glance https://nextjs.org/docs --eli5
581
297
 
582
- # Answer specific questions
583
- glance https://react.dev --ask "What are hooks and when should I use them?"
298
+ # Quick reference
299
+ glance https://nextjs.org/docs --key-points --export nextjs-notes.md
584
300
 
585
- # Extract structured data
586
- glance https://research-paper.com --metadata --json -o paper.json
301
+ # Specific questions
302
+ glance https://nextjs.org/docs --ask "What's the difference between pages and app router?"
587
303
  ```
588
304
 
589
- ### Documentation & Notes
590
-
305
+ ### Daily Workflow
591
306
  ```bash
592
- # Export documentation to Markdown
593
- glance https://api-docs.com --markdown -o api-reference.md
307
+ # Morning news
308
+ glance https://news.ycombinator.com --tldr --read
594
309
 
595
- # Create meeting notes from recorded session
596
- glance https://meeting-recording.com --key-points --export notes.md
310
+ # Documentation lookup
311
+ glance https://nextjs.org/docs/app/api-reference/functions/fetch --ask "How do I revalidate?"
597
312
 
598
- # Extract code examples
599
- glance https://tutorial.com --format plain | grep -A 10 "```"
313
+ # Code examples
314
+ glance https://tutorial.com --format plain | grep -A 10 "example"
600
315
  ```
601
316
 
602
- ### Monitoring & Automation
603
-
317
+ ### Content Creation
604
318
  ```bash
605
- # Check website changes (with caching)
606
- glance https://status.example.com --tldr
607
-
608
- # Automated reporting
609
- #!/bin/bash
610
- for url in $(cat monitoring.txt); do
611
- glance "$url" --tldr --format plain >> daily-report.txt
612
- done
319
+ # Extract for blog post
320
+ glance https://source-article.com --key-points --export research.md
613
321
 
614
- # API integration
615
- curl -s "https://api.example.com/articles" | jq -r '.[]|.url' | \
616
- xargs -I {} glance {} --key-points --json
322
+ # Multilingual content
323
+ glance https://lemonde.fr --tldr -l fr --export french-news.md
617
324
  ```
618
325
 
619
326
  ---
620
327
 
621
- ## 🎓 Best Practices
328
+ ## 🎓 Pro Tips
622
329
 
623
- ### Choosing the Right Model
624
-
625
- **For speed and cost:**
330
+ **1. Use local AI for daily tasks:**
626
331
  ```bash
627
- glance url --model gpt-4o-mini # Fast, cheap, good quality
628
- glance url --model llama3 # Free, local, private
332
+ glance https://example.com --model llama3 # Free, fast, private
629
333
  ```
630
334
 
631
- **For highest quality:**
335
+ **2. Cache speeds up repeated requests:**
632
336
  ```bash
633
- glance url --model gpt-4o # Best reasoning
634
- glance url --model gemini-1.5-pro # Long context
337
+ glance https://docs.com # First: 3s
338
+ glance https://docs.com # Cached: 0.1s
635
339
  ```
636
340
 
637
- **For code/technical content:**
341
+ **3. Pipe output for scripting:**
638
342
  ```bash
639
- glance url --model codellama # Optimized for code
343
+ glance https://example.com --format plain | grep "keyword" | wc -l
640
344
  ```
641
345
 
642
- ### Optimizing Performance
643
-
346
+ **4. Save audio for commute:**
644
347
  ```bash
645
- # Use cache for repeated requests
646
- glance url # First time: 3s
647
- glance url # Cached: 0.1s
648
-
649
- # Use streaming for long content
650
- glance long-url --stream
651
-
652
- # Skip JavaScript rendering if not needed
653
- glance url # Fast (static fetch)
654
- glance spa-url --full-render # Slower but complete
348
+ glance https://article.com --tldr --audio-output commute.mp3
655
349
  ```
656
350
 
657
- ### Error Handling
658
-
351
+ **5. Use streaming for long content:**
659
352
  ```bash
660
- # Use verbose mode for debugging
661
- glance url --verbose
662
-
663
- # Check URL before processing
664
- glance url --dry-run
353
+ glance https://long-article.com --stream
665
354
  ```
666
355
 
667
356
  ---
668
357
 
669
358
  ## 🤝 Contributing
670
359
 
671
- We welcome contributions! Here's how to get started:
672
-
673
- ### Development Setup
360
+ Contributions welcome! Check out our [Contributing Guide](CONTRIBUTING.md).
674
361
 
675
362
  ```bash
676
- # Clone repository
677
363
  git clone https://github.com/jkenley/glance-cli.git
678
364
  cd glance-cli
679
-
680
- # Install dependencies
681
365
  bun install
682
-
683
- # Run locally
684
366
  bun dev https://example.com
685
-
686
- # Run tests
687
- bun test
688
-
689
- # Build
690
- bun build
691
367
  ```
692
368
 
693
- ### Contribution Guidelines
694
-
695
- 1. **Open an issue** for major changes
696
- 2. **Follow code style** (TypeScript, ESLint)
697
- 3. **Add tests** for new features
698
- 4. **Update documentation** as needed
699
- 5. **Write clear commit messages**
700
-
701
- See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed guidelines.
702
-
703
- ---
704
-
705
- ## 🏗️ Architecture
706
-
707
- ### Core Components
708
-
709
- - **`cli.ts`** - Command-line interface with validation and error handling
710
- - **`fetcher.ts`** - Page fetching with retry logic and timeout protection
711
- - **`extractor.ts`** - Intelligent content extraction with scoring algorithm
712
- - **`summarizer.ts`** - Expert-engineered AI prompts for superior results
713
- - **`formatter.ts`** - Multi-format output (terminal, markdown, JSON, HTML)
714
- - **`cache.ts`** - Smart caching with TTL, compression, and LRU eviction
715
- - **`screenshot.ts`** - Screenshot capture with error recovery
716
-
717
- ### Production Features
718
-
719
- - ✅ **Comprehensive error handling** with categorized errors and hints
720
- - ✅ **Automatic retries** with exponential backoff for transient failures
721
- - ✅ **Timeout protection** to prevent infinite hangs
722
- - ✅ **Resource cleanup** to prevent memory leaks
723
- - ✅ **Input validation** to catch issues early
724
- - ✅ **Graceful degradation** on partial failures
725
- - ✅ **Performance tracking** with detailed breakdowns
726
-
727
- ---
728
-
729
- ## 📊 Performance
730
-
731
- ### Benchmarks
732
-
733
- | Operation | Time | Notes |
734
- |-----------|------|-------|
735
- | Simple fetch | 0.5-1s | Static page |
736
- | Full render | 2-4s | JavaScript-heavy SPA |
737
- | AI summary (cloud) | 2-5s | Depends on model |
738
- | AI summary (local) | 3-8s | Depends on hardware |
739
- | Cache hit | <0.1s | Nearly instant |
740
-
741
- ### Optimization Tips
742
-
743
- 1. **Use cache** - Reduces API costs and improves speed
744
- 2. **Choose appropriate model** - `gpt-4o-mini` is 10x faster than `gpt-4o`
745
- 3. **Skip full-render** if not needed - 4x faster for static sites
746
- 4. **Use streaming** for long content - Better perceived performance
747
- 5. **Batch processing** - Process multiple URLs efficiently
748
-
749
- ---
750
-
751
- ## 🔒 Security
752
-
753
- ### Reporting Vulnerabilities
754
-
755
- See [SECURITY.md](SECURITY.md) for our security policy.
756
-
757
- **Report security issues to:** alo@jkenley.me with subject `[Security] glance-cli`
758
-
759
- ### Security Features
760
-
761
- - ✅ **Input sanitization** - All inputs validated and sanitized
762
- - ✅ **No shell injection** - Safe programmatic operations
763
- - ✅ **Content-type validation** - Only processes valid HTML
764
- - ✅ **Size limits** - Prevents memory exhaustion attacks
765
- - ✅ **Timeout protection** - Prevents denial of service
766
- - ✅ **Secure hashing** - SHA-256 instead of MD5
767
-
768
- ---
769
-
770
- ## 📝 Changelog
771
-
772
- See [CHANGELOG.md](CHANGELOG.md) for version history and updates.
773
-
774
- ### Latest Release (v0.7.0)
775
-
776
- **Major Improvements:**
777
- - 🎯 Expert-level prompt engineering (10x better AI results)
778
- - 🛡️ Production-grade error handling and reliability
779
- - 💾 Intelligent caching with TTL, compression, and LRU eviction
780
- - 📊 Rich content extraction with 20+ metadata fields
781
- - 🎨 Multiple output formats (HTML, plain text)
782
- - ⚡ Performance optimizations and memory leak fixes
783
-
784
- See full changelog for all updates.
785
-
786
- ---
787
-
788
- ## 🌟 Roadmap
789
-
790
- ### v1.0 (Stable Release)
791
- - [ ] Comprehensive test suite (>80% coverage)
792
- - [ ] Configuration file support (`.glancerc`)
793
- - [ ] Plugin system for extensibility
794
- - [ ] Web UI for easier interaction
795
- - [ ] Additional output formats (PDF, EPUB)
796
-
797
- ### v1.1 (Enhanced Features)
798
- - [ ] Batch processing with progress bars
799
- - [ ] Interactive mode for exploration
800
- - [ ] Custom prompt templates
801
- - [ ] Integration with note-taking apps (Notion, Obsidian)
802
- - [ ] Browser extension
803
-
804
- ### Future
805
- - [ ] Cloud sync for cache
806
- - [ ] Analytics dashboard
807
- - [ ] Collaborative features
808
- - [ ] Mobile app
809
-
810
- Vote on features: [GitHub Discussions](https://github.com/jkenley/glance-cli/discussions)
811
-
812
- ---
813
-
814
- ## ❓ FAQ
815
-
816
- **Q: Which AI model should I use?**
817
- A: For most cases, `gpt-4o-mini` (default) offers the best balance of speed, cost, and quality. For privacy or offline use, try `llama3` with Ollama.
818
-
819
- **Q: How does caching work?**
820
- A: Responses are cached for 24 hours by default. The cache uses intelligent compression and LRU eviction to stay under 100MB.
821
-
822
- **Q: Can I use glance without an API key?**
823
- A: Yes! Install Ollama and use local models like `llama3` or `mistral` for completely free, private operation.
824
-
825
- **Q: Does glance work with paywalled content?**
826
- A: No, glance cannot access content behind authentication or paywalls.
827
-
828
- **Q: How accurate are the summaries?**
829
- A: glance uses expert-engineered prompts with anti-hallucination measures. Summaries are based strictly on page content, but AI can still make mistakes. Always verify critical information.
830
-
831
- **Q: Can I customize the prompts?**
832
- A: Custom prompt templates are planned for v1.1. Currently, you can use different modes (TL;DR, key points, ELI5) or ask custom questions.
833
-
834
- **Q: Is my data sent to third parties?**
835
- A: When using cloud models (OpenAI, Gemini), page content is sent to those providers for processing. With local models (Ollama), everything stays on your machine.
836
-
837
- ---
838
-
839
- ## 🙏 Acknowledgments
840
-
841
- Built with these amazing open-source projects:
842
- - [Bun](https://bun.sh) - Lightning-fast JavaScript runtime
843
- - [Cheerio](https://cheerio.js.org) - Fast, flexible HTML parsing
844
- - [Puppeteer](https://pptr.dev) - Headless Chrome automation
845
- - [OpenAI](https://openai.com) - GPT models
846
- - [Google Gemini](https://deepmind.google/technologies/gemini/) - Gemini models
847
- - [Ollama](https://ollama.ai) - Local LLM infrastructure
848
-
849
- Special thanks to all [contributors](https://github.com/jkenley/glance-cli/graphs/contributors)!
850
-
851
369
  ---
852
370
 
853
371
  ## 📄 License
854
372
 
855
373
  MIT License - see [LICENSE](LICENSE) for details.
856
374
 
857
- Copyright © 2026 Kenley Jean-Louis
858
-
859
375
  ---
860
376
 
861
- ## 📞 Contact & Support
377
+ ## 🔗 Links
862
378
 
863
- - **Author**: Kenley Jean-Louis
864
- - **Email**: alo@jkenley.me
865
- - **GitHub**: https://github.com/jkenley
866
- - **Project**: https://github.com/jkenley/glance-cli
867
- - **Issues**: https://github.com/jkenley/glance-cli/issues
868
- - **Discussions**: https://github.com/jkenley/glance-cli/discussions
379
+ - **GitHub**: [github.com/jkenley/glance-cli](https://github.com/jkenley/glance-cli)
380
+ - **NPM**: [npmjs.com/package/glance-cli](https://www.npmjs.com/package/glance-cli)
381
+ - **Issues**: [github.com/jkenley/glance-cli/issues](https://github.com/jkenley/glance-cli/issues)
382
+ - **Changelog**: [CHANGELOG.md](CHANGELOG.md)
869
383
 
870
384
  ---
871
385
 
872
- **Built with ❤️ for developers, researchers, and curious minds.**
386
+ **Built with ❤️ by [Kenley Jean](https://github.com/jkenley)**
873
387
 
874
388
  *Star ⭐ the repo if you find it useful!*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glance-cli",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "AI-powered web reader for your terminal – Fetch, extract, and summarize webpages with local or cloud AI",
5
5
  "keywords": [
6
6
  "cli",