# Backboard CLI installer (native binary, PowerShell) # Usage: irm https://app.backboard.io/api/cli/windows | iex $ErrorActionPreference = 'Stop' [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $ApiBase = 'https://app.backboard.io/api' $InviteRequired = '0' $Code = '' if ($InviteRequired -eq '1' -and [string]::IsNullOrEmpty($Code)) { $Code = Read-Host 'Enter your invite code' } $InstallDir = Join-Path $env:USERPROFILE '.backboard\bin' $Binary = Join-Path $InstallDir 'backboard.exe' # Default to the AVX2 build (every Windows 10+ x64 box since ~2013 has it). # Pre-AVX2 CPUs that hit an "Illegal Instruction" can set # $env:BACKBOARD_BASELINE=1 before running to grab the baseline slice. $Slug = 'windows-x64' if ($env:BACKBOARD_BASELINE -eq '1') { $Slug = 'windows-x64-baseline' } $Url = "$ApiBase/cli/download/$Slug" if (-not [string]::IsNullOrEmpty($Code)) { $Url = "$Url?code=$Code" } New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null Write-Host " downloading backboard (windows-x64)..." -ForegroundColor Cyan try { Invoke-WebRequest -Uri $Url -OutFile $Binary -UseBasicParsing } catch { Write-Host "error: download failed (invalid invite code, or Windows binary not available yet)." -ForegroundColor Red exit 1 } $userPath = [Environment]::GetEnvironmentVariable('Path', 'User') if ($null -eq $userPath) { $userPath = '' } if ($userPath -notlike "*$InstallDir*") { $newPath = if ($userPath) { "$userPath;$InstallDir" } else { $InstallDir } [Environment]::SetEnvironmentVariable('Path', $newPath, 'User') Write-Host " added $InstallDir to user PATH — open a new shell to pick it up" -ForegroundColor Cyan } Write-Host " installed -> $Binary" -ForegroundColor Green Write-Host " run: backboard"