What it does
[Elasticsearch](https://www.elastic.co/elasticsearch/) (and the API-compatible [OpenSearch](https://opensearch.org)) is the de-facto search engine for full-text, faceted, and aggregation queries over high-volume document streams. This sink POSTs one JSON document per peepshow run to `/<index>/_doc`, letting the server assign the id and auto-create the index. Once indexed, run transcripts, titles, and container tags become queryable via Kibana / OpenSearch Dashboards or any Elastic SDK.
When to reach for it
- Search run history by transcript text — find every video where the agent heard the word "crash"
- Build a Kibana / OpenSearch Dashboards view over peepshow runs for ops or stakeholders
- Pipe runs into an existing ELK stack already aggregating product logs
Install
npm i -g peepshowUse it
ELASTICSEARCH_URL="http://localhost:9200" \
peepshow ./demo.mp4 --sink elasticsearchMake it automatic
Register the sink once — every run fires it afterward. Scope by --when so it only runs for matching videos.
peepshow sinks add elasticsearch
peepshow sinks add elasticsearch --when extension=mp4,mov
peepshow sinks add elasticsearch --when path=/Volumes/Work/Configuration
ELASTICSEARCH_URLBase URL of the Elasticsearch / OpenSearch cluster, e.g. `https://es.example.com:9200`. requiredELASTICSEARCH_INDEXIndex name. Default `peepshow-runs`. Auto-created on first write.ELASTICSEARCH_API_KEYEncoded API key (sent as `Authorization: ApiKey <k>`). Preferred over Basic auth.ELASTICSEARCH_USERNAMEBasic auth user. Mutually exclusive with `ELASTICSEARCH_API_KEY`.ELASTICSEARCH_PASSWORDBasic auth password. Required when username is set.PEEPSHOW_FRAME_BASE_URLWhen 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 Elasticsearch sink automatically when three things are true:
- the env vars below are exported in the agent's shell (or a project
.envit can load), - the
peepshowCLI is onPATH— install withnpm 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 ELASTICSEARCH_URL="..."2. Register as an auto-sink
peepshow sinks add elasticsearch
peepshow sinks add elasticsearch --when extension=mp4,mov3. Example LLM session
You → drop a
.movinto Claude Code.Claude → auto-invokes
/peepshow:slides ./clip.mov. peepshow extracts frames + audio, theElasticsearchsink forwards the run to the configured collection. Claude replies with a summary and a link to the created record.
The transcript text is a natural embedding target — index it next to the frames.
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'.