File size: 1,777 Bytes
279ebac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# --- Ever Brain One-Click Installer for Windows ---
# This script packages the CLI and installs it globally for the current user.

$ErrorActionPreference = "Stop"

Write-Host "--- Ever Brain Installation Started ---" -ForegroundColor Cyan

# 1. Resolve Paths
$RepoRoot = Get-Item $PSScriptRoot\..
$InstallDir = Join-Path $env:LOCALAPPDATA "EverBrain"
$BinDir = Join-Path $InstallDir "bin"
$ExeName = "ever-brain.exe"
$DistExe = Join-Path $RepoRoot "dist\$ExeName"

# 2. Package the CLI
Write-Host "> Packaging CLI (this may take a minute)..." -ForegroundColor Gray
Set-Location $RepoRoot
python scripts/package_cli.py

if (-not (Test-Path $DistExe)) {
    Write-Error "Packaging failed: $DistExe not found."
}

# 3. Create Install Directory
Write-Host "> Creating installation directory at $BinDir..." -ForegroundColor Gray
if (-not (Test-Path $BinDir)) {
    New-Item -ItemType Directory -Path $BinDir -Force | Out-Null
}

# 4. Copy Executable
Write-Host "> Installing $ExeName..." -ForegroundColor Gray
Copy-Item $DistExe $BinDir -Force

# 5. Add to PATH
Write-Host "> Updating PATH environment variable..." -ForegroundColor Gray
$UserPath = [Environment]::GetEnvironmentVariable("Path", "User")
if ($UserPath -notlike "*$BinDir*") {
    $NewPath = "$UserPath;$BinDir"
    [Environment]::SetEnvironmentVariable("Path", $NewPath, "User")
    $env:Path = "$env:Path;$BinDir"
    Write-Host "++ Added $BinDir to User PATH." -ForegroundColor Green
} else {
    Write-Host ">> $BinDir is already in PATH." -ForegroundColor DarkGray
}

Write-Host "`nSUCCESS! Ever Brain is now installed." -ForegroundColor Green
Write-Host "Please restart your terminal and run: ever-brain status" -ForegroundColor White
Write-Host "----------------------------------------" -ForegroundColor Cyan