feat: replace PPLX_API_KEY with ANTHROPIC_API_KEY in start-lab.bat (#105)

This commit is contained in:
KoalaTrapLord authored and GitHub committed 2026-03-25 12:23:43 -04:00
1 parent 95429d9f35
commit 071088715f
1 file changed
+41 -43
+41 -43
View File
@@ -1,112 +1,110 @@
@echo off @echo off
REM ═══════════════════════════════════════════════════════════ REM ═══════════════════════════════════════════════════════════
REM Commander AI Lab — One-Click Launcher (Windows) REM Commander AI Lab — One-Click Launcher (Windows)
REM ═══════════════════════════════════════════════════════════ REM ═══════════════════════════════════════════════════════════
REM REM
REM Starts the Python FastAPI server + serves the web UI. REM Starts the Python FastAPI server + serves the web UI.
REM Prerequisites: REM Prerequisites:
REM - Python 3.10+ with: pip install fastapi uvicorn REM - Python 3.10+ with: pip install fastapi uvicorn
REM - Java 17+ REM - Java 17+
REM - commander-ai-lab built: mvn package "-DskipTests" REM - commander-ai-lab built: mvn package "-DskipTests"
REM REM
REM Edit the paths below to match your system. REM Edit the paths below to match your system.
REM ═══════════════════════════════════════════════════════════ REM ═══════════════════════════════════════════════════════════
REM ── Your Forge paths (EDIT THESE) ────────────────────────── REM ── Your Forge paths (EDIT THESE) ──────────────────────────
set FORGE_JAR=D:\ForgeCommander\forge-repo\forge-gui-desktop\target\forge-gui-desktop-2.0.12-SNAPSHOT-jar-with-dependencies.jar set FORGE_JAR=D:\ForgeCommander\forge-repo\forge-gui-desktop\target\forge-gui-desktop-2.0.12-SNAPSHOT-jar-with-dependencies.jar
set FORGE_DIR=D:\ForgeCommander\forge-repo set FORGE_DIR=D:\ForgeCommander\forge-repo
set FORGE_DECKS_DIR=%APPDATA%\Forge\decks\commander set FORGE_DECKS_DIR=%APPDATA%\Forge\decks\commander
REM ── Lab JAR (auto-detected from target/) ─────────────────────
REM ── Lab JAR (auto-detected from target/) ───────────────────
set LAB_PORT=8080 set LAB_PORT=8080
REM ── API Keys (set via environment variables or .env file) ── REM ── API Keys (set via environment variables or .env file) ──
REM If not already set in your environment, create a .env file REM If not already set in your environment, create a .env file
REM in this directory (see .env.example) or set them manually: REM in this directory (see .env.example) or set them manually:
REM set XIMILAR_API_KEY=your-ximilar-key-here REM set XIMILAR_API_KEY=your-ximilar-key-here
REM set PPLX_API_KEY=your-perplexity-key-here REM set ANTHROPIC_API_KEY=your-anthropic-api-key-here
REM REM
REM Load from .env file if it exists and vars aren't already set REM Load from .env file if it exists and vars aren't already set
if not defined XIMILAR_API_KEY ( if not defined XIMILAR_API_KEY (
if exist "%~dp0.env" ( if exist "%~dp0.env" (
for /f "usebackq tokens=1,* delims==" %%A in ("%~dp0.env") do ( for /f "usebackq tokens=1,* delims==" %%A in ("%~dp0.env") do (
if "%%A"=="XIMILAR_API_KEY" set XIMILAR_API_KEY=%%B if "%%A"=="XIMILAR_API_KEY" set XIMILAR_API_KEY=%%B
if "%%A"=="PPLX_API_KEY" set PPLX_API_KEY=%%B if "%%A"=="ANTHROPIC_API_KEY" set ANTHROPIC_API_KEY=%%B
) )
) )
) )
echo. echo.
echo ╔══════════════════════════════════════════════════╗ echo ╔══════════════════════════════════════════════════╗
echo ║ Commander AI Lab — Launcher ║ echo ║ Commander AI Lab — Launcher ║
echo ╚══════════════════════════════════════════════════╝ echo ╚══════════════════════════════════════════════════╝
echo. echo.
echo Forge JAR: %FORGE_JAR% echo Forge JAR: %FORGE_JAR%
echo Forge Dir: %FORGE_DIR% echo Forge Dir: %FORGE_DIR%
echo Decks Dir: %FORGE_DECKS_DIR% echo Decks Dir: %FORGE_DECKS_DIR%
echo Port: %LAB_PORT% echo Port: %LAB_PORT%
echo Ximilar: Configured echo Ximilar: Configured
if defined PPLX_API_KEY ( if defined ANTHROPIC_API_KEY (
echo Perplexity: Configured echo Claude Opus: Configured
) else ( ) else (
echo Perplexity: Not configured ^(set PPLX_API_KEY env var for AI features^) echo Claude Opus: Not configured ^(set ANTHROPIC_API_KEY env var for AI features^)
) )
echo. echo.
REM ── Check prerequisites ──────────────────────────────────── REM ── Check prerequisites ────────────────────────────────────
where python >nul 2>&1 where python >nul 2>&1
if %ERRORLEVEL% neq 0 ( if %ERRORLEVEL% neq 0 (
echo ERROR: Python not found in PATH echo ERROR: Python not found in PATH
pause pause
exit /b 1 exit /b 1
) )
where java >nul 2>&1 where java >nul 2>&1
if %ERRORLEVEL% neq 0 ( if %ERRORLEVEL% neq 0 (
echo ERROR: Java not found in PATH echo ERROR: Java not found in PATH
pause pause
exit /b 1 exit /b 1
) )
if not exist "%FORGE_JAR%" ( if not exist "%FORGE_JAR%" (
echo ERROR: Forge JAR not found at: %FORGE_JAR% echo ERROR: Forge JAR not found at: %FORGE_JAR%
echo Run Forge build first: echo Run Forge build first:
echo cd D:\ForgeCommander\forge-repo echo cd D:\ForgeCommander\forge-repo
echo mvn package -pl forge-gui-desktop "-DskipTests" "-Drevision=2.0.12-SNAPSHOT" -am echo mvn package -pl forge-gui-desktop "-DskipTests" "-Drevision=2.0.12-SNAPSHOT" -am
pause pause
exit /b 1 exit /b 1
) )
REM ── Check if lab_api.py exists ───────────────────────────── REM ── Check if lab_api.py exists ─────────────────────────────
if not exist "%~dp0lab_api.py" ( if not exist "%~dp0lab_api.py" (
echo ERROR: lab_api.py not found in %~dp0 echo ERROR: lab_api.py not found in %~dp0
pause pause
exit /b 1 exit /b 1
) )
REM ── Install Python deps if needed ────────────────────────── REM ── Install Python deps if needed ───────────────────────────
python -c "import fastapi" >nul 2>&1 python -c "import fastapi" >nul 2>&1
if %ERRORLEVEL% neq 0 ( if %ERRORLEVEL% neq 0 (
echo Installing FastAPI + Uvicorn... echo Installing FastAPI + Uvicorn...
pip install fastapi uvicorn pip install fastapi uvicorn
) )
REM ── Launch the server ────────────────────────────────────── REM ── Launch the server ───────────────────────────────────────
echo. echo.
echo Starting Commander AI Lab server... echo Starting Commander AI Lab server...
echo Web UI: http://localhost:%LAB_PORT% echo Web UI: http://localhost:%LAB_PORT%
echo API: http://localhost:%LAB_PORT%/docs echo API: http://localhost:%LAB_PORT%/docs
echo Press Ctrl+C to stop. echo Press Ctrl+C to stop.
echo. echo.
if defined PPLX_API_KEY ( if defined ANTHROPIC_API_KEY (
python "%~dp0lab_api.py" ^ python "%~dp0lab_api.py" ^
--forge-jar "%FORGE_JAR%" ^ --forge-jar "%FORGE_JAR%" ^
--forge-dir "%FORGE_DIR%" ^ --forge-dir "%FORGE_DIR%" ^
--forge-decks-dir "%FORGE_DECKS_DIR%" ^ --forge-decks-dir "%FORGE_DECKS_DIR%" ^
--port %LAB_PORT% ^ --port %LAB_PORT% ^
--ximilar-key "%XIMILAR_API_KEY%" ^ --ximilar-key "%XIMILAR_API_KEY%" ^
--pplx-key "%PPLX_API_KEY%" --anthropic-key "%ANTHROPIC_API_KEY%"
) else ( ) else (
python "%~dp0lab_api.py" ^ python "%~dp0lab_api.py" ^
--forge-jar "%FORGE_JAR%" ^ --forge-jar "%FORGE_JAR%" ^