peepshow/ sinks/ cassandra

Reel #95 Wide-column store

peepshow sink / cassandra

Cassandra / AstraInsert each run into a Cassandra or DataStax Astra table via the Stargate REST API.

POST one row per peepshow run as JSON to `<baseUrl>/v2/keyspaces/<keyspace>/<table>`. Works against [DataStax Astra](https://www.datastax.com/products/datastax-astra) (managed Cassandra) and self-hosted [Stargate](https://stargate.io) gateways.

drop · process · cassandra

What it does

[Apache Cassandra](https://cassandra.apache.org/) is the distributed wide-column database; [DataStax Astra](https://www.datastax.com/products/datastax-astra) is the managed serverless flavour. Both speak [Stargate](https://stargate.io), the data-plane REST gateway. This sink writes one row per peepshow run via `POST <baseUrl>/v2/keyspaces/<keyspace>/<table>` with a flat JSON body — no native driver, no CQL parser, no client-side schema. Auth is the standard `X-Cassandra-Token` header (a Stargate session token for Astra, optional for local Stargate with auth disabled). The destination table must already exist with the documented CQL schema — the REST data-plane doesn't expose DDL — but the doc page captures the exact `CREATE TABLE` to paste once at setup time.

When to reach for it

  • Stream peepshow runs into the same Cassandra cluster your application already writes to
  • Use DataStax Astra's free tier as a hosted archive for every video an agent processes
  • Pair with a Cassandra-backed search layer (DSE Search, Stargate GraphQL) without a separate ingestion service

Install

npm i -g peepshow

Use it

CASSANDRA_URL="https://abc-region.apps.astra.datastax.com/api/rest" \
CASSANDRA_KEYSPACE="peepshow" \
CASSANDRA_TOKEN="$(< ~/.astra-token)" \
peepshow ./demo.mp4 --sink cassandra

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 cassandra
peepshow sinks add cassandra --when extension=mp4,mov
peepshow sinks add cassandra --when path=/Volumes/Work/

Configuration

  • CASSANDRA_URL Stargate base URL. Astra: `https://<id>-<region>.apps.astra.datastax.com/api/rest`. Local: `http://localhost:8082`. required
  • CASSANDRA_KEYSPACE Target keyspace. Must already exist. required
  • CASSANDRA_TABLE Table name within the keyspace. Default `peepshow_runs`. Must already exist (see schema in docs).
  • CASSANDRA_TOKEN Stargate session token sent as `X-Cassandra-Token`. Required for Astra; optional for self-hosted Stargate with auth disabled.
  • PEEPSHOW_FRAME_BASE_URL When set, the first frame URL is written to the `thumbnail_url` column.

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 Cassandra / Astra 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 CASSANDRA_URL="..."
export CASSANDRA_KEYSPACE="..."

2. Register as an auto-sink

peepshow sinks add cassandra
peepshow sinks add cassandra --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 Cassandra / Astra 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'.