-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdev.ps1
More file actions
59 lines (51 loc) · 2.1 KB
/
Copy pathdev.ps1
File metadata and controls
59 lines (51 loc) · 2.1 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
51
52
53
54
55
56
57
58
59
# PowerShell wrapper to run dev.sh with proper setup
# Usage: ./dev.ps1
param(
[switch]$NoFix = $false # Skip line ending fix if already done
)
$scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Path
$devScript = Join-Path $scriptPath "src\dev.sh"
Write-Host "🚀 Starting AG-UI Development Server..." -ForegroundColor Cyan
Write-Host ""
if (-not $NoFix) {
Write-Host "📝 Fixing line endings..." -ForegroundColor Yellow
wsl bash -c "perl -pi -e 's/\r\n/\n/g' /mnt/c/temp/AI/AGUI/agui/src/dev.sh && chmod +x /mnt/c/temp/AI/AGUI/agui/src/dev.sh"
if ($LASTEXITCODE -ne 0) {
Write-Host "❌ Failed to fix line endings" -ForegroundColor Red
exit 1
}
Write-Host "✅ Line endings fixed" -ForegroundColor Green
}
Write-Host ""
Write-Host "Starting services..." -ForegroundColor Cyan
Write-Host " 📱 Frontend: http://localhost:5173" -ForegroundColor Green
Write-Host " 🔌 Runtime: http://localhost:3001" -ForegroundColor Green
Write-Host " 🐍 Backend: http://localhost:8888" -ForegroundColor Green
Write-Host ""
Write-Host "Press Ctrl+C to stop all services" -ForegroundColor Yellow
Write-Host ""
# Free up commonly used dev ports if already occupied
function Kill-Port {
param([int]$Port)
try {
$conns = Get-NetTCPConnection -LocalPort $Port -ErrorAction SilentlyContinue
if ($conns) {
$pids = $conns | Select-Object -ExpandProperty OwningProcess | Sort-Object -Unique
foreach ($pid in $pids) {
try {
$proc = Get-Process -Id $pid -ErrorAction SilentlyContinue
if ($proc) {
Write-Host "🛑 Killing process $($proc.ProcessName) (PID $pid) on port $Port" -ForegroundColor Yellow
Stop-Process -Id $pid -Force -ErrorAction SilentlyContinue
}
} catch {}
}
}
} catch {}
}
# Ports: Frontend (5173), Runtime (3001), Backend (8888)
Kill-Port -Port 5173
Kill-Port -Port 3001
Kill-Port -Port 8888
# Run the dev.sh script in WSL
wsl bash -c "cd /mnt/c/temp/AI/AGUI/agui/src && ./dev.sh"