# Technical Documentation: nexmoe/VidBee

> ℹ️ **Provenance:** Multi-Tier Ingestion · [CodeWiki Reference](https://codewiki.google/github.com/nexmoe/VidBee)

### Overview (`README.md`)

<div align="left">
  <a href="https://github.com/nexmoe/VidBee">
    <img src="apps/desktop/build/icon.png" alt="Logo" width="80" height="80">
  </a>

  <h3>VidBee</h3>
  <p>
    <a href="https://github.com/nexmoe/VidBee/stargazers"><img src="https://img.shields.io/github/stars/nexmoe/VidBee?color=ffcb47&labelColor=black&logo=github&label=Stars" /></a>
    <a href="https://github.com/nexmoe/VidBee/graphs/contributors"><img src="https://img.shields.io/github/contributors/nexmoe/VidBee?ogo=github&label=Contributors&labelColor=black" /></a>
    <a href="https://github.com/nexmoe/VidBee/releases"><img src="https://img.shields.io/github/downloads/nexmoe/VidBee/total?color=369eff&labelColor=black&logo=github&label=Downloads" /></a>
    <a href="https://github.com/nexmoe/VidBee/releases/latest"><img src="https://img.shields.io/github/v/release/nexmoe/VidBee?color=369eff&labelColor=black&logo=github&label=Latest%20Release" /></a>
    <a href="https://x.com/intent/follow?screen_name=nexmoe"><img src="https://img.shields.io/badge/Follow-%40nexmoe-1d9bf0?logo=x&labelColor=black" alt="Follow @nexmoe on X" /></a>
    <a href="https://www.threads.com/@nexmoe"><img src="https://img.shields.io/badge/Follow-%40nexmoe-black?logo=threads&labelColor=black" alt="Follow @nexmoe on Threads" /></a>
    <a href="https://deepwiki.com/nexmoe/VidBee"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>
    <br />
    <br />
    <a href="https://github.com/nexmoe/VidBee" target="_blank"><img src="screenshots/transcript-framed.webp" alt="VidBee searchable transcript with speaker labels" width="46%"/></a>
    <a href="https://github.com/nexmoe/VidBee" target="_blank"><img src="screenshots/ai-summary-framed.webp" alt="VidBee AI summary generated from a transcript" width="46%"/></a>
    <br />
    <br />
  </p>
</div>

VidBee is a free, open-source desktop app that turns video and audio into an organized, searchable library. Download media from 1000+ supported sites or import local files. Create transcripts on your computer with speaker labels and timestamped playback, then summarize, translate, or ask questions with the AI provider and prompts you choose. Download queues, RSS subscriptions, flexible exports, and metadata controls keep the whole workflow in one place.

## 👋🏻 Getting Started

VidBee is currently under active development, and feedback is welcome for any [issue](https://github.com/nexmoe/VidBee/issues) encountered.

[📥 Download VidBee](https://vidbee.org/download/) | [📚 Documentation](https://vidbee.org/docs/)

> [!IMPORTANT]
>
> **Star Us**, You will receive all release notifications from GitHub without any delay ~

If VidBee is useful to you, sharing it is one of the best ways to support the project.

> [!IMPORTANT]
>
> When you post about VidBee on **X** or **Threads**, please mention **@nexmoe** so I can see it and help amplify it:
> - X: [@nexmoe](https://x.com/nexmoe)
> - Threads: [@nexmoe](https://www.threads.com/@nexmoe)
> - GitHub: [@nexmoe](https://github.com/nexmoe)

## ✨ Features

### 📝 Transcribe locally with the model that fits your computer

Create a transcript from a finished download, or import a local audio or video file. Speech recognition runs on your computer, so the media does not need to be uploaded to a transcription service.

- Choose from local **Whisper**, **SenseVoice**, **Parakeet**, and **Qwen3-ASR** model families. VidBee can recommend a model for your computer and language, and you can download or switch models from Settings.
- Start transcription automatically after a download and set how many transcript jobs may run at once.
- Use source captions when available, or run local speech recognition when you need a new transcript.
- Detect speakers automatically, or set a fixed speaker count and re-label the conversation without changing the recognized words.
- Search spoken text or speaker names, click a timestamp, and continue playback from that exact moment.
- Copy the transcript, export plain text or Markdown, or create a new video with selectable or burned-in captions.



> [!NOTE]
>
> **Local transcription, provider-controlled AI.** Speech recognition runs on your computer. When you run an AI prompt, the prompt and transcript content go to the provider you selected. Choose Ollama, LM Studio, or another local endpoint to keep the AI step on your computer too.

### 🧠 Ask AI with the provider and prompts you choose

Run AI prompts against the transcript without leaving VidBee. Built-in prompts can create bullet summaries, clean up grammar, generate FAQs, extract statistics, build mind maps, paraphrase text, or translate the transcript.

- Connect OpenAI, Anthropic, Google, DeepSeek, Groq, Azure, Hugging Face, OpenRouter, xAI, Ollama, or LM Studio.
- Add a custom provider with your own name, Base URL, model ID, and API key, then test the connection before using it.
- Import SKILL.md files, manage installed skills, try suggested requests in chat, or restore the defaults.
- Switch the active provider without changing your prompt library. API keys are stored on your computer.



### 📥 Download and organize video or audio

Save video, audio, playlists, and channels from 1000+ supported sites. Paste one link or add a batch, then manage everything from the same desktop queue.

- Track active, completed, and failed downloads in one place.
- See live progress, speed, file size, and the format being saved.
- Pause, resume, retry, or remove tasks without rebuilding the queue.
- Use one-click defaults when you want a fast download, or choose formats for a specific item.



### 📡 Follow creators with configurable RSS subscriptions

Subscribe to RSS feeds and let VidBee check for new items and add them to your download queue. Each subscription can use its own rules, so regular releases do not need the same manual setup every time.

- Turn automatic downloads on or keep new items ready for manual review.
- Filter feed items by keywords, add automatic tags, and download only the latest item when you do not want the backlog.
- Choose a custom directory and filename template for each subscription.
- See whether each feed item is queued, downloading, completed, failed, or still waiting.



### 🏷️ Control formats, filenames, and metadata

Choose **Auto (MP4/MKV)**, **MP4**, **MKV**, **WebM**, or **Original** for video downloads, or save audio separately. VidBee also lets you control what is written into the finished file.

- Embed the source title, artist, and other available metadata.
- Add the thumbnail as cover art, keep chapter markers, and include source or automatically generated subtitles when available.
- Choose a filename style, decide whether to use channel subfolders, and set the default download location.
- Keep simple defaults for everyday downloads while using custom filename templates for playlists or RSS subscriptions.

See [Formats & Containers](https://vidbee.org/docs/formats/) for details.

## 🎬 Built for real media workflows

| Working with | VidBee helps you |
| --- | --- |
| Interviews | Separate speakers, find a quote, jump back to its timestamp, and export the transcript. |
| Podcasts | Create a searchable episode transcript, summarize the discussion, and use RSS to keep new episodes organized. |
| Lectures | Search for an explanation, translate the transcript, and turn a long recording into structured notes. |
| YouTube and saved videos | Download from a supported page or import a local file, preserve available captions and metadata, and manage everything in one queue. |

## 🌐 Supported Sites

VidBee works with 1000+ supported video and audio sites. Browse the current list at [vidbee.org/supported-sites](https://vidbee.org/supported-sites/).

## 🧱 Web + API (Docker-ready)

This monorepo now includes:

- `packages/downloader-core`: Shared yt-dlp/ffmpeg download core
- `apps/api`: Fastify API server with oRPC and SSE events
- `apps/web`: TanStack Start web client using oRPC

Run locally:

```bash
pnpm run start:web
```

This command starts `apps/api` and `apps/web` together.

Run with Docker:

```bash
docker compose up -d --build
```

Run with GitHub Container Registry images:

```yaml
services:
  api:
    image: ghcr.io/nexmoe/vidbee-api:latest
    environment:
      VIDBEE_API_HOST: 0.0.0.0
      VIDBEE_API_PORT: 3100
      VIDBEE_DOWNLOAD_DIR: /data/downloads
      VIDBEE_DATA_DIR: /data/vidbee
      VIDBEE_HISTORY_STORE_PATH: /data/vidbee/vidbee.db
    ports:
      - "3100:3100"
    volumes:
      # Replace the named volume with /path/on/your/NAS:/data/downloads
      # when downloaded files must be directly visible on the host.
      - vidbee-downloads:/data/downloads
      - vidbee-data:/data/vidbee
    restart: unless-stopped

  web:
    image: ghcr.io/nexmoe/vidbee-web:latest
    depends_on:
      - api
    ports:
      - "3000:3000"
    restart: unless-stopped

volumes:
  vidbee-downloads:
  vidbee-data:
```

Stop services:

```bash
docker compose down
```

Optional env vars (via `.env`):

```bash
VIDBEE_API_PORT=3100
VIDBEE_WEB_PORT=3000
# Optional host or NAS bind mount. The named volume remains the default.
VIDBEE_DOWNLOAD_DIR_HOST=/path/on/your/NAS/downloads
```

Storage inside the API container:

- `/data/downloads` — media files (`VIDBEE_DOWNLOAD_DIR`)
- `/data/vidbee` — `vidbee.db` (queue, history, transcripts, subscriptions), settings, uploaded cookies, and transcription models (`VIDBEE_DATA_DIR`)

The web API uses the same SQLite file layout as Desktop: one `vidbee.db` for the download queue, history, transcripts, and RSS subscriptions. The web UI talks to the server filesystem, not the browser. Use **Save to this computer** to pull a finished file down, and upload a Netscape `cookies.txt` for authenticated sites. If you already stored sqlite under `/data/downloads/.vidbee`, VidBee keeps using that directory until `/data/vidbee/vidbee.db` exists.

## 🤝 Contributing

You are welcome to join the open source community to build together. For more details, check out:

- Monorepo apps:
  - `apps/desktop`: VidBee desktop app
  - `apps/extension`: Browser extension (WXT)
  - Documentation: [vidbee.org/docs](https://vidbee.org/docs/)
  - `apps/desktop/docs/glitchtip.md`: GlitchTip and `sentry-cli` setup for desktop monitoring
- [Contributing Guide](./CONTRIBUTING.md)
- [DeepWiki Documentation](https://deepwiki.com/nexmoe/VidBee)

## 📄 License

This project is distributed under the MIT License. See [`LICENSE`](LICENSE) for details.

## 🙏 Thanks

- [yt-dlp](https://github.com/yt-dlp/yt-dlp) - The powerful video downloader engine
- [FFmpeg](https://ffmpeg.org/) - The multimedia framework for video and audio processing
- [Electron](https://www.electronjs.org/) - Build cross-platform desktop apps
- [React](https://react.dev/) - The UI library
- [Vite](https://vitejs.dev/) - Next generation frontend tooling
- [Tailwind CSS](https://tailwindcss.com/) - Utility-first CSS framework
- [shadcn/ui](https://ui.shadcn.com/) - Beautifully designed components

---

### Overview (`apps/cli/README.md`)

# `@vidbee/cli`

Standalone command-line interface to [VidBee](https://github.com/nexmoe/vidbee), built on the shared `@vidbee/task-queue` kernel. CLI invocations land in the same queue that the Desktop UI and Web/API host use; nothing bypasses the application.

The CLI is **distributed independently** of VidBee Desktop: you do not need to install or run the desktop app to use it. Common targets are CI runners, Docker images, agents, and headless Linux servers — places where shipping a 100 MB Electron bundle to invoke `yt-dlp` would be wrong.

> Reference designs: `docs/vidbee-desktop-first-cli-ytdlp-rss-design.md` (CLI surface), `docs/vidbee-task-queue-state-machine-design.md` (kernel).

---

## Install

Pick one. All three install the same `@vidbee/cli` Node package — there is no native binary today; we rely on Node ≥ 20 being available.

### npm / pnpm / bun

```sh
# npm (most common)
npm install @vidbee/cli

# pnpm
pnpm add @vidbee/cli

# bun
bun install -g @vidbee/cli
```

`npx @vidbee/cli ...` works without a global install.

### Homebrew (macOS / Linux)

```sh
brew install vidbee/tap/vidbee
```

> The tap (`vidbee/homebrew-tap`) is a separate repository tracked under NEX-148 follow-ups. The formula wraps the same npm tarball.

### Shell installer

```sh
curl -fsSL https://vidbee.dev/cli/install.sh | sh
```

The installer downloads the npm tarball into `~/.vidbee/cli` and writes a `vidbee` shim into `~/.local/bin`, picking up your shell from `$SHELL`. Source: [`scripts/cli-install.sh`](https://github.com/nexmoe/vidbee/blob/main/scripts/cli-install.sh).

### Windows

Use the npm channel (`npm install @vidbee/cli`) for now. The shell installer requires bash + tar; on Windows we recommend WSL or an `npm i -g` install from PowerShell. If your PowerShell execution policy blocks scripts, run `Set-ExecutionPolicy -Scope Process Bypass` once for the current shell.

### Need crash-recovery for `--vidbee-local`?

The in-process transport persists task state in SQLite when `better-sqlite3` is available. It is declared as an `optionalDependency`; install it explicitly if you want crash-recovery:

```sh
npm install @vidbee/cli better-sqlite3
```

---

## Three transports

The CLI talks to a `taskQueueContract` host. There are three transports, all wire-compatible:

- **Desktop loopback** (default when a Desktop install is detected): reads the per-user automation descriptor (`~/Library/Application Support/VidBee/automation.json` on macOS, `${XDG_CONFIG_HOME:-~/.config}/VidBee/automation.json` on Linux, `%APPDATA%\VidBee\automation.json` on Windows), handshakes for a 1h bearer token, and POSTs JSON to `http://127.0.0.1:<port>/automation/v1/*`.
- **Remote API** (`--vidbee-api <url>`): same wire format against any VidBee Web/API host. Plain HTTP is rejected unless the host is loopback or RFC1918 private. HTTPS is required everywhere else.
- **In-process** (`--vidbee-local`): instantiates `TaskQueueAPI` + `YtDlpExecutor` directly. No Desktop, no API server, no descriptor. Used for CI and Docker images.

If the Desktop descriptor is missing or its PID is stale, the CLI tries to launch Desktop in background mode. Pass `--vidbee-no-autostart` to opt out and exit `3` instead. On a host with no Desktop installed, use `--vidbee-api` or `--vidbee-local`.

---

## Argv contract

A single rule splits argv:

- Tokens starting with `--vidbee-` are reserved (full list below). Unknown `--vidbee-*` tokens are treated as typos and rejected with exit code `2` — they are **not** silently passed through to yt-dlp.
- Tokens starting with `:` are VidBee subcommands (`:status`, `:download list`, `:version`, …).
- Everything else is order-preserved and forwarded to yt-dlp.

### `--vidbee-*` flags

| flag | meaning |
| --- | --- |
| `--vidbee-api <url>` | connect to a remote VidBee API instead of the local Desktop |
| `--vidbee-local` | run TaskQueueAPI in-process (CI / Docker) |
| `--vidbee-target <desktop\|api\|local>` | explicit transport selection |
| `--vidbee-pretty` | indent JSON output |
| `--vidbee-wait` | block until terminal status |
| `--vidbee-detach` | return immediately after enqueue (default) |
| `--vidbee-priority <user\|subscription\|background>` | set task priority (default: user) |
| `--vidbee-max-attempts <n>` | override outer retry cap (`0` disables) |
| `--vidbee-no-retry` | shortcut for `--vidbee-max-attempts 0` |
| `--vidbee-group-key <key>` | override per-group concurrency key |
| `--vidbee-timeout <ms>` | autostart wait budget (default `10000`) |
| `--vidbee-no-autostart` | do not launch Desktop in background mode |
| `--vidbee-token <token>` | skip handshake (for CI / smoke tests) |

### Probe vs download

The CLI inspects argv exactly once: if any of `-j / --dump-json / -J / --dump-single-json / -F / --list-formats / --list-formats-as-table / --list-formats-old / --print / --get-* / -s / --simulate / --skip-download / --list-subs / --list-extractors / --list-extractor-descriptions / --update / --version` is present, the run is a **probe**: yt-dlp is spawned directly, output is captured into the §4.4 envelope, and no task is enqueued. Otherwise the run is a **download** and goes through `taskQueueContract.add({ kind: 'yt-dlp-forward', … })`.

`-o -` (write yt-dlp output to stdout) is allowed in probe mode only.

---

## Subcommands

```sh
vidbee :status
vidbee :version
vidbee :upgrade [--force] [--cache <path>]
vidbee :download list [--status queued|running|...] [--limit N] [--cursor C]
vidbee :download status <id>
vidbee :download logs <id>
vidbee :download cancel <id>
vidbee :download pause <id> [--reason text]
vidbee :download resume <id>
vidbee :download retry <id>
vidbee :history list
vidbee :history remove <id...>
```

`:rss …` is owned by NEX-132 and shares the same dispatch.

### `:version`

Prints the installed CLI version + contract version + a link to the changelog. Does not contact any host — safe to run on a machine with no Desktop and no network.

```json
{
  "ok": true,
  "mode": "subcommand",
  "subcommand": "version",
  "result": {
    "cli": "0.1.0",
    "contract": "0.1.0",
    "changelog": "https://github.com/nexmoe/vidbee/blob/main/apps/cli/CHANGELOG.md"
  }
}
```

### `:upgrade`

Checks `https://registry.npmjs.org/@vidbee/cli/latest` and prints whether a newer version exists, along with the install command for each supported package manager. Does **not** auto-spawn `npm install`: global installs touch sudo / system PATH and are best left to the user.

The result is cached for 30 days under `~/Library/Caches/VidBee/cli-upgrade-check.json` (macOS), `${XDG_CACHE_HOME:-~/.cache}/vidbee/cli-upgrade-check.json` (Linux), or `%LOCALAPPDATA%\VidBee\cli-upgrade-check.json` (Windows). Pass `--force` to bypass the cache, or `--cache <path>` to redirect it.

```json
{
  "ok": true,
  "mode": "subcommand",
  "subcommand": "upgrade",
  "result": {
    "current": "0.1.0",
    "latest": "0.2.0",
    "upToDate": false,
    "cached": false,
    "cachedAt": "2026-05-02T00:00:00.000Z",
    "registryUrl": "https://registry.npmjs.org/@vidbee/cli/latest",
    "installCommands": {
      "npm": "npm install @vidbee/cli",
      "pnpm": "pnpm add @vidbee/cli",
      "bun": "bun install -g @vidbee/cli",
      "brew": "brew upgrade vidbee/tap/vidbee"
    }
  }
}
```

---

## Output

Every invocation prints exactly one JSON document on stdout. Exit codes follow design §4.4:

| code | meaning |
| --- | --- |
| `0` | success (probe / detached enqueue / wait-mode terminal success) |
| `1` | wait-mode reached non-success (`failed`, `retry-scheduled`, `paused`, timeout) |
| `2` | argv parse error |
| `3` | Desktop / API unreachable |
| `4` | authentication failure |
| `5` | contract / version mismatch |

Sensitive arguments (`--password`, `--video-password`, `--ap-password`, `--twofactor`, `--add-headers Authorization:…`, URL query strings with `token=` / `access_token=` / `signature=` / `policy=`) are redacted to `<redacted>` before any envelope, persisted task row, or projection sees them.

---

## Versioning & releasing

CLI semver is **independent of VidBee Desktop**. The CLI starts at `0.1.0`; Desktop continues on `1.x`. We bump the CLI on its own cadence so a `yt-dlp` probe-flag fix doesn't have to wait for a Desktop release.

To cut a release:

1. Update `apps/cli/package.json` `version` and add a `CHANGELOG.md` entry.
2. Push a `cli-vX.Y.Z` tag. The [`cli-publish.yml`](https://github.com/nexmoe/vidbee/blob/main/.github/workflows/cli-publish.yml) workflow typechecks, builds, and publishes to npm with `pnpm publish` using the `NPM_TOKEN` secret.
3. Verify on a clean machine: `npx @vidbee/cli@latest :version` should report the new version.

`pnpm --filter @vidbee/cli build` produces `dist/index.mjs` (single bundled ESM file) and `dist/bin/vidbee.mjs` (the npm `bin`). The published tarball includes only `dist/`, the README, the CHANGELOG, and the LICENSE — no source.

---

### Overview (`apps/extension/README.md`)

# VidBee Video Downloader Extension

VidBee Video Downloader is a lightweight browser companion for the VidBee desktop app. It detects the video on your current tab, shows the available formats, and hands the URL to VidBee so the download happens in the desktop app instead of your browser.

## Why install it?

- **One-click handoff:** Send the current video page to VidBee without copy-pasting links.
- **See formats before downloading:** Preview resolutions, file sizes, and audio-only options in the popup.
- **More reliable downloads:** VidBee handles large files and multi-format downloads better than most browsers.
- **Works on 1,000+ sites:** The extension uses the same site support as the VidBee app.

## What it does

1. Reads the active tab URL when you open the popup.
2. Asks the VidBee desktop app (running locally) to analyze the video.
3. Displays the formats it finds and lets you open VidBee to download.

## Requirements

- VidBee desktop app installed.
- VidBee running while you use the extension.

## How to use

1. Open a supported video page.
2. Click the VidBee extension icon.
3. Review available formats.
4. Click **Download with VidBee** to start the download in the desktop app.

## Development

```bash
pnpm install
pnpm dev
```

Build or package:

```bash
pnpm build
pnpm zip
```

Firefox builds:

```bash
pnpm dev:firefox
pnpm build:firefox
pnpm zip:firefox
```

## Notes on privacy

The extension only sends the current tab URL to the local VidBee app on `127.0.0.1` and stores temporary results in browser storage for faster reloads.

---

### Overview (`apps/web/README.md`)

# VidBee Web

TanStack Start client for the VidBee API.

## Development

```bash
pnpm run start:web
```

`start:web` is a root workspace script that starts both `apps/web` and `apps/api`.

## Build

```bash
pnpm --filter ./apps/web run build
```

---

### Overview (`apps/desktop/resources/README.md`)

# Resources Directory

This directory contains bundled resources for the application.

## yt-dlp Binaries

To bundle yt-dlp with the application, place the appropriate binaries in this directory:

### Required Files

1. **Windows**: `yt-dlp.exe`
2. **macOS**: `yt-dlp_macos`
3. **Linux**: `yt-dlp_linux`

### How to Download

You can download the latest yt-dlp binaries from the official GitHub releases:

**Option 1: Manual Download**

- Visit: <https://github.com/yt-dlp/yt-dlp/releases/latest>
- Download the appropriate version for each platform:
  - Windows: `yt-dlp.exe`
  - macOS: `yt-dlp_macos`
  - Linux: `yt-dlp` (rename to `yt-dlp_linux`)

**Option 2: Using curl/wget (Linux/macOS)**

```bash
# For Windows binary
curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe -o resources/yt-dlp.exe

# For macOS binary
curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos -o resources/yt-dlp_macos
chmod +x resources/yt-dlp_macos

# For Linux binary
curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o resources/yt-dlp_linux
chmod +x resources/yt-dlp_linux
```

**Option 3: Using PowerShell (Windows)**

```powershell
# Download all three binaries
Invoke-WebRequest -Uri "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe" -OutFile "resources/yt-dlp.exe"
Invoke-WebRequest -Uri "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_macos" -OutFile "resources/yt-dlp_macos"
Invoke-WebRequest -Uri "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp" -OutFile "resources/yt-dlp_linux"
```

## ffmpeg/ffprobe Binaries

ffmpeg is required for merging audio/video streams and audio extraction. ffprobe is required for post-processing metadata. Bundle both binaries under `resources/ffmpeg/`.

### Required Files

1. **Windows**: `resources/ffmpeg/ffmpeg.exe` and `resources/ffmpeg/ffprobe.exe`
2. **macOS**: `resources/ffmpeg/ffmpeg` and `resources/ffmpeg/ffprobe`
3. **Linux**: `resources/ffmpeg/ffmpeg` and `resources/ffmpeg/ffprobe`

### How to Download

- **Windows / Linux**: Grab static builds from <https://ffmpeg.org/download.html> (or <https://github.com/yt-dlp/FFmpeg-Builds/releases>) and copy `ffmpeg` and `ffprobe` into `resources/ffmpeg/`.
- **macOS**: Download the `ffmpeg-*.zip` asset from <https://github.com/eko5624/mpv-mac/releases/latest>, then copy `ffmpeg` and `ffprobe` from the archive into `resources/ffmpeg/`.
- On macOS/Linux ensure both binaries are executable: `chmod +x resources/ffmpeg/ffmpeg resources/ffmpeg/ffprobe`.

### Note

- Bundled binaries are required for Windows builds. On macOS/Linux the app can also use ffmpeg/ffprobe from the system PATH.
- You can override the lookup path via `FFMPEG_PATH`. It must point to a directory containing both `ffmpeg` and `ffprobe`.
- File sizes: ~40-80 MB per ffmpeg build (ffmpeg + ffprobe)

## JS Runtime (Node)

yt-dlp EJS uses an external JavaScript runtime. VidBee reuses the bundled official Node LTS at `resources/node/` (also used by the transcription worker). Do not bundle a separate Deno binary.

At runtime, Desktop copies yt-dlp into a writable `userData` kernel so the signed app bundle is not mutated, then silently checks the official Stable channel. Only the active managed copy is kept; older kernels are deleted after a newer one is activated. Node stays on the packaged LTS lock.

You can override the EJS runtime path via `YTDLP_JS_RUNTIME_PATH` if needed.

---

### Apps Desktop Docs Glitchtip (`apps/desktop/docs/glitchtip.md`)

# GlitchTip integration

VidBee desktop now uses the Sentry-compatible GlitchTip stack in two layers:

1. Runtime collection via `@sentry/electron`
2. Release and source map upload via `@sentry/cli`

## Environment variables

Create `apps/desktop/.env` from [`apps/desktop/.env.example`](../.env.example).

Required variables:

- `VITE_GLITCHTIP_DSN`: project DSN from GlitchTip
- `SENTRY_URL`: GlitchTip base URL, for example `https://glitchtip.example.com`
- `SENTRY_ORG`: GlitchTip organization slug
- `SENTRY_PROJECT`: GlitchTip project slug
- `SENTRY_AUTH_TOKEN`: auth token created in GlitchTip

Optional variables:

- `VITE_GLITCHTIP_ENVIRONMENT`: defaults to `production`
- `VITE_GLITCHTIP_ENVIRONMENT`: defaults to `production`

Release is automatic by default and does not need to be configured.
Both runtime reporting and `sentry-cli` use:

- `vidbee-desktop@<apps/desktop package version>`

Only add `VITE_GLITCHTIP_RELEASE` or `SENTRY_RELEASE` if you need a custom CI release name.

## Upload source maps

GlitchTip is Sentry API compatible, so `sentry-cli` can target it by setting `SENTRY_URL`.

Run:

```bash
pnpm --filter ./apps/desktop run build:glitchtip
```

This does the following:

1. Builds Electron main, preload, and renderer bundles with source maps enabled
2. Creates a release named `vidbee-desktop@<version>` by default
3. Uploads all source maps from `apps/desktop/out`
4. Finalizes the release

If `@sentry/cli` was installed with pnpm's build scripts blocked, run `pnpm approve-builds` and allow `@sentry/cli`.

## Event design

The integration is intentionally narrow:

- Main process:
  - uncaught exceptions
  - unhandled promise rejections
  - renderer crash and unresponsive state
  - yt-dlp, ffmpeg, auto-updater initialization failures
  - download failures
  - subscription sync, check, retry, and queue failures
- Renderer process:
  - `window.error`
  - `unhandledrejection`
  - React `ErrorBoundary` crashes
- Breadcrumbs:
  - deep link entry
  - page navigation
  - one-click download queue
  - subscription queue actions
  - update lifecycle milestones

This keeps GlitchTip focused on actionable failures while still preserving the timeline needed to debug them.

---

--- METRICS ---
- Files Extracted: 6
- Estimated Token Budget: ~6931 tokens
- Canonical Reference: https://codewiki.google/github.com/nexmoe/VidBee
