OSVauco/scripts/osvauco-opax-boot.sh

74 lines
1.8 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# OSVauco OPAX boot — nå med enkel session-logg
set -euo pipefail
PROJECT_ID="propane-will-491900-m5"
REGION="us-central1"
ACCOUNT="chris.christiansen@vauco.no"
REPO="OSVauco"
BRANCH="main"
PING_URL="https://opax-mcp-core-357036551735.us-central1.run.app/ping"
LOG_FILE="$HOME/OSVauco/docs/OSVAUCO_OPAX_SESSION_LOG.md"
GREEN="$(tput setaf 2 || true)"
RED="$(tput setaf 1 || true)"
RESET="$(tput sgr0 || true)"
SESSION_ID="$(date '+%Y%m%d-%H%M%S')"
# Vis siste linje fra session-logg hvis den finnes
if [ -f "$LOG_FILE" ]; then
LAST_LINE=$(tail -n 1 "$LOG_FILE" || true)
else
LAST_LINE="(ingen tidligere sesjoner logget ennå)"
fi
echo "============================================================"
echo " O S V A U C O · O P A X"
echo "============================================================"
echo
echo "Boot-script for OPAX-MCP (Cloud Run)"
echo
echo " Project : $PROJECT_ID"
echo " Region : $REGION"
echo " Account : $ACCOUNT"
echo " Repo : $REPO ($BRANCH)"
echo " Session : $SESSION_ID"
echo
echo " Forrige: $LAST_LINE"
echo
echo " Tester OPAX-MCP på: $PING_URL"
if curl -fsS "$PING_URL" >/dev/null 2>&1; then
echo " ${GREEN}✅ OPAX-MCP: OK${RESET}"
else
echo " ${RED}❌ OPAX-MCP: FEIL sjekk Cloud Run / URL${RESET}"
fi
echo
mkdir -p "$(dirname "$LOG_FILE")"
read -r -p "[OSVauco/OPAX] Kort beskrivelse av denne sesjonen: " SESSION_DESC || SESSION_DESC="(ingen beskrivelse)"
echo "$SESSION_ID | $PROJECT_ID | $REGION | $ACCOUNT | $SESSION_DESC" >> "$LOG_FILE"
echo " Logg oppdatert: $LOG_FILE"
echo
read -r -p "[OSVauco/OPAX] Starte Gemini-CLI i ~/OSVauco nå? (y/N): " ANSWER
case "$ANSWER" in
y|Y)
echo "[OSVauco/OPAX] Starter Gemini-CLI..."
cd "$HOME/OSVauco"
gemini
;;
*)
echo "[OSVauco/OPAX] OK, holder deg i shell. Kjør 'gemini' når du vil inn i TUI."
;;
esac