Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ await build({
"utf-8-validate",
"zlib-sync",
"erlpack",
// Puppeteer requires Chromium binary — cannot be bundled into exe
"puppeteer",
],
// Define for proper environment
define: {
Expand Down
46 changes: 42 additions & 4 deletions start_bot.bat
Original file line number Diff line number Diff line change
@@ -1,12 +1,50 @@
@echo off
setlocal enabledelayedexpansion
chcp 65001 >nul 2>&1
title AI CLI Gateway Bot

if not exist node_modules (
echo node_modules not found. Running npm install...
npm install
REM Change to the directory where this batch file is located
cd /d "%~dp0"

echo ================================================
echo AI CLI Gateway Bot - Starting...
echo ================================================
echo Working Directory: %CD%
echo ================================================
echo.

REM Check if node_modules exists
if not exist "node_modules" (
echo [INFO] node_modules not found. Running npm install...
call npm install
if !ERRORLEVEL! NEQ 0 (
echo [ERROR] npm install failed!
goto :error
)
)

echo [INFO] Starting bot with tsx...
echo.

call npx tsx src/bot.ts
if !ERRORLEVEL! NEQ 0 (
echo.
echo [ERROR] Bot exited with error code: !ERRORLEVEL!
goto :error
)

goto :end

:error
echo.
echo ================================================
echo An error occurred! Check the messages above.
echo ================================================
echo.
pause
exit /b 1

:end
echo.
npx tsx src/bot.ts
echo [INFO] Bot stopped.
pause
Loading