-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·37 lines (28 loc) · 745 Bytes
/
Copy pathrun.sh
File metadata and controls
executable file
·37 lines (28 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")" && pwd)"
cd "$ROOT"
if [ ! -d ".venv" ]; then
python3 -m venv .venv
fi
source .venv/bin/activate
pip install -q -r requirements.txt
if [ ! -f ".env" ]; then
cp .env.example .env
echo "Created .env — add your GITHUB_TOKEN and OPENAI_API_KEY before running."
exit 1
fi
mkdir -p data
echo "Starting daemon..."
.venv/bin/python -m daemon.main &
DAEMON_PID=$!
echo "Starting dashboard on http://127.0.0.1:8090 ..."
.venv/bin/uvicorn api.main:app --host 127.0.0.1 --port 8090 &
API_PID=$!
cleanup() {
echo "Shutting down..."
kill "$DAEMON_PID" "$API_PID" 2>/dev/null || true
}
trap cleanup EXIT INT TERM
echo "Both services running. Press Ctrl+C to stop."
wait