diff --git a/portable/Windows-Start.bat b/portable/Windows-Start.bat index ddaeee2..717e5ff 100644 --- a/portable/Windows-Start.bat +++ b/portable/Windows-Start.bat @@ -1,5 +1,4 @@ @echo off -setlocal EnableDelayedExpansion chcp 65001 >nul 2>&1 title U-Claw - Portable AI Agent @@ -76,10 +75,10 @@ REM Find available port set PORT=18789 :check_port netstat -an | findstr ":%PORT% " | findstr "LISTENING" >nul 2>&1 -if !errorlevel!==0 ( +if %errorlevel%==0 ( echo Port %PORT% in use, trying next... set /a PORT+=1 - if !PORT! gtr 18799 ( + if %PORT% gtr 18799 ( echo No available port 18789-18799 pause exit /b 1 @@ -87,40 +86,34 @@ if !errorlevel!==0 ( goto :check_port ) -REM Read token from config -set "TOKEN=uclaw" -if exist "%STATE_DIR%\openclaw.json" ( - for /f "tokens=*" %%t in ('"%NODE_BIN%" -e "try{const c=JSON.parse(require('fs').readFileSync(process.argv[1],'utf8'));console.log((c.gateway&&c.gateway.auth&&c.gateway.auth.token)||'uclaw')}catch(e){console.log('uclaw')}" "%STATE_DIR%\openclaw.json"') do set "TOKEN=%%t" -) +echo Starting OpenClaw on port %PORT%... +echo. -echo Starting OpenClaw on port !PORT!... +REM Start Config Server in background +echo Starting Config Center on port 18788... +set "CONFIG_SERVER=%UCLAW_DIR%config-server" +start /B "" "%NODE_BIN%" "%CONFIG_SERVER%\server.js" >nul 2>&1 + +REM Wait for config server to start +timeout /t 2 /nobreak >nul + +REM Open both Dashboard and Config Center +echo Opening Dashboard and Config Center... +timeout /t 1 /nobreak >nul + +REM Open OpenClaw Dashboard first +start "" http://127.0.0.1:%PORT%/#token=uclaw + +REM Open Config Center (Node.js web UI) second +start "" http://127.0.0.1:18788/ + +echo Browsers opened. Starting OpenClaw Gateway on port %PORT%... echo DO NOT close this window while using U-Claw! echo. cd /d "%CORE_DIR%" set "OPENCLAW_MJS=%CORE_DIR%\node_modules\openclaw\openclaw.mjs" -echo Log: %DATA_DIR%\logs\gateway.log - -REM Check if model is configured -set "HAS_MODEL=no" -if exist "%STATE_DIR%\openclaw.json" ( - findstr /c:"model" "%STATE_DIR%\openclaw.json" >nul 2>&1 && set "HAS_MODEL=yes" -) -if "!HAS_MODEL!"=="no" if exist "%DATA_DIR%\config.json" ( - findstr /c:"model" "%DATA_DIR%\config.json" >nul 2>&1 && set "HAS_MODEL=yes" -) - -REM Open browser after a short delay (gateway needs ~2-3s to start) -if "!HAS_MODEL!"=="yes" ( - echo Opening dashboard in 3 seconds... - start /B "" cmd /c "timeout /t 3 /nobreak >nul && start http://127.0.0.1:!PORT!/#token=!TOKEN!" -) else ( - echo First time setup - opening Config page in 3 seconds... - start /B "" cmd /c "timeout /t 3 /nobreak >nul && start %UCLAW_DIR%Config.html?port=!PORT!" -) - -REM Start gateway (foreground, blocks until stopped) -"%NODE_BIN%" "%OPENCLAW_MJS%" gateway run --allow-unconfigured --force --port !PORT! 2>&1 | powershell -command "& { $input | Tee-Object -Append -FilePath '%DATA_DIR%\logs\gateway.log' }" +"%NODE_BIN%" "%OPENCLAW_MJS%" gateway run --allow-unconfigured --force --port %PORT% echo. echo OpenClaw stopped. diff --git a/portable/config-server/public/index.html b/portable/config-server/public/index.html index 1119b7f..6313298 100644 --- a/portable/config-server/public/index.html +++ b/portable/config-server/public/index.html @@ -6,202 +6,619 @@
简单配置,快速启动
+选择模型,填入 API Key,一键启动
- -推荐国内用户用 MiniMax / Kimi / DeepSeek
+ +填写任意 OpenAI 兼容 API 地址(OpenRouter、API2D、New API、One API 等)
+请填写对应模型的 API Key
+ +你的 Key 仅保存在本地 U 盘,不会上传到任何服务器
+模型和 API Key 已保存到本地
+点击卡片展开填写,不填可直接跳过:
+渠道配置会自动写入,Gateway 需重启生效
+U 盘内的文件结构
+放入 .md 技能文件,OpenClaw 自动加载
+Node.js 运行时、OpenClaw 核心代码
+API Key、聊天历史等保存在此(仅本地)
+