重构 lib 为扁平模块并支持 Windows schtasks;新增 JS/Bash/PowerShell 模板、WebUI 调度编辑,以及 Cursor Skill 与 MCP 工具供 Agent 管理定时任务。 Co-authored-by: Cursor <cursoragent@cursor.com>
33 lines
871 B
Batchfile
33 lines
871 B
Batchfile
@echo off
|
|
setlocal EnableExtensions
|
|
|
|
cd /d "%~dp0"
|
|
|
|
set "BACKEND=%~dp0webui\backend"
|
|
set "VENV=%BACKEND%\.venv"
|
|
set "HOST=%SPROUTCLAW_CRON_WEB_HOST%"
|
|
set "PORT=%SPROUTCLAW_CRON_WEB_PORT%"
|
|
|
|
if not defined HOST set "HOST=0.0.0.0"
|
|
if not defined PORT set "PORT=8765"
|
|
|
|
if not exist "%VENV%\Scripts\python.exe" (
|
|
echo [webui] creating venv...
|
|
python -m venv "%VENV%"
|
|
if errorlevel 1 (
|
|
echo [webui] venv failed. Install Python and add it to PATH.
|
|
exit /b 1
|
|
)
|
|
echo [webui] installing deps...
|
|
"%VENV%\Scripts\python.exe" -m pip install -r "%BACKEND%\requirements.txt"
|
|
if errorlevel 1 exit /b 1
|
|
)
|
|
|
|
set "URL=http://127.0.0.1:%PORT%/"
|
|
echo [webui] starting: %URL%
|
|
start "" "%URL%"
|
|
|
|
"%VENV%\Scripts\uvicorn.exe" main:app --app-dir "%BACKEND%" --host %HOST% --port %PORT% --reload --reload-dir "%BACKEND%" --reload-dir "%~dp0lib"
|
|
|
|
endlocal
|