Repository navigation
Expand file tree
/
Copy pathstart-web-native.bat
More file actions
50 lines (44 loc) · 1.68 KB
/
Copy pathstart-web-native.bat
File metadata and controls
50 lines (44 loc) · 1.68 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
@echo off
REM Kimi Code Web launcher -- starts the Web UI powered by the native Rust server.
REM Usage: double-click or run from cmd/powershell:
REM start-web-native.bat - Start native server and open browser
REM start-web-native.bat --no-open - Start native server without browser
setlocal
cd /d "%~dp0"
REM 1. Ensure Rust standalone binary is built
set "CLI_EXE=%~dp0packages\kimi-agent\target\release\kimi-agent-cli.exe"
if not exist "%CLI_EXE%" (
echo Building native Rust agent server binary...
cd /d "%~dp0packages\kimi-agent"
cargo build --release --features cli
if errorlevel 1 (
echo [ERROR] cargo build failed. Please ensure Rust toolchain is installed.
pause
exit /b 1
)
cd /d "%~dp0"
)
REM 2. Ensure the native engine addon is built if needed
set "NODE_FILE=%~dp0packages\kimi-agent\kimi_agent.win32-x64-msvc.node"
if not exist "%NODE_FILE%" (
if not exist "%~dp0node_modules\@napi-rs\cli" (
echo [ERROR] napi CLI not installed. Run `bun install` at the repo root first.
pause
exit /b 1
)
echo Building the native engine addon...
cd /d "%~dp0packages\kimi-agent"
bun run build 2>&1
if errorlevel 1 (
echo [ERROR] napi build failed. Make sure Rust and Visual Studio Build Tools are installed.
echo https://rustup.rs
echo https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022
pause
exit /b 1
)
cd /d "%~dp0"
)
REM 3. Launch the web UI backed by the native Rust server
echo Starting Kimi Web UI with Native Rust Server...
call bun run dev:cli web --rust-server %*
endlocal & exit /b %errorlevel%