Added CLI Arguments for faster server and agent launching during development.

This commit is contained in:
2025-09-02 16:55:57 -06:00
parent d6fdcc944f
commit 9fa77b9e19
2 changed files with 113 additions and 29 deletions

45
.vscode/tasks.json vendored
View File

@@ -20,6 +20,51 @@
"panel": "shared" "panel": "shared"
}, },
"problemMatcher": [] "problemMatcher": []
},
{
"label": "Borealis - Server (Flask)",
"type": "shell",
"command": "powershell.exe",
"args": [
"-ExecutionPolicy", "Bypass",
"-File", "${workspaceFolder}/Borealis.ps1",
"-Server", "-Flask"
],
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "Borealis - Server (Vite)",
"type": "shell",
"command": "powershell.exe",
"args": [
"-ExecutionPolicy", "Bypass",
"-File", "${workspaceFolder}/Borealis.ps1",
"-Server", "-Vite"
],
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
},
{
"label": "Borealis - Agent",
"type": "shell",
"command": "powershell.exe",
"args": [
"-ExecutionPolicy", "Bypass",
"-File", "${workspaceFolder}/Borealis.ps1",
"-Agent"
],
"presentation": {
"reveal": "always",
"panel": "shared"
},
"problemMatcher": []
} }
] ]
} }

View File

@@ -14,6 +14,41 @@
Usage: Usage:
Set-ExecutionPolicy Unrestricted -Scope Process; .\Borealis.ps1 Set-ExecutionPolicy Unrestricted -Scope Process; .\Borealis.ps1
#> #>
[CmdletBinding()]
param(
[switch]$Server,
[switch]$Agent,
[switch]$Vite,
[switch]$Flask,
[switch]$Quick
)
# Preselect menu choices from CLI args (optional)
$choice = $null
$modeChoice = $null
if ($Server -and $Agent) {
Write-Host "Cannot use -Server and -Agent together." -ForegroundColor Red
exit 1
}
if ($Vite -and $Flask) {
Write-Host "Cannot combine -Vite and -Flask." -ForegroundColor Red
exit 1
}
if ($Server) {
$choice = '1'
} elseif ($Agent) {
$choice = '2'
}
if ($Server) {
if ($Vite) { $modeChoice = '3' }
elseif ($Flask -and $Quick){ $modeChoice = '2' }
elseif ($Flask) { $modeChoice = '1' }
}
$host.UI.RawUI.WindowTitle = "Borealis" $host.UI.RawUI.WindowTitle = "Borealis"
Clear-Host Clear-Host
@@ -272,38 +307,42 @@ foreach ($tool in @($pythonExe, $nodeExe, $npmCmd, $npxCmd)) {
$env:PATH = '{0};{1};{2}' -f (Split-Path $pythonExe), (Split-Path $nodeExe), $env:PATH $env:PATH = '{0};{1};{2}' -f (Split-Path $pythonExe), (Split-Path $nodeExe), $env:PATH
# ---------------------- Menu Prompt & User Input ---------------------- # ---------------------- Menu Prompt & User Input ----------------------
Write-Host " " if (-not $choice) {
Write-Host "Please choose which function you want to launch:" Write-Host " "
Write-Host " 1) Borealis Server" -ForegroundColor DarkGray Write-Host "Please choose which function you want to launch:"
Write-Host " 2) Borealis Agent" -ForegroundColor DarkGray Write-Host " 1) Borealis Server" -ForegroundColor DarkGray
Write-Host " 3) Build Electron App " -NoNewline -ForegroundColor DarkGray Write-Host " 2) Borealis Agent" -ForegroundColor DarkGray
Write-Host "[Experimental]" -ForegroundColor Red Write-Host " 3) Build Electron App " -NoNewline -ForegroundColor DarkGray
Write-Host " 4) Package Self-Contained EXE of Server or Agent " -NoNewline -ForegroundColor DarkGray Write-Host "[Experimental]" -ForegroundColor Red
Write-Host "[Experimental]" -ForegroundColor Red Write-Host " 4) Package Self-Contained EXE of Server or Agent " -NoNewline -ForegroundColor DarkGray
Write-Host " 5) Update Borealis " -NoNewLine -ForegroundColor DarkGray Write-Host "[Experimental]" -ForegroundColor Red
Write-Host "[Requires Re-Build]" -ForegroundColor Red Write-Host " 5) Update Borealis " -NoNewLine -ForegroundColor DarkGray
Write-Host " 6) Perform AutoHotKey Automation Testing " -NoNewline -ForegroundColor DarkGray Write-Host "[Requires Re-Build]" -ForegroundColor Red
Write-Host "[Experimental - Dev Testing]" -ForegroundColor Red Write-Host " 6) Perform AutoHotKey Automation Testing " -NoNewline -ForegroundColor DarkGray
Write-Host "Type a number and press " -NoNewLine Write-Host "[Experimental - Dev Testing]" -ForegroundColor Red
Write-Host "<ENTER>" -ForegroundColor DarkCyan Write-Host "Type a number and press " -NoNewLine
$choice = Read-Host Write-Host "<ENTER>" -ForegroundColor DarkCyan
$choice = Read-Host
}
switch ($choice) { switch ($choice) {
"1" { "1" {
$host.UI.RawUI.WindowTitle = "Borealis Server" $host.UI.RawUI.WindowTitle = "Borealis Server"
Write-Host " " if (-not $modeChoice) {
Write-Host "Configure Borealis Server Mode:" -ForegroundColor DarkYellow Write-Host " "
Write-Host " 1) Build & Launch > " -NoNewLine -ForegroundColor DarkGray Write-Host "Configure Borealis Server Mode:" -ForegroundColor DarkYellow
Write-Host "Production Flask Server @ " -NoNewLine Write-Host " 1) Build & Launch > " -NoNewLine -ForegroundColor DarkGray
Write-Host "http://localhost:5000" -ForegroundColor DarkCyan Write-Host "Production Flask Server @ " -NoNewLine
Write-Host " 2) [Skip Build] & Immediately Launch > " -NoNewLine -ForegroundColor DarkGray Write-Host "http://localhost:5000" -ForegroundColor DarkCyan
Write-Host "Production Flask Server @ " -NoNewLine Write-Host " 2) [Skip Build] & Immediately Launch > " -NoNewLine -ForegroundColor DarkGray
Write-Host "http://localhost:5000" -ForegroundColor DarkCyan Write-Host "Production Flask Server @ " -NoNewLine
Write-Host " 3) Launch > " -NoNewLine -ForegroundColor DarkGray Write-Host "http://localhost:5000" -ForegroundColor DarkCyan
Write-Host "[Hotload-Ready] " -NoNewLine -ForegroundColor Green Write-Host " 3) Launch > " -NoNewLine -ForegroundColor DarkGray
Write-Host "Vite Dev Server @ " -NoNewLine Write-Host "[Hotload-Ready] " -NoNewLine -ForegroundColor Green
Write-Host "http://localhost:5173" -ForegroundColor DarkCyan Write-Host "Vite Dev Server @ " -NoNewLine
$modeChoice = Read-Host "Enter choice [1/2/3]" Write-Host "http://localhost:5173" -ForegroundColor DarkCyan
$modeChoice = Read-Host "Enter choice [1/2/3]"
}
switch ($modeChoice) { switch ($modeChoice) {
"1" { $borealis_operation_mode = "production" } "1" { $borealis_operation_mode = "production" }