> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://summarize.martino.im/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://summarize.martino.im/_mcp/server.

# CLI Reference

> **Note**
>
> All flags override the corresponding settings in `summarizer.yaml`. Use `--verbose` to see detailed status output during config loading, downloads, transcription, and summarization.

## Examples

#### Basic

```bash
# Uses default provider from YAML
python -m summarizer --source "https://youtube.com/watch?v=VIDEO_ID"

# Console entry point (after pipx or pip install)
summarizer --source "URL"

# Specific provider
python -m summarizer --source "URL" --provider groq

# Extract key insights
python -m summarizer --source "URL" --provider gemini --prompt-type "Distill Wisdom"

# Generate a Mermaid diagram
python -m summarizer --source "URL" --provider openrouter --prompt-type "Mermaid Diagram"

# Batch process
python -m summarizer --source "URL1" "URL2" "URL3"

# Local file
python -m summarizer --type "Local File" --source "./lecture.mp4"

# Text file (skip audio entirely)
python -m summarizer --type "TXT" --source "./transcript.txt"

# No config (all explicit)
python -m summarizer \
  --source "URL" \
  --base-url "https://openrouter.ai/api/v1" \
  --model "google/gemini-2.0-flash-exp:free" \
  --api-key "sk-or-v1-YOUR_KEY" \
  --prompt-type "Tutorial" \
  --no-config
```

#### Fact-checking

```bash
python -m summarizer \
  --source "URL" \
  --base-url "https://api.perplexity.ai" \
  --model "sonar-pro" \
  --prompt-type "Fact Checker"
```

#### Audio and Language

```bash
# Speed up audio before Whisper (faster, may reduce accuracy)
python -m summarizer --source "URL" --speed 2.0

# Aggressive speed-up (any positive value)
python -m summarizer --source "URL" --speed 5.0

# Speed up video in visual mode (base64 path)
python -m summarizer --source "URL" --provider nvidia --visual --speed 1.5

# Lock captions/transcription to Italian
python -m summarizer --source "URL" --language "it"

# Write the summary in Italian
python -m summarizer --source "URL" --output-language "Italian"

# Select passages before summarization
python -m summarizer --source "URL" \
  --use-jev-prefiltering \
  --jev-include "a particular concept about this video to filter" \
  --jev-exclude "Sponsorship and self-promotion"
```

## Flag Reference

| Flag                                                   | Description                                                                                                                                                                                     | Default                                                  |
| ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| `--source`                                             | Video URLs, file paths, or text files (multiple allowed)                                                                                                                                        | Required                                                 |
| `--provider`                                           | Provider name from YAML                                                                                                                                                                         | `default_provider`                                       |
| `--base-url`                                           | API endpoint (overrides provider)                                                                                                                                                               | From YAML                                                |
| `--model`                                              | Model identifier (overrides provider)                                                                                                                                                           | From YAML                                                |
| `--api-key`                                            | API key (overrides `.env`)                                                                                                                                                                      | -                                                        |
| `--type`                                               | `YouTube Video`, `Video URL`, `Local File`, `Google Drive Video Link`, `Dropbox Video Link`, `TXT`                                                                                              | `YouTube Video`                                          |
| `--prompt-type`                                        | Summary style                                                                                                                                                                                   | From YAML defaults                                       |
| `--chunk-size`                                         | Input text chunk size in characters (min 1000)                                                                                                                                                  | `120000` (from `summarizer.yaml`; code fallback `10000`) |
| `--force-download`                                     | Skip captions and download audio instead                                                                                                                                                        | `False`                                                  |
| `--transcription`                                      | `Cloud Whisper` (Groq Whisper API) or `Local Whisper` (local Whisper)                                                                                                                           | `Cloud Whisper`                                          |
| `--whisper-model`                                      | `tiny`, `base`, `small`, `medium`, `large`                                                                                                                                                      | `tiny`                                                   |
| `--speed`                                              | Playback speed for audio preprocessing or visual-mode video. Reduces Groq cost (priced by duration) but may reduce accuracy. Values other than `1.0` skip YouTube captions. Any positive value. | `1.0`                                                    |
| `--language`                                           | `auto` or explicit code for captions/transcription                                                                                                                                              | `auto`                                                   |
| `--output-language`                                    | Summary language; `auto`, `none`, or name                                                                                                                                                       | `auto`                                                   |
| `--output-format`                                      | `markdown`, `json`, or `html`                                                                                                                                                                   | `markdown`                                               |
| `--parallel-calls`                                     | Concurrent API requests                                                                                                                                                                         | `10` (from `summarizer.yaml`; code fallback `30`)        |
| `--max-tokens`                                         | Max output tokens per chunk                                                                                                                                                                     | `4096`                                                   |
| `--cobalt-url`                                         | Cobalt base URL for fallback downloads                                                                                                                                                          | `http://localhost:9000`                                  |
| `--output-dir`                                         | Output directory                                                                                                                                                                                | `summaries`                                              |
| `--no-save`                                            | Print to stdout only, no file output                                                                                                                                                            | `False`                                                  |
| `--verbose`, `-v`                                      | Detailed output                                                                                                                                                                                 | `False`                                                  |
| `--visual`                                             | Send video directly to a video-capable model                                                                                                                                                    | `False`                                                  |
| `--use-jev-prefiltering` / `--no-use-jev-prefiltering` | Enable or disable transcript selection before summarization                                                                                                                                     | From YAML (`false`)                                      |
| `--jev-provider`                                       | Existing OpenRouter or TypeSafe provider used for scoring                                                                                                                                       | `openrouter`                                             |
| `--jev-include`                                        | Include only passages about this concept; blank means general relevance                                                                                                                         | `""`                                                     |
| `--jev-exclude`                                        | Exclude matching passages; exclusions take priority                                                                                                                                             | `""`                                                     |
| `--use-proxy`                                          | Route supported requests through the configured HTTP proxy                                                                                                                                      | From YAML                                                |
| `--config`                                             | Path to config file                                                                                                                                                                             | auto-detect                                              |
| `--no-config`                                          | Ignore config file, use CLI args only                                                                                                                                                           | -                                                        |
| `--init-config`                                        | Generate example `summarizer.yaml` and exit                                                                                                                                                     | -                                                        |

## HTTP API Server

Start a local FastAPI server that exposes the same functionality over HTTP:

```bash
python -m summarizer serve
```

Customize host and port:

```bash
python -m summarizer serve --host 0.0.0.0 --port 8080
```

Interactive docs are available at `http://localhost:8000/docs`. See the [HTTP API guide](api-reference/http-api) for endpoint reference and example requests.

> **Tip:** Use `--verbose` to see detailed status output during config loading, downloads, transcription with Whisper, and summarization.
>
> **Tip:** On Windows, do NOT use `--no-save` — Unicode output crashes stdout. Always let the tool save to file, then read it.
>
> **Tip:** `--chunk-size` has a hard minimum of 1000 characters. Values below 1000 are clamped automatically.

## Output Formats

### Markdown (default)

Clean Markdown with optional bold titles. Saved as `.md`.

### JSON

```bash
python -m summarizer --source "URL" --output-format json
```

Includes metadata:

```json
{
  "source": "https://youtube.com/watch?v=VIDEO_ID",
  "generated_at": "2026-06-01T20:00:00",
  "prompt_type": "Distill Wisdom",
  "model": "gemini-3.5-flash-lite",
  "summary": "..."
}
```

### HTML

```bash
python -m summarizer --source "URL" --output-format html
```