#!/usr/bin/env bash # start_sidecar.sh — Launch the GenAI Shield Sidecar standalone # # Usage: # ./start_sidecar.sh # default port 5050 # SIDECAR_PORT=8080 ./start_sidecar.sh # custom port # GEMINI_API_KEY=... ./start_sidecar.sh # with API key inline set -e SIDECAR_PORT="${SIDECAR_PORT:-5050}" LOG_LEVEL="${LOG_LEVEL:-info}" echo "╔══════════════════════════════════════════════╗" echo "║ GenAI Shield Sidecar — Starting up ║" echo "╚══════════════════════════════════════════════╝" echo "" echo " Port: $SIDECAR_PORT" echo " Backend: ${LLM_BACKEND:-gemini}" echo " UI: http://localhost:$SIDECAR_PORT" echo " API Docs: http://localhost:$SIDECAR_PORT/docs" echo "" # Run from project root so imports resolve correctly cd "$(dirname "$0")" python -m uvicorn sidecar.app:app \ --host 0.0.0.0 \ --port "$SIDECAR_PORT" \ --log-level "$LOG_LEVEL" \ --no-access-log