#!/usr/bin/env bash # One-time setup for Screen Leads (macOS / Linux): # 1. create the virtual environment # 2. install dependencies # 3. prompt for environment variables and write .env # After this, start the app with ./run.sh set -euo pipefail cd "$(dirname "$0")" PYTHON="${PYTHON:-python3}" echo "== Screen Leads setup ==" # 1. Virtual environment if [ ! -d ".venv" ]; then echo "→ Creating virtual environment (.venv)…" "$PYTHON" -m venv .venv else echo "→ Virtual environment already exists." fi # shellcheck disable=SC1091 source .venv/bin/activate # 2. Dependencies echo "→ Installing dependencies…" pip install -q --upgrade pip pip install -q -r requirements.txt touch ".venv/.installed" # 3. Environment variables → .env if [ -f ".env" ]; then echo "→ .env already exists — leaving it untouched." else echo echo "Set up your environment variables (saved to .env):" printf " Anthropic API key (sk-ant-…): " read -rs API_KEY; echo printf " Model [claude-opus-4-8] (Enter to accept): " read -r MODEL MODEL="${MODEL:-claude-opus-4-8}" { echo "ANTHROPIC_API_KEY=${API_KEY}" echo "SCREEN_LEADS_MODEL=${MODEL}" } > .env chmod 600 .env echo "→ Wrote .env" if [ -z "${API_KEY}" ]; then echo " ⚠ No key entered — edit .env and set ANTHROPIC_API_KEY before running." fi fi echo echo "✓ Setup complete. Start the app with: ./run.sh"