33 lines
999 B
Bash
33 lines
999 B
Bash
#!/usr/bin/env bash
|
|
# ===========================================================================
|
|
# AGIBOT A3 - Voice Control | Linux / macOS launcher
|
|
# ./start.sh then open http://localhost:8000
|
|
# ===========================================================================
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")"
|
|
|
|
echo
|
|
echo " AGIBOT A3 - Voice Control"
|
|
echo " ----------------------------------------------"
|
|
|
|
PY="${PYTHON:-python3}"
|
|
if ! command -v "$PY" >/dev/null 2>&1; then
|
|
echo " [ERROR] python3 not found. Install Python 3.9 or newer."
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -f .env ]; then
|
|
echo " Creating .env from .env.example ..."
|
|
cp .env.example .env
|
|
fi
|
|
|
|
if ! "$PY" -c "import fastapi, uvicorn, dotenv, httpx" >/dev/null 2>&1; then
|
|
echo " Installing dependencies (first run only) ..."
|
|
"$PY" -m pip install --disable-pip-version-check -q -r requirements.txt
|
|
fi
|
|
|
|
echo " Starting server ... open http://localhost:8000"
|
|
echo " Press Ctrl+C to stop."
|
|
echo
|
|
exec "$PY" backend/main.py
|