#!/usr/bin/env bash set -euo pipefail # Helper to create a local env file with secrets and start the docker stack. # Usage: ./scripts/start_local.sh ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)" ENV_LOCAL="$ROOT_DIR/.env.local" echo "This helper creates a local .env.local (gitignored) and starts the Docker stack." read -p "Label mode (hf/openai/mock) [hf]: " LABEL_MODE LABEL_MODE=${LABEL_MODE:-hf} read -p "Label model (for hf, e.g. google/flan-t5-large) [google/flan-t5-large]: " LABEL_MODEL LABEL_MODEL=${LABEL_MODEL:-google/flan-t5-large} if [ "$LABEL_MODE" = "hf" ]; then # prompt for HF token echo "Enter Hugging Face token (will not be echoed):" read -s HF_TOKEN echo else HF_TOKEN="" fi if [ "$LABEL_MODE" = "openai" ]; then echo "Enter OpenAI API key (will not be echoed):" read -s OPENAI_API_KEY echo else OPENAI_API_KEY="" fi cat > "$ENV_LOCAL" <