# ───────────────────────────────────────────────────────────────────── # live-streamer environment template # # Copy this file to `.env` (which is gitignored) and fill in the values. # Source it in the terminal that runs `scripts/03-run-autonomous-show.sh` # OR `scripts/05-run-chat-ingester.sh` before invoking either: # # source .env && scripts/03-run-autonomous-show.sh --episode-mode # # Multiple terminals (avatar / showrunner / chat ingester) each need # their own `source .env` — env vars don't cross processes. If you keep # the file checked into your shell's auto-source path, that's fine. # # NEVER commit a real .env. Verify with `git status` before pushing. # ───────────────────────────────────────────────────────────────────── # ─── Required: HeyGen (M1 / stream_orchestrator) ───────────────────── # Avatar Realtime v3 API key. M1 loads this from the repo-root .env at # boot; showrunner + chat_ingester now also read this root .env, so ONE # file at the repo root serves all three components. HEYGEN_API_KEY= # ─── Required: Anthropic ───────────────────────────────────────────── # Used by: # - showrunner (reactive planner + episode author + transitions) # - chat_ingester (Haiku ack writer pre-bakes per-row ack text) # Same key for both — the showrunner uses Sonnet 4.6, chat_ingester # uses Haiku 4.5; both consume from the same account. ANTHROPIC_API_KEY= # ─── Optional: GitHub (richer repo fetch) ──────────────────────────── # Personal access token, read-only/public scope is enough. Without it, # GitHub fetches use the unauthenticated rate limit (~60/hr) and can 429 # the show mid-roast. Read by the showrunner episode fetch + script_producer. GITHUB_TOKEN= # ─── Optional: OBS egress heartbeat ────────────────────────────────── # obs-websocket password — MUST match OBS → Tools → obs-websocket # Settings → Server Password. If it doesn't, scripts/obs_heartbeat.py # logs "failed to identify client" and egress goes UNMONITORED (OBS/Twitch # can die silently). Read as OBS_HEARTBEAT_PASSWORD. (The old OBS_PASSWORD # key in the per-package template was vestigial — nothing ever read it.) OBS_HEARTBEAT_PASSWORD= # ─── Required for Twitch chat (Module 4) ───────────────────────────── # Only needed when running scripts/05-run-chat-ingester.sh. Get a chat # token at https://twitchtokengenerator.com → "Bot Chat Token" (requires # only the `chat:read` scope — no app credentials, no broadcaster grant). # # Tokens expire ~60 days; regenerate when you see # `twitch_reader.auth_failed` in chat_ingester logs. TWITCH_BOT_TOKEN=oauth: # The bot account's Twitch login (lowercase). Create a second Twitch # account or reuse one you own — this is who the token belongs to. TWITCH_BOT_NICK= # The channel to join (your main stream's Twitch login, no leading '#'). TWITCH_CHANNEL= # ─── Optional: chat ingester knobs ─────────────────────────────────── # All have sensible defaults — only set when you want to override. # Path to the SQLite queue chat_ingester writes and showrunner reads. # Default: /state/chat_queue.sqlite # CHAT_QUEUE_DB= # Max pending requests before silent drop. Default 20. # CHAT_QUEUE_CAP=20 # Path to newline-delimited blocked repo substrings (e.g. for an # open-to-all channel that needs a basic NSFW/troll guard). Missing # file ⇒ empty blocklist. # CHAT_BLOCKLIST_FILE= # Override the Haiku model the ack writer uses (defaults to current # Haiku 4.5). Same provider as ANTHROPIC_API_KEY. # ACK_LLM_MODEL= # ─── REQUIRED to engage the chat → avatar pipeline ─────────────────── # IMPORTANT: chat_ingester writes rows to state/chat_queue.sqlite regardless # of these env vars. The showrunner only reads that queue when all three of # these are true: # 1. SHOWRUNNER_EPISODE_MODE is set to "true" # 2. CHAT_QUEUE_DB points at the SAME file chat_ingester writes # 3. --real-llm is in use (the script passes that by default) # # Without (1), the showrunner runs in reactive-only mode and the # chat-driven episode path never engages — the avatar will autonomously # wander GitHub trending and ignore everything chat submits, even # though chat_ingester is happily writing rows. SHOWRUNNER_EPISODE_MODE=true CHAT_QUEUE_DB=state/chat_queue.sqlite # ─── Optional: showrunner runtime knobs ────────────────────────────── # Episode v2 seed repo — the first thing the show roasts after boot. # Empty disables episode production (reactive-only). Once consumed, # the show falls through to trending. Replaces --episode-seed-url. # SHOWRUNNER_EPISODE_SEED_URL=https://github.com/astral-sh/ruff # Autonomous trending pick when chat is empty + seed used. # Default ON when --episode-mode is set. # SHOWRUNNER_AUTONOMOUS_TRENDING_ON_EMPTY=true # Callback collapse for chat duplicates of recent roasts. # Default ON when --episode-mode is set. # SHOWRUNNER_CALLBACK_ON_DUPLICATES=true # Plan 7 verdict store path backing the leaderboard overlay. # Default: /state/verdicts.sqlite # VERDICTS_DB= # Episode author timeout (seconds) per LLM call. Default 120. # SHOWRUNNER_EPISODE_TIMEOUT_SEC=120 # ─── Optional: CostCap (Anthropic daily token budget) ──────────────── # When set, the showrunner blocks LLM calls and falls back to safe # templates once the daily token count crosses this cap. Persisted # across restarts within the same UTC day (resets at midnight UTC). # 0 or unset ⇒ no cap. Recommended: set this for unsupervised runs. # # Sonnet 4.6 is ~$3/MTok in + $15/MTok out. A reasonable overnight # budget is around 5_000_000 (≈ $25-50 worst case). # SHOWRUNNER_COST_DAILY_TOKEN_CAP=5000000 # Where CostCap persists its running counter. Default # ~/.heygen-stream/cost_cap.json. # SHOWRUNNER_COST_STATE_PATH= # ─── Optional: Notifier (where CostCap alerts go) ──────────────────── # CostCap fires `cost_cap_warning` at 80% and `cost_cap_hit` at 100%. # If no sink is configured, alerts just log at WARNING. # Slack-compatible incoming webhook URL. # SLACK_WEBHOOK_URL= # Discord-compatible incoming webhook URL. # DISCORD_WEBHOOK_URL= # OBS heartbeat alerts (separate stdlib-only script under scripts/). # Point this at the SAME Slack/Discord webhook as above to consolidate # all alerts into one channel. The OBS heartbeat doesn't share the # Notifier rate-limit — set this to the same URL and you'll see OBS # alerts alongside CostCap + failure_alarm alerts. # OBS_HEARTBEAT_ALERT_WEBHOOK= # macOS-native notification (osascript). '1' / 'true' / 'yes' enables; # anything else (or unset) disables. Useful for local development; # silently no-ops on non-Darwin. # SHOWRUNNER_NOTIFY_MACOS=true # Per-kind alert rate limit. Default 60 (one alert of each kind per # minute). Lower for noisier debugging, higher for production runs. # SHOWRUNNER_NOTIFY_RATE_LIMIT_SEC=60