72 lines
1.7 KiB
Batchfile
72 lines
1.7 KiB
Batchfile
@echo off
|
|
REM GPTEdit MCP Server Launcher
|
|
REM This script starts the GPTEdit MCP server with proper environment setup
|
|
|
|
echo ========================================
|
|
echo GPTEdit MCP Server Launcher
|
|
echo ========================================
|
|
echo.
|
|
|
|
REM Change to script directory
|
|
cd /d "%~dp0"
|
|
|
|
REM Check if Python is available
|
|
python --version >nul 2>&1
|
|
if errorlevel 1 (
|
|
echo ERROR: Python is not installed or not in PATH
|
|
echo Please install Python 3.8+ and add it to PATH
|
|
pause
|
|
exit /b 1
|
|
)
|
|
|
|
REM Check if .env file exists
|
|
if not exist ".env" (
|
|
echo WARNING: .env file not found
|
|
echo Creating .env from .env.example...
|
|
if exist ".env.example" (
|
|
copy ".env.example" ".env"
|
|
echo Please edit .env file with your OPENAI_API_KEY
|
|
pause
|
|
) else (
|
|
echo ERROR: .env.example not found
|
|
pause
|
|
exit /b 1
|
|
)
|
|
)
|
|
|
|
REM Check if virtual environment exists
|
|
if exist "venv\Scripts\activate.bat" (
|
|
echo Using virtual environment...
|
|
call venv\Scripts\activate.bat
|
|
) else (
|
|
echo No virtual environment found, using system Python
|
|
)
|
|
|
|
REM Install/update dependencies if needed
|
|
echo Checking dependencies...
|
|
pip install -q -r requirements.txt 2>nul
|
|
|
|
REM Create necessary directories
|
|
if not exist "generated_images" mkdir generated_images
|
|
if not exist "temp" mkdir temp
|
|
|
|
REM Start the server
|
|
echo.
|
|
echo Starting GPTEdit MCP Server...
|
|
echo ----------------------------------------
|
|
echo Output directory: generated_images\
|
|
echo Log file: gptedit.log
|
|
echo ----------------------------------------
|
|
echo.
|
|
|
|
python main.py
|
|
|
|
REM If server exits, show error
|
|
if errorlevel 1 (
|
|
echo.
|
|
echo ERROR: Server exited with error code %errorlevel%
|
|
echo Check gptedit.log for details
|
|
)
|
|
|
|
pause
|