#!/usr/bin/env bash # generate-env.sh — create the MelodyMuse `.env` (and AGE-encrypt it). # # Usage: bash generate-env.sh # # Customize LLM_ENDPOINT / LLM_MODEL below before running. The script prompts # for the LLM_API_KEY so it doesn't end up in your shell history. set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)" AGE_PUB_KEY="${REPO_ROOT}/keys/age-public-key.txt" # ─── Customize these for your deployment ───────────────────────────────────── LLM_ENDPOINT_DEFAULT="https://api.minimax.chat/v1" LLM_MODEL_DEFAULT="MiniMax-M3" # ────────────────────────────────────────────────────────────────────────────── echo "LLM endpoint [${LLM_ENDPOINT_DEFAULT}]:" read -r LLM_ENDPOINT LLM_ENDPOINT="${LLM_ENDPOINT:-$LLM_ENDPOINT_DEFAULT}" echo "LLM model [${LLM_MODEL_DEFAULT}]:" read -r LLM_MODEL LLM_MODEL="${LLM_MODEL:-$LLM_MODEL_DEFAULT}" echo "LLM API key (input is hidden):" read -rs LLM_API_KEY echo "" if [[ -z "${LLM_API_KEY}" ]]; then echo "ERROR: LLM_API_KEY is required." exit 1 fi cat > "${SCRIPT_DIR}/.env" < -o .env.age .env" fi