# Backboard CLI installer (native binary, PowerShell) # Usage: irm http://app.backboard.io/api/cli/windows | iex $ErrorActionPreference = 'Stop' [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 $ApiBase = 'http://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' $Url = "$ApiBase/cli/download/windows-x64" 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"