Configuration
All configuration is via environment variables, validated at startup by Zod. Invalid values cause immediate failure with descriptive error messages.
Video Format
| Variable | Default | Description |
|---|---|---|
VIDEO_FORMAT | messages | Pipeline format: classic (narrated TTS) or messages (iMessage conversation) |
Reddit Scraping
| Variable | Default | Description |
|---|---|---|
TARGET_SUBREDDITS | tifu,AmItheAsshole | Comma-separated subreddits |
MIN_POST_SCORE | 1000 | Minimum upvote score |
MAX_POST_AGE_HOURS | 48 | Maximum post age |
MAX_TEXT_LENGTH | 3000 | Maximum text length for TTS |
REDDIT_SORT | top | Sort order (top, hot) |
REDDIT_TIME_FILTER | day | Time filter (hour, day, week, month, year) |
REDDIT_MAX_PAGES | 5 | Max pages to scrape per subreddit |
REDDIT_TIME_FILTER_ESCALATION | true | Auto-escalate time filter if no posts found |
Browser
| Variable | Default | Description |
|---|---|---|
BROWSER_HEADLESS | true | Run browser in headless mode |
BROWSER_USER_DATA_DIR | ./data/browser-state | Session storage path |
BROWSER_TIMEOUT_MS | 30000 | Browser operation timeout |
BROWSER_HUMANIZE_DELAYS | true | Add human-like delays |
TTS (Kokoro)
| Variable | Default | Description |
|---|---|---|
KOKORO_MODEL_ID | onnx-community/Kokoro-82M-v1.0-ONNX | ONNX model ID |
KOKORO_VOICE | af_heart | Voice preset |
KOKORO_DTYPE | q8 | Quantization (fp32, fp16, q8, q4, q4f16) |
WHISPER_MODEL | base.en | Whisper alignment model |
Video Composition
| Variable | Default | Description |
|---|---|---|
VIDEO_WIDTH | 1080 | Output video width |
VIDEO_HEIGHT | 1920 | Output video height |
BACKGROUND_DIR | ./assets/backgrounds | Background video directory |
BACKGROUND_SEARCH_TERMS | (see .env.example) | YouTube search terms for backgrounds |
BACKGROUND_MIN_VIDEOS | 5 | Min background videos to maintain |
BACKGROUND_MAX_DURATION_SEC | 600 | Max background video duration |
OUTPUT_DIR | ./output | Output directory for generated videos |
CAPTION_FONT_SIZE | 24 | Caption font size |
CAPTION_STYLE | word-highlight | Caption style (word-highlight, karaoke, static) |
MUSIC_DIR | ./assets/music | Background music directory |
MUSIC_VOLUME_DB | -20 | Background music volume (dB) |
HOOK_AUDIO_DIR | ./assets/hooks | Hook sound effects directory |
HOOK_ENABLED | true | Enable hook audio overlay |
Messages Format
| Variable | Default | Description |
|---|---|---|
MESSAGE_TARGET_COUNT | 14 | Target number of messages in conversation |
MESSAGE_FRAMERATE | 10 | Frame rate for message video |
MESSAGE_TYPING_DURATION_MS | 800 | Typing indicator duration |
MESSAGE_MIN_HOLD_MS | 600 | Minimum hold time per message |
LLM
| Variable | Default | Description |
|---|---|---|
LLM_BASE_URL | http://localhost:4000/v1 | OpenAI-compatible endpoint |
LLM_MODEL | qwen3.5-9b | Model name |
LLM_MAX_TOKENS | 2048 | Max output tokens |
LLM_TEMPERATURE | 0.8 | Sampling temperature |
LLM_TIMEOUT_MS | 60000 | Request timeout |
TikTok Publishing
| Variable | Default | Description |
|---|---|---|
TIKTOK_EMAIL | (empty) | TikTok account email |
TIKTOK_PASSWORD | (empty) | TikTok account password |
TIKTOK_HASHTAGS | #reddit,#storytime,#fyp,#viral | Hashtag pool |
TIKTOK_MENTIONS | (empty) | Creator mentions pool |
TIKTOK_HASHTAGS_PER_POST | 5 | Hashtags per post |
TIKTOK_MENTIONS_PER_POST | 5 | Mentions per post |
TIKTOK_UPLOAD_TIMEOUT_MS | 120000 | Upload timeout |
Scheduling
| Variable | Default | Description |
|---|---|---|
POSTING_CRON | 0 */4 * * * | Cron schedule (every 4 hours) |
MAX_POSTS_PER_DAY | 6 | Daily post limit |
PIPELINE_RETRY_MAX_ATTEMPTS | 2 | Max retry attempts per stage |
PIPELINE_RETRY_DELAY_MS | 5000 | Base retry delay (linear backoff) |
Server
| Variable | Default | Description |
|---|---|---|
PORT | 3000 | HTTP server port |
LOG_LEVEL | info | Log level (debug, info, warn, error) |
SQLITE_DB_PATH | ./data/posts.db | SQLite database path |