-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_agent.bat
More file actions
26 lines (19 loc) · 824 Bytes
/
run_agent.bat
File metadata and controls
26 lines (19 loc) · 824 Bytes
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
@echo off
set PYTHONUTF8=1
chcp 65001 > nul
REM ===== CHECK REQUIRED ENVIRONMENT VARIABLES =====
if "%MOLTBOOK_PROJECT_PATH%"=="" (
echo ERROR: MOLTBOOK_PROJECT_PATH environment variable is not set!
echo Please set it in Windows System Environment Variables.
echo Example: MOLTBOOK_PROJECT_PATH=C:\Users\YourName\Documents\MoltbookLocalAgent
pause
exit /b 1
)
REM ===== EXECUTION =====
cd /d "%MOLTBOOK_PROJECT_PATH%"
"%MOLTBOOK_PROJECT_PATH%\env\Scripts\python.exe" "%MOLTBOOK_PROJECT_PATH%\main.py" %* >> "%MOLTBOOK_PROJECT_PATH%\agent.log" 2>&1
REM ===== LOGGING =====
echo [%date% %time%] Moltbook agent executed with args: %* >> "%MOLTBOOK_PROJECT_PATH%\scheduler.log"
if %ERRORLEVEL% NEQ 0 (
echo [%date% %time%] ERROR: Exit code %ERRORLEVEL% >> "%MOLTBOOK_PROJECT_PATH%\scheduler.log"
)