-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.bat
More file actions
135 lines (120 loc) · 4.03 KB
/
start.bat
File metadata and controls
135 lines (120 loc) · 4.03 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
@echo off
REM AIguessr — one-click launcher for Windows
REM Installs dependencies, launches browser, starts servers, opens dashboard
title AIguessr Launcher
color 0A
echo.
echo ___ ____
echo / \ ^|_ _^| __ _ _ _ ___ ___ ___ _ __
echo / /_\ \ ^| ^| / _` ^| ^| ^| ^|/ _ \/ __/ __^| '__^|
echo / _____ \ ^| ^| ^| (_^| ^| ^|_^| ^| __/\__ \__ \ ^|
echo /_/ \_\ ^|_^| \__, ^|\__,_^|\___^|^|___/___/_^|
echo ^|___/
echo.
echo ============================================
echo AIguessr Launcher
echo ============================================
echo.
REM --- Check Python ---
python --version >nul 2>&1
if errorlevel 1 (
echo [ERROR] Python not found. Install Python 3.11+ from https://python.org
pause
exit /b 1
)
echo [OK] Python found
REM --- Check Node ---
node --version >nul 2>&1
if errorlevel 1 (
echo [ERROR] Node.js not found. Install Node.js 18+ from https://nodejs.org
pause
exit /b 1
)
echo [OK] Node.js found
REM --- Install Python dependencies ---
echo.
echo [1/5] Installing Python dependencies...
pip install -r requirements.txt -q 2>nul
if errorlevel 1 (
echo [WARN] Some Python packages failed to install. Trying again...
pip install -r requirements.txt
)
python -m playwright install chromium --with-deps 2>nul
echo [OK] Python dependencies ready
REM --- Install and build dashboard ---
echo.
echo [2/5] Building dashboard...
if not exist dashboard\node_modules (
cd dashboard
call npm install --silent 2>nul
cd ..
)
if not exist dashboard\dist (
cd dashboard
call npm run build 2>nul
cd ..
)
echo [OK] Dashboard ready
REM --- Launch Brave ---
echo.
echo [3/5] Launching browser...
set "BRAVE_PATH="
for %%P in (
"C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe"
"%LOCALAPPDATA%\BraveSoftware\Brave-Browser\Application\brave.exe"
) do (
if exist %%P set "BRAVE_PATH=%%~P"
)
set "CHROME_PATH="
for %%P in (
"C:\Program Files\Google\Chrome\Application\chrome.exe"
"%LOCALAPPDATA%\Google\Chrome\Application\chrome.exe"
) do (
if exist %%P set "CHROME_PATH=%%~P"
)
if defined BRAVE_PATH (
start "" "%BRAVE_PATH%" --remote-debugging-port=9222 --remote-allow-origins=* --user-data-dir="%USERPROFILE%\AIguessr_Browser"
echo [OK] Brave launched with remote debugging
) else if defined CHROME_PATH (
start "" "%CHROME_PATH%" --remote-debugging-port=9222 --remote-allow-origins=* --user-data-dir="%USERPROFILE%\AIguessr_Browser"
echo [OK] Chrome launched with remote debugging
) else (
echo [WARN] No supported browser found. Launch Brave or Chrome manually with:
echo --remote-debugging-port=9222 --remote-allow-origins=*
)
REM --- Start geo.py server ---
echo.
echo [4/5] Starting browser controller...
start /B "" python geo.py serve >nul 2>&1
timeout /t 2 >nul
echo [OK] Browser controller running on port 5555
REM --- Start dashboard server ---
echo.
echo [5/5] Starting dashboard...
start /B "" python server.py >nul 2>&1
timeout /t 2 >nul
echo [OK] Dashboard running on port 8080
REM --- Open dashboard ---
echo.
echo ============================================
echo AIguessr is ready!
echo.
echo Dashboard: http://127.0.0.1:8080
echo.
echo Next steps:
echo 1. Open GeoGuessr in the browser
echo 2. Follow the setup wizard in the dashboard
echo.
echo For Claude Code mode, open another terminal:
echo claude --dangerously-skip-permissions
echo ============================================
echo.
start "" http://127.0.0.1:8080
echo Press any key to stop all servers...
pause >nul
REM --- Cleanup ---
REM Kill Python processes started with /B by matching command line
taskkill /F /IM python.exe /FI "WINDOWTITLE eq AIguessr Launcher" >nul 2>&1
for /f "tokens=1" %%A in ('wmic process where "commandline like '%%geo.py serve%%'" get processid 2^>nul ^| findstr /r [0-9]') do taskkill /F /PID %%A >nul 2>&1
for /f "tokens=1" %%A in ('wmic process where "commandline like '%%server.py%%'" get processid 2^>nul ^| findstr /r [0-9]') do taskkill /F /PID %%A >nul 2>&1
echo Servers stopped. Goodbye!