peepshow/ sinks/ algolia

Reel #92 Hosted search

peepshow sink / algolia

AlgoliaIndex every run into an Algolia index for instant typo-tolerant search.

POST one record per peepshow run to `https://<appId>-dsn.algolia.net/1/indexes/<index>` with the standard run schema. `objectID` is pinned to the run id so re-runs upsert in place.

drop · process · algolia

What it does

[Algolia](https://www.algolia.com) is the proprietary hosted-search service that most consumer SaaS dashboards run on. This sink indexes one record per peepshow run via the [Add Records REST endpoint](https://www.algolia.com/doc/rest-api/search/#tag/Records/operation/saveObject) — `POST /1/indexes/<index>` with a JSON record. Auth is the standard `X-Algolia-Application-Id` + `X-Algolia-API-Key` header pair (use an admin / write key). The record's `objectID` is set to the peepshow run id so re-running the same extraction overwrites the existing record rather than appending a duplicate. Algolia auto-creates the index on first write — the only setup is generating a write-scoped API key in the Algolia dashboard.

When to reach for it

  • Make every peepshow run searchable by title, transcript, or container tag without standing up a search server
  • Wire run history into an existing Algolia-backed dashboard alongside product / docs / content data
  • Hand a write-only API key to a CI job that indexes every QA video into a shared search index

Install

npm i -g peepshow

Use it

ALGOLIA_APP_ID="ABCD1234EF" \
ALGOLIA_API_KEY="$(< ~/.algolia-admin-key)" \
peepshow ./demo.mp4 --sink algolia

Make it automatic

Register the sink once — every run fires it afterward. Scope by --when so it only runs for matching videos.

peepshow sinks add algolia
peepshow sinks add algolia --when extension=mp4,mov
peepshow sinks add algolia --when path=/Volumes/Work/

Configuration

  • ALGOLIA_APP_ID Algolia application id (10 chars, e.g. `ABCD1234EF`). Find it under API Keys in the Algolia dashboard. required
  • ALGOLIA_API_KEY Admin (or write-scoped) API key. Sent as `X-Algolia-API-Key`. Never use the search-only public key. required
  • ALGOLIA_INDEX Index name. Default `peepshow_runs`. Auto-created on first write.
  • ALGOLIA_HOST Override the host. Default `<appId>-dsn.algolia.net`. Useful for regional clusters.
  • PEEPSHOW_FRAME_BASE_URL When set, the first frame URL is written to the `thumbnail_url` field.

Use with an LLM agent

Every peepshow sink reads its config from env vars and receives a single JSON payload on stdin. An LLM agent (Claude Code, Cursor, Windsurf, Gemini, Codex) can drive the Algolia sink automatically when three things are true:

  • the env vars below are exported in the agent's shell (or a project .env it can load),
  • the peepshow CLI is on PATH — install with npm i -g peepshow,
  • a peepshow auto-sink is registered for the run (optional but recommended — makes invocation zero-argument).

1. Set the environment

# Add to ~/.zshrc, ~/.bashrc, or a project .env the agent can load
export ALGOLIA_APP_ID="..."
export ALGOLIA_API_KEY="..."

2. Register as an auto-sink

peepshow sinks add algolia
peepshow sinks add algolia --when extension=mp4,mov

3. Example LLM session

You → drop a .mov into Claude Code.

Claude → auto-invokes /peepshow:slides ./clip.mov. peepshow extracts frames + audio, the Algolia sink forwards the run to the configured database. Claude replies with a summary and a link to the created record.

The transcript rides along in the payload whenever the audio pass transcribes successfully.

Write your own

A sink is any executable that reads the --emit json payload on stdin. Shell, Node, Python, Go — the spec's in docs/PLUGINS.md. Register persistent ones with peepshow sinks add-cmd 'your-command'.