Files
agent/quick-start.bat
KQL c477fc1826 添加智能启动功能,彻底解决目录结构问题
- 创建 start.js 智能启动脚本,自动检测项目结构
- 更新 quick-start 脚本,添加目录自动切换功能
- 简化克隆命令,用户可以使用标准方式克隆
- 无需用户手动调整,项目自动适配各种目录结构
- 提升用户体验,真正实现零配置部署
2025-08-24 14:30:06 +08:00

73 lines
1.6 KiB
Batchfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
echo ======================================
echo AI Agent 工作流 - 快速启动脚本
echo ======================================
echo.
REM 检查Node.js是否安装
where node >nul 2>nul
if %errorlevel% == 0 (
echo √ Node.js 已安装
node -v
) else (
echo × Node.js 未安装
echo 请先安装 Node.js: https://nodejs.org/
pause
exit /b 1
)
REM 检查npm是否安装
where npm >nul 2>nul
if %errorlevel% == 0 (
echo √ npm 已安装
npm -v
) else (
echo × npm 未安装
pause
exit /b 1
)
REM 检查端口是否被占用
set PORT=5175
netstat -ano | findstr :%PORT% >nul 2>nul
if %errorlevel% == 0 (
echo.
echo 警告: 端口 %PORT% 已被占用
echo 请手动关闭占用该端口的程序,或修改 package.json 中的端口配置
echo.
echo 提示:可以使用以下命令查看占用端口的进程:
echo netstat -ano ^| findstr :%PORT%
echo.
pause
)
echo.
echo 正在安装依赖...
call npm install
REM 检查是否存在 index.html
if not exist "index.html" (
echo.
echo 警告:当前目录没有 index.html
REM 检查是否在 agent 子目录中
if exist "agent\index.html" (
echo 检测到项目在 agent 子目录中,正在切换...
cd agent
) else if exist "..\index.html" (
echo 检测到项目在上级目录,正在切换...
cd ..
)
)
echo.
echo ======================================
echo 启动服务器...
echo ======================================
echo.
echo 服务器地址: http://127.0.0.1:5175/
echo 按 Ctrl+C 停止服务器
echo.
REM 启动服务器
call npm run dev