Fast CLI for summarizing anything you can point at:
- Web pages (article extraction; Firecrawl fallback if sites block agents)
- YouTube links (best-effort transcripts; can fall back to audio transcription)
- Podcasts (Apple Podcasts / Spotify / RSS; prefers published transcripts when available; otherwise transcribes full episodes)
- Any audio/video (local files or direct media URLs; transcribe via Whisper, then summarize)
- Remote files (PDFs/images/audio/video via URL — downloaded and forwarded to the model)
- Local files (PDFs/images/audio/video/text — forwarded or inlined; support depends on provider/model)
It streams output by default on TTY and renders Markdown to ANSI (via markdansi) using scrollback-safe hybrid streaming (line-by-line, but buffers fenced code blocks and tables as blocks). At the end it prints a single “Finished in …” line with timing, token usage, and a best-effort cost estimate (when pricing is available).
Requires Node 22+.
- npx (no install):
npx -y @steipete/summarize "https://example.com"- npm (global install):
npm i -g @steipete/summarize- npm (library / minimal deps):
npm i @steipete/summarize-coreimport { createLinkPreviewClient } from '@steipete/summarize-core/content'- Homebrew (custom tap):
brew install steipete/tap/summarizeApple Silicon only (arm64).
summarize "https://example.com"Want a one-click “always-on” summarizer in Chrome (real Side Panel, not injected UI)?
This is a Chrome extension + a tiny local daemon (autostart service) that streams Markdown summaries for the currently visible tab into the Side Panel.
Docs + setup: https://summarize.sh
Quickstart (local daemon):
- Install summarize (choose one):
npm i -g @steipete/summarizebrew install steipete/tap/summarize(macOS arm64)
- Build + load the extension (unpacked):
pnpm -C apps/chrome-extension build- Chrome →
chrome://extensions→ Developer mode → “Load unpacked” - Pick:
apps/chrome-extension/.output/chrome-mv3
- Open the Side Panel → it shows a token + install command.
- Run the install command in Terminal:
- Installed binary:
summarize daemon install --token <TOKEN> - Repo/dev checkout:
pnpm summarize daemon install --token <TOKEN> --dev
- Installed binary:
- Verify / debug:
summarize daemon statussummarize daemon restart
Notes:
-
Summarization only runs when the Side Panel is open.
-
“Auto” mode summarizes on navigation (incl. SPAs); otherwise use the button.
-
The daemon is localhost-only and requires a shared token.
-
Daemon autostart: macOS (launchd), Linux (systemd user), Windows (Scheduled Task).
-
Tip: configure
freeviasummarize refresh-free(requiresOPENROUTER_API_KEY). Add--set-defaultto also set model=free, then set Model tofreein extension settings. -
Docs:
docs/chrome-extension.md -
Extension package/dev notes:
apps/chrome-extension/README.md
Troubleshooting:
- “Receiving end does not exist”: Chrome didn’t inject the content script yet.
- Extension details → “Site access” → set to “On all sites” (or allow this domain)
- Reload the tab once.
- “Failed to fetch” / daemon unreachable:
- Run
summarize daemon status - Check logs:
~/.summarize/logs/daemon.err.log
- Run
Input can be a URL or a local file path:
npx -y @steipete/summarize "/path/to/file.pdf" --model google/gemini-3-flash-preview
npx -y @steipete/summarize "/path/to/image.jpeg" --model google/gemini-3-flash-previewRemote file URLs work the same (best-effort; the file is downloaded and passed to the model):
npx -y @steipete/summarize "https://example.com/report.pdf" --model google/gemini-3-flash-previewYouTube (supports youtube.com and youtu.be):
npx -y @steipete/summarize "https://youtu.be/dQw4w9WgXcQ" --youtube autoPodcast RSS feed (transcribes latest episode enclosure):
npx -y @steipete/summarize "https://feeds.npr.org/500005/podcast.xml"Apple Podcasts episode page (extracts stream URL, transcribes via Whisper):
npx -y @steipete/summarize "https://podcasts.apple.com/us/podcast/2424-jelly-roll/id360084272?i=1000740717432"Spotify episode page (best-effort; resolves to full episode via iTunes/RSS enclosure when available — not preview clips; may fail for Spotify-exclusive shows):
npx -y @steipete/summarize "https://open.spotify.com/episode/5auotqWAXhhKyb9ymCuBJY"This is “best effort” and depends on what your selected model/provider accepts. In practice these usually work well:
text/*and common structured text (.txt,.md,.json,.yaml,.xml, …)- text-like files are inlined into the prompt (instead of attached as a file part) for better provider compatibility
- PDFs:
application/pdf(provider support varies; Google is the most reliable in this CLI right now) - Images:
image/jpeg,image/png,image/webp,image/gif - Audio/Video:
audio/*,video/*(when supported by the model)
Notes:
- If a provider rejects a media type, the CLI fails fast with a friendly message (no “mystery stack traces”).
- xAI models currently don’t support attaching generic files (like PDFs) via the AI SDK; use a Google/OpenAI/Anthropic model for those.
Use “gateway-style” ids: <provider>/<model>.
Examples:
openai/gpt-5-minianthropic/claude-sonnet-4-5xai/grok-4-fast-non-reasoninggoogle/gemini-3-flash-previewzai/glm-4.7openrouter/openai/gpt-5-mini(force OpenRouter)
Note: some models/providers don’t support streaming or certain file media types. When that happens, the CLI prints a friendly error (or auto-disables streaming for that model when supported by the provider).
--length controls how much output we ask for (guideline), not a hard truncation.
npx -y @steipete/summarize "https://example.com" --length long
npx -y @steipete/summarize "https://example.com" --length 20k- Presets:
short|medium|long|xl|xxl - Character targets:
1500,20k,20000 - Optional hard cap:
--max-output-tokens <count>(e.g.2000,2k)- Provider/model APIs still enforce their own maximum output limits.
- If omitted, no max token parameter is sent (provider default).
- Prefer
--lengthunless you need a hard cap (some providers count “reasoning” into the cap).
- Minimums:
--lengthnumeric values must be ≥ 50 chars;--max-output-tokensmust be ≥ 16. - Preset targets (source of truth:
packages/core/src/prompts/summary-lengths.ts):- short: target ~900 chars (range 600-1,200)
- medium: target ~1,800 chars (range 1,200-2,500)
- long: target ~4,200 chars (range 2,500-6,000)
- xl: target ~9,000 chars (range 6,000-14,000)
- xxl: target ~17,000 chars (range 14,000-22,000)
- Text inputs over 10 MB are rejected before tokenization.
- Text prompts are preflighted against the model’s input limit (LiteLLM catalog), using a GPT tokenizer.
npx -y @steipete/summarize <input> [flags]Use summarize --help or summarize help for the full help text.
--model <provider/model>: which model to use (defaults toauto)--model auto: automatic model selection + fallback (default)--model <name>: use a config-defined model (see “Configuration”)--timeout <duration>:30s,2m,5000ms(default2m)--retries <count>: LLM retry attempts on timeout (default1)--length short|medium|long|xl|xxl|s|m|l|<chars>--language, --lang <language>: output language (auto= match source; oren,de,english,german, ...)--max-output-tokens <count>: hard cap for LLM output tokens (optional; only sent when set)--cli [provider]: use a CLI provider (case-insensitive; equivalent to--model cli/<provider>). If omitted, uses auto selection with CLI enabled.--stream auto|on|off: stream LLM output (auto= TTY only; disabled in--jsonmode)--plain: Keep raw output (no ANSI/OSC Markdown rendering)--no-color: disable ANSI colors--format md|text: website/file content format (defaulttext)--markdown-mode off|auto|llm|readability: Markdown conversion mode (defaultreadability). For websites: HTML→Markdown conversion. For YouTube transcripts:llmformats the raw transcript into clean Markdown (headings/paragraphs).--preprocess off|auto|always: controlsuvx markitdownusage (defaultauto;alwaysforces file preprocessing)- Install
uvx:brew install uv(or https://astral.sh/uv/)
- Install
--extract: print extracted content and exit (no summary) — only for URLs- Deprecated alias:
--extract-only
- Deprecated alias:
--json: machine-readable output with diagnostics, prompt,metrics, and optional summary--verbose: debug/diagnostics on stderr--metrics off|on|detailed: metrics output (defaulton;detailedadds a compact 2nd-line breakdown on stderr)
Run: summarize <url>
- Apple Podcasts
- Spotify
- Amazon Music / Audible podcast pages
- Podbean
- Podchaser
- RSS feeds (Podcasting 2.0 transcripts when available)
- Embedded YouTube podcast pages (e.g. JREPodcast)
Transcription: prefers local whisper.cpp when installed; otherwise uses OpenAI Whisper or FAL when keys are set.
--language/--lang controls the output language of the summary (and other LLM-generated text). Default is auto (match source language).
When the input is audio/video, the CLI needs a transcript first. The transcript comes from one of these paths:
- Existing transcript (preferred)
- YouTube: uses
youtubei/captionTrackswhen available. - Podcasts: uses Podcasting 2.0 RSS
<podcast:transcript>(JSON/VTT) when the feed publishes it.
- YouTube: uses
- Whisper transcription (fallback)
- YouTube: falls back to
yt-dlp(audio download) + Whisper transcription when configured; Apify is a last-last resort (requiresAPIFY_API_TOKEN). - Prefers local
whisper.cppwhen installed + model available. - Otherwise uses cloud Whisper (OpenAI
OPENAI_API_KEY) or FAL (FAL_KEY) depending on configuration.
- YouTube: falls back to
For “any video/audio file” (local path or direct media URL), use --video-mode transcript to force “transcribe → summarize”:
summarize /path/to/file.mp4 --video-mode transcript --lang en--model auto builds candidate attempts from built-in rules (or your model.rules overrides).
CLI tools are not used in auto mode unless you explicitly enable them via cli.enabled in config.
Why: CLI adds ~4s latency per attempt and higher variance.
Shortcut: --cli (with no provider) uses auto selection with CLI enabled.
When enabled, auto prepends CLI attempts in the order listed in cli.enabled
(recommended: ["gemini"]), then tries the native provider candidates
(with OpenRouter fallbacks when configured).
Enable CLI attempts:
{
"cli": { "enabled": ["gemini"] }
}Disable CLI attempts:
{
"cli": { "enabled": [] }
}Note: when cli.enabled is set, it’s also an allowlist for explicit --cli / --model cli/....
Non-YouTube URLs go through a “fetch → extract” pipeline. When the direct fetch/extraction is blocked or too thin, --firecrawl auto can fall back to Firecrawl (if configured).
--firecrawl off|auto|always(defaultauto)--extract --format md|text(defaulttext; if--formatis omitted,--extractdefaults tomdfor non-YouTube URLs)--markdown-mode off|auto|llm|readability(defaultreadability; for non-YouTube URLs this controls HTML→Markdown conversion)auto: use an LLM converter when configured; may fall back touvx markitdownllm: force LLM conversion (requires a configured model key)off: disable LLM conversion (still may return Firecrawl Markdown when configured)
- Plain-text mode: use
--format text.
--youtube auto tries best-effort web transcript endpoints first. When captions aren't available, it falls back to:
- Apify (if
APIFY_API_TOKENis set): Uses a scraping actor (faVsWy9VTSNVIhWpR) - yt-dlp + Whisper (if
yt-dlpis available): Downloads audio via yt-dlp, transcribes with localwhisper.cppwhen installed (preferred), otherwise falls back to OpenAI (OPENAI_API_KEY) or FAL (FAL_KEY)
Environment variables for yt-dlp mode:
YT_DLP_PATH- optional path to yt-dlp binary (otherwiseyt-dlpis resolved viaPATH)SUMMARIZE_WHISPER_CPP_MODEL_PATH- optional override for the localwhisper.cppmodel fileSUMMARIZE_WHISPER_CPP_BINARY- optional override for the local binary (default:whisper-cli)SUMMARIZE_DISABLE_LOCAL_WHISPER_CPP=1- disable local whisper.cpp (force remote)OPENAI_API_KEY- OpenAI Whisper transcriptionFAL_KEY- FAL AI Whisper fallback
Apify costs money but tends to be more reliable when captions exist.
Format the extracted transcript as Markdown (headings + paragraphs) via an LLM:
summarize "https://www.youtube.com/watch?v=..." --extract --format md --markdown-mode llm--video-mode transcript forces audio/video inputs (local files or direct media URLs) through Whisper first, then summarizes the transcript text. Prefers local whisper.cpp when available; otherwise requires OPENAI_API_KEY or FAL_KEY.
Single config location:
~/.summarize/config.json
Supported keys today:
{
"model": { "id": "openai/gpt-5-mini" }
}Shorthand (equivalent):
{
"model": "openai/gpt-5-mini"
}Also supported:
model: { "mode": "auto" }(automatic model selection + fallback; seedocs/model-auto.md)model.rules(customize candidates / ordering)models(define presets selectable via--model <preset>)media.videoMode: "auto"|"transcript"|"understand"openai.useChatCompletions: true(force OpenAI-compatible chat completions)
Note: the config is parsed leniently (JSON5), but comments are not allowed. Unknown keys are ignored.
Precedence:
--modelSUMMARIZE_MODEL~/.summarize/config.json- default (
auto)
Set the key matching your chosen --model:
OPENAI_API_KEY(foropenai/...)ANTHROPIC_API_KEY(foranthropic/...)XAI_API_KEY(forxai/...)Z_AI_API_KEY(forzai/...; supportsZAI_API_KEYalias)GEMINI_API_KEY(forgoogle/...)- also accepts
GOOGLE_GENERATIVE_AI_API_KEYandGOOGLE_API_KEYas aliases
- also accepts
OpenAI-compatible chat completions toggle:
OPENAI_USE_CHAT_COMPLETIONS=1(or setopenai.useChatCompletionsin config)
OpenRouter (OpenAI-compatible):
- Set
OPENROUTER_API_KEY=... - Prefer forcing OpenRouter per model id:
--model openrouter/<author>/<slug>(e.g.openrouter/meta-llama/llama-3.1-8b-instruct:free) - Built-in preset:
--model free(uses a default set of OpenRouter:freemodels).
Quick start: make free the default (keep auto available)
# writes ~/.summarize/config.json (models.free) and sets model="free"
summarize refresh-free --set-default
# now this defaults to free models
summarize "https://example.com"
# whenever you want best quality instead
summarize "https://example.com" --model autoRegenerates the free preset (writes models.free into ~/.summarize/config.json) by:
- Fetching OpenRouter
/models, filtering:free - Skipping models that look very small (<27B by default) based on the model id/name (best-effort heuristic)
- Testing which ones return non-empty text (concurrency 4, timeout 10s)
- Picking a mix of “smart-ish” (bigger
context_length/ output cap) and fast models - Refining timings for the final selection and writing the sorted list back
If --model free stops working (rate limits, allowed-provider restrictions, models removed), run:
summarize refresh-freeFlags:
--runs 2(default): extra timing runs per selected model (total runs = 1 + runs)--smart 3(default): how many “smart-first” picks (rest filled by fastest)--min-params 27b(default): ignore models with inferred size smaller than N billion parameters--max-age-days 180(default): ignore models older than N days (set 0 to disable)--set-default: also sets"model": "free"in~/.summarize/config.json
Example:
OPENROUTER_API_KEY=sk-or-... summarize "https://example.com" --model openrouter/meta-llama/llama-3.1-8b-instruct:freeIf your OpenRouter account enforces an allowed-provider list, make sure at least one provider
is allowed for the selected model. (When routing fails, summarize prints the exact providers to allow.)
Legacy: OPENAI_BASE_URL=https://openrouter.ai/api/v1 (and either OPENAI_API_KEY or OPENROUTER_API_KEY) also works.
Z.AI (OpenAI-compatible):
Z_AI_API_KEY=...(orZAI_API_KEY=...)- Optional base URL override:
Z_AI_BASE_URL=...
Optional services:
FIRECRAWL_API_KEY(website extraction fallback)YT_DLP_PATH(path to yt-dlp binary for audio extraction)FAL_KEY(FAL AI API key for audio transcription via Whisper)APIFY_API_TOKEN(YouTube transcript fallback)
The CLI uses the LiteLLM model catalog for model limits (like max output tokens):
- Downloaded from:
https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json - Cached at:
~/.summarize/cache/
Recommended (minimal deps):
@steipete/summarize-core/content@steipete/summarize-core/prompts
Compatibility (pulls in CLI deps):
@steipete/summarize/content@steipete/summarize/prompts
pnpm install
pnpm check