glance-cli 0.8.0 → 0.8.2

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 +15 -0
  2. package/README.md +203 -686
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,21 @@ 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.2] - 2026-01-02
9
+
10
+ ### Changed
11
+ - Added Bun as preferred installation method in documentation
12
+ - Updated CLI imports for better compatibility
13
+
14
+ ### Fixed
15
+ - Removed development files from distribution
16
+
17
+ ## [0.8.1] - 2026-01-02
18
+
19
+ ### Changed
20
+ - Streamlined README for better npm presentation
21
+ - Minor documentation improvements
22
+
8
23
  ## [0.8.0] - 2026-01-02
9
24
 
10
25
  ### 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,256 @@
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 with Bun (preferred - faster!)
22
+ bun install -g glance-cli
23
+
24
+ # Or with npm
78
25
  npm install -g glance-cli
79
- ```
80
26
 
81
- ### Via Bun (recommended fastest)
82
- ```bash
83
- bun add -g glance-cli
27
+ # Use immediately (works without setup!)
28
+ glance https://example.com
84
29
  ```
85
30
 
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:**
31
+ **For 100% free local AI:**
90
32
  ```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
- ```
33
+ # One-time setup (~4GB download)
34
+ curl -fsSL https://ollama.com/install.sh | sh
35
+ ollama pull llama3
94
36
 
95
- **Windows:**
96
- Download the `.exe` from [Releases](https://github.com/jkenley/glance-cli/releases) and add to PATH.
37
+ # Now completely free forever
38
+ glance https://nextjs.org/docs --tldr
39
+ ```
97
40
 
98
41
  ---
99
42
 
100
- ## 🆓 Free Setup (No API Keys!)
43
+ ## 🎯 Why Glance?
101
44
 
102
- Want to use glance completely free? Just install Ollama:
45
+ | Feature | Glance + Ollama | Traditional AI Tools |
46
+ |---------|-----------------|---------------------|
47
+ | **Cost** | $0 forever | $20-100/month |
48
+ | **Privacy** | 100% local | Cloud-based |
49
+ | **Speed** | 2-3 seconds | 10-30 seconds |
50
+ | **Setup** | 2 minutes | Instant (with $$) |
103
51
 
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
- ```
115
-
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)
52
+ Perfect for developers who want fast, private, and free AI summarization in their terminal.
121
53
 
122
54
  ---
123
55
 
124
- ## Quick Start
56
+ ## 📖 Basic Usage
125
57
 
126
- ### Basic Usage (Works Without Any API Keys!)
58
+ ### Summary Modes
127
59
  ```bash
128
60
  # Quick summary
129
- glance https://example.com
61
+ glance https://nextjs.org/docs
130
62
 
131
- # Ask a specific question
132
- glance https://react.dev --ask "What are React Server Components?"
63
+ # One-sentence TL;DR
64
+ glance https://techcrunch.com/article --tldr
65
+
66
+ # Bullet point key insights
67
+ glance https://blog.example.com --key-points
133
68
 
134
- # Get key points with emojis
135
- glance https://blog.example.com --key-points --emoji
69
+ # Simple explanation
70
+ glance https://complex-topic.com --eli5
136
71
 
137
- # TL;DR in one sentence
138
- glance https://news.ycombinator.com --tldr
72
+ # Ask specific questions
73
+ glance https://nextjs.org/docs --ask "What's the App Router?"
74
+ ```
139
75
 
140
- # Listen to summary (text-to-speech)
141
- glance https://article.com --read
76
+ ### AI Models
142
77
 
143
- # Save audio summary
144
- glance https://podcast.com --key-points --audio-output summary.mp3
78
+ **Free Local AI (Recommended):**
79
+ ```bash
80
+ glance https://example.com --model llama3
81
+ # Popular models: llama3, mistral, phi3, gemma2
82
+ # List available: glance --list-models
145
83
  ```
146
84
 
147
- ### Local Models (Free & Private)
85
+ **Optional Cloud AI:**
148
86
  ```bash
149
- # Use Ollama with Llama 3
150
- glance https://example.com --model llama3 --stream
87
+ # OpenAI (requires API key)
88
+ export OPENAI_API_KEY=sk-...
89
+ glance https://example.com --model gpt-4o-mini
151
90
 
152
- # Available models: llama3, mistral, phi3, gemma2, codellama, etc.
153
- # List installed models:
154
- glance --list-models
91
+ # Google Gemini (requires API key)
92
+ export GEMINI_API_KEY=...
93
+ glance https://example.com --model gemini-2.0-flash-exp
155
94
  ```
156
95
 
157
- ### Check Available Services
96
+ **Smart Detection:**
158
97
  ```bash
159
- # See what services you have available
98
+ # See what services you have
160
99
  glance --check-services
161
100
 
162
- # Force free-only mode (never use paid APIs)
101
+ # Force free-only
163
102
  glance https://example.com --free-only
164
103
 
165
- # Prefer quality (use paid APIs if available)
104
+ # Prefer quality (use paid if available)
166
105
  glance https://example.com --prefer-quality
167
106
  ```
168
107
 
169
- ### Advanced Features
108
+ ### Output Options
170
109
  ```bash
171
- # Export to Markdown with metadata
172
- glance https://example.com --export article.md --include-metadata
110
+ # Export to Markdown
111
+ glance https://nextjs.org/docs --export notes.md
173
112
 
174
- # Capture screenshot + summary
175
- glance https://example.com --screenshot page.png
113
+ # Export to JSON
114
+ glance https://api-docs.com --json -o data.json
176
115
 
177
- # Full render for JavaScript-heavy sites
178
- glance https://react-app.com --full-render
116
+ # Save as audio (text-to-speech)
117
+ glance https://article.com --audio-output summary.mp3
179
118
 
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
119
+ # Read aloud immediately
120
+ glance https://blog.com --read
184
121
  ```
185
122
 
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:**
123
+ ### Advanced Features
201
124
  ```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
125
+ # Screenshot + summary
126
+ glance https://example.com --screenshot page.png --tldr
213
127
 
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!)
221
- ```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
- ```
229
-
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)
128
+ # JavaScript-heavy sites (SPAs)
129
+ glance https://react-app.com --full-render
240
130
 
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
- ```
131
+ # Multiple languages
132
+ glance https://lemonde.fr --tldr -l fr # French
133
+ glance https://elpais.com -k -l es # Spanish
247
134
 
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
135
+ # Streaming output
136
+ glance https://long-article.com --stream
253
137
  ```
254
138
 
255
- **Note:** Glance automatically detects and prefers FREE local models. Use `--prefer-quality` to prioritize paid services.
139
+ ---
256
140
 
257
- ### Output Formats
141
+ ## 🎨 Output Formats
258
142
 
259
143
  ```bash
260
- # Terminal (default) - colorful, interactive
144
+ # Terminal (default) - colorful, emoji-rich
261
145
  glance https://example.com
262
146
 
263
- # Markdown - for documentation
264
- glance https://example.com --markdown -o article.md
147
+ # Markdown
148
+ glance https://example.com -o article.md
265
149
 
266
- # JSON - for APIs and scripts
267
- glance https://example.com --json -o data.json
150
+ # JSON (for scripting)
151
+ glance https://example.com -o data.json
268
152
 
269
- # HTML - embeddable webpage
153
+ # HTML (embeddable)
270
154
  glance https://example.com --format html -o page.html
271
155
 
272
- # Plain text - pipeable, script-friendly
156
+ # Plain text (pipeable)
273
157
  glance https://example.com --format plain | grep "keyword"
274
158
  ```
275
159
 
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
- ```
160
+ ---
284
161
 
285
- ### Caching System
162
+ ## 💾 Smart Caching
286
163
 
287
- Intelligent caching for speed and cost savings:
164
+ Glance automatically caches results to save time and API costs:
288
165
 
289
166
  ```bash
290
- # Cache enabled by default (24h TTL)
167
+ # First request: ~3 seconds
291
168
  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
169
 
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
170
+ # Cached request: ~0.1 seconds
171
+ glance https://example.com
374
172
 
375
- # List available voices
376
- glance --list-voices
173
+ # View cache stats
174
+ glance --cache-stats
377
175
 
378
- # Combine with other features
379
- glance https://techcrunch.com --tldr --read --emoji
380
- glance https://paper.com --key-points --audio-output points.mp3
176
+ # Clear cache
177
+ glance --clear-cache
381
178
  ```
382
179
 
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
- ```
180
+ **Cache features:**
181
+ - 24-hour TTL (configurable)
182
+ - 70% compression
183
+ - LRU eviction (100MB max)
184
+ - Hit rate tracking
405
185
 
406
186
  ---
407
187
 
408
- ## 🛠️ Advanced Usage
409
-
410
- ### Streaming Output
188
+ ## 🛠️ Common Use Cases
411
189
 
412
- Real-time output for long content:
190
+ ### 1. Quick Documentation Lookup
413
191
  ```bash
414
- glance https://long-article.com --stream
192
+ glance https://nextjs.org/docs --ask "How do I use Server Actions?"
415
193
  ```
416
194
 
417
- ### Custom Timeouts
418
-
195
+ ### 2. Morning News Briefing
419
196
  ```bash
420
- # Increase timeout for slow sites
421
- glance https://slow-site.com --timeout 60000 # 60 seconds
197
+ glance https://news.ycombinator.com --tldr --read
422
198
  ```
423
199
 
424
- ### Full Rendering
425
-
426
- For JavaScript-heavy sites (SPAs, React apps):
200
+ ### 3. Research & Note-Taking
427
201
  ```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
202
+ glance https://research-paper.com --key-points --export notes.md
432
203
  ```
433
204
 
434
- ### Batch Processing
435
-
205
+ ### 4. Batch Processing
436
206
  ```bash
437
- # Process multiple URLs
438
207
  cat urls.txt | while read url; do
439
- glance "$url" --tldr --export "summaries/$(echo $url | md5).md"
208
+ glance "$url" --tldr >> daily-summary.md
440
209
  done
441
210
  ```
442
211
 
443
- ### Piping and Scripting
444
-
212
+ ### 5. API Documentation
445
213
  ```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
214
+ glance https://api-docs.com --ask "How do I authenticate?" --format plain
454
215
  ```
455
216
 
456
217
  ---
457
218
 
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
219
+ ## 📚 All Options
220
+
221
+ ```bash
222
+ # Summary modes
223
+ glance <url> # Standard summary
224
+ glance <url> --tldr # One sentence
225
+ glance <url> --key-points # Bullet points
226
+ glance <url> --eli5 # Simple explanation
227
+ glance <url> --ask "question" # Custom Q&A
228
+
229
+ # AI models
230
+ --model <name> # llama3, gpt-4o-mini, gemini-2.0-flash-exp
231
+ --list-models # Show available Ollama models
232
+ --check-services # Show available AI/voice services
233
+ --free-only # Never use paid APIs
234
+ --prefer-quality # Use premium services when available
235
+
236
+ # Output
237
+ -o, --export <file> # Save to file (auto-detects format)
238
+ --markdown # Markdown format
239
+ --json # JSON format
240
+ --format <type> # terminal, markdown, json, html, plain
241
+ --stream # Live streaming output
242
+
243
+ # Voice/Audio
244
+ --read, --speak # Read aloud (text-to-speech)
245
+ --audio-output <file> # Save as MP3
246
+ --voice <name> # Choose voice (alloy, echo, nova, etc.)
247
+ --list-voices # Show available voices
248
+
249
+ # Advanced
250
+ --screenshot <file> # Capture screenshot
251
+ --full-render # Render JavaScript (for SPAs)
252
+ --metadata # Show page metadata
253
+ --links # Extract all links
254
+ --tables # Extract tables
255
+ -l, --language <code> # Output language (en, fr, es, ht)
256
+ -e, --emoji # Add emojis
257
+
258
+ # Cache
259
+ --cache-stats # Show cache statistics
260
+ --cache-cleanup # Remove expired entries
261
+ --clear-cache # Clear all cache
262
+ --no-cache # Skip cache for this request
263
+
264
+ # Other
265
+ -v, --verbose # Show detailed logs
266
+ -h, --help # Show help
267
+ -V, --version # Show version
520
268
  ```
521
269
 
522
270
  ---
@@ -526,349 +274,118 @@ Help:
526
274
  ### Environment Variables
527
275
 
528
276
  ```bash
529
- # AI Providers
277
+ # AI Providers (optional)
530
278
  export OPENAI_API_KEY=sk-...
531
279
  export GEMINI_API_KEY=...
532
- export GOOGLE_API_KEY=... # Alternative for Gemini
533
280
 
534
- # Voice/TTS (optional)
535
- export ELEVENLABS_API_KEY=... # For premium voices
281
+ # Voice (optional)
282
+ export ELEVENLABS_API_KEY=...
536
283
 
537
- # Ollama (optional, default shown)
284
+ # Ollama (optional, auto-detected)
538
285
  export OLLAMA_ENDPOINT=http://localhost:11434
539
286
 
540
287
  # Cache (optional)
541
288
  export GLANCE_CACHE_DIR=~/.glance/cache
542
289
  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
290
  ```
558
291
 
559
292
  ---
560
293
 
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
- ```
294
+ ## 🚀 Examples
575
295
 
576
296
  ### Learning & Research
577
-
578
297
  ```bash
579
- # Understand a complex topic
580
- glance https://quantum-computing.com --eli5
298
+ # Understand a new framework
299
+ glance https://nextjs.org/docs --eli5
581
300
 
582
- # Answer specific questions
583
- glance https://react.dev --ask "What are hooks and when should I use them?"
301
+ # Quick reference
302
+ glance https://nextjs.org/docs --key-points --export nextjs-notes.md
584
303
 
585
- # Extract structured data
586
- glance https://research-paper.com --metadata --json -o paper.json
304
+ # Specific questions
305
+ glance https://nextjs.org/docs --ask "What's the difference between pages and app router?"
587
306
  ```
588
307
 
589
- ### Documentation & Notes
590
-
308
+ ### Daily Workflow
591
309
  ```bash
592
- # Export documentation to Markdown
593
- glance https://api-docs.com --markdown -o api-reference.md
310
+ # Morning news
311
+ glance https://news.ycombinator.com --tldr --read
594
312
 
595
- # Create meeting notes from recorded session
596
- glance https://meeting-recording.com --key-points --export notes.md
313
+ # Documentation lookup
314
+ glance https://nextjs.org/docs/app/api-reference/functions/fetch --ask "How do I revalidate?"
597
315
 
598
- # Extract code examples
599
- glance https://tutorial.com --format plain | grep -A 10 "```"
316
+ # Code examples
317
+ glance https://tutorial.com --format plain | grep -A 10 "example"
600
318
  ```
601
319
 
602
- ### Monitoring & Automation
603
-
320
+ ### Content Creation
604
321
  ```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
322
+ # Extract for blog post
323
+ glance https://source-article.com --key-points --export research.md
613
324
 
614
- # API integration
615
- curl -s "https://api.example.com/articles" | jq -r '.[]|.url' | \
616
- xargs -I {} glance {} --key-points --json
325
+ # Multilingual content
326
+ glance https://lemonde.fr --tldr -l fr --export french-news.md
617
327
  ```
618
328
 
619
329
  ---
620
330
 
621
- ## 🎓 Best Practices
331
+ ## 🎓 Pro Tips
622
332
 
623
- ### Choosing the Right Model
624
-
625
- **For speed and cost:**
333
+ **1. Use local AI for daily tasks:**
626
334
  ```bash
627
- glance url --model gpt-4o-mini # Fast, cheap, good quality
628
- glance url --model llama3 # Free, local, private
335
+ glance https://example.com --model llama3 # Free, fast, private
629
336
  ```
630
337
 
631
- **For highest quality:**
338
+ **2. Cache speeds up repeated requests:**
632
339
  ```bash
633
- glance url --model gpt-4o # Best reasoning
634
- glance url --model gemini-1.5-pro # Long context
340
+ glance https://docs.com # First: 3s
341
+ glance https://docs.com # Cached: 0.1s
635
342
  ```
636
343
 
637
- **For code/technical content:**
344
+ **3. Pipe output for scripting:**
638
345
  ```bash
639
- glance url --model codellama # Optimized for code
346
+ glance https://example.com --format plain | grep "keyword" | wc -l
640
347
  ```
641
348
 
642
- ### Optimizing Performance
643
-
349
+ **4. Save audio for commute:**
644
350
  ```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
351
+ glance https://article.com --tldr --audio-output commute.mp3
655
352
  ```
656
353
 
657
- ### Error Handling
658
-
354
+ **5. Use streaming for long content:**
659
355
  ```bash
660
- # Use verbose mode for debugging
661
- glance url --verbose
662
-
663
- # Check URL before processing
664
- glance url --dry-run
356
+ glance https://long-article.com --stream
665
357
  ```
666
358
 
667
359
  ---
668
360
 
669
361
  ## 🤝 Contributing
670
362
 
671
- We welcome contributions! Here's how to get started:
672
-
673
- ### Development Setup
363
+ Contributions welcome! Check out our [Contributing Guide](CONTRIBUTING.md).
674
364
 
675
365
  ```bash
676
- # Clone repository
677
366
  git clone https://github.com/jkenley/glance-cli.git
678
367
  cd glance-cli
679
-
680
- # Install dependencies
681
368
  bun install
682
-
683
- # Run locally
684
369
  bun dev https://example.com
685
-
686
- # Run tests
687
- bun test
688
-
689
- # Build
690
- bun build
691
370
  ```
692
371
 
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
372
  ---
852
373
 
853
374
  ## 📄 License
854
375
 
855
376
  MIT License - see [LICENSE](LICENSE) for details.
856
377
 
857
- Copyright © 2026 Kenley Jean-Louis
858
-
859
378
  ---
860
379
 
861
- ## 📞 Contact & Support
380
+ ## 🔗 Links
862
381
 
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
382
+ - **GitHub**: [github.com/jkenley/glance-cli](https://github.com/jkenley/glance-cli)
383
+ - **NPM**: [npmjs.com/package/glance-cli](https://www.npmjs.com/package/glance-cli)
384
+ - **Issues**: [github.com/jkenley/glance-cli/issues](https://github.com/jkenley/glance-cli/issues)
385
+ - **Changelog**: [CHANGELOG.md](CHANGELOG.md)
869
386
 
870
387
  ---
871
388
 
872
- **Built with ❤️ for developers, researchers, and curious minds.**
389
+ **Built with ❤️ by [Kenley Jean](https://github.com/jkenley)**
873
390
 
874
391
  *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.2",
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",