新增:智能一键启动脚本,支持自动环境检测和浏览器打开

- 自动检查Python环境
- 自动安装依赖包
- 智能获取网络IP地址
- 自动打开浏览器预览
- 显示本地和局域网访问地址
This commit is contained in:
音布鲁格 2026-01-09 10:26:12 +08:00
parent 05aea0a4af
commit ad06257891

72
一键启动.bat Normal file
View File

@ -0,0 +1,72 @@
@echo off
chcp 65001 >nul
title Multi-Agent Decision Workshop - Smart Launcher
echo ========================================
echo Multi-Agent Decision Workshop - Smart Launcher
echo ========================================
echo.
echo Checking Python environment...
:: Check Python
python --version >nul 2>&1
if errorlevel 1 (
echo ERROR: Python not found
echo.
echo Please install Python 3.8+ and add to PATH
echo Download: https://www.python.org/downloads/
echo.
pause
exit /b 1
)
echo OK Python environment check passed
echo.
echo Checking dependencies...
:: Check and install dependencies
python -m pip install -r requirements.txt >nul 2>&1
if errorlevel 1 (
echo ERROR: Dependencies installation failed, trying manual installation...
python -m pip install streamlit openai python-dotenv
)
echo OK Dependencies check completed
echo.
echo Getting network information...
:: Get local IP address
for /f "tokens=2 delims=:" %%i in ('ipconfig ^| findstr "IPv4"') do (
set "IP_ADDR=%%i"
goto :IP_FOUND
)
:IP_FOUND
set "IP_ADDR=%IP_ADDR: =%"
echo Network information obtained:
echo Local URL: http://localhost:8513
echo LAN URL: http://%IP_ADDR%:8513
echo.
echo Starting application...
echo Please wait, browser will open automatically...
echo.
:: Automatically open browser (local address)
start http://localhost:8513
:: Run application
python -m streamlit run app.py --server.headless true --server.port 8513 --server.address 0.0.0.0 --browser.gatherUsageStats false --browser.serverAddress 0.0.0.0
echo.
echo ========================================
echo Application stopped running
echo ========================================
echo.
pause