# aipilot installer for Windows. # # irm https://aipilot-api.ouedernidev.workers.dev/install.ps1 | iex # # Non-interactive: $env:AIPILOT_LICENSE = "AIP-XXXX-XXXX-XXXX-XXXX"; $env:AIPILOT_YES = "1"; irm ... | iex # # What it does: installs the 'aipilot' command to %LOCALAPPDATA%\aipilot, activates this # computer with your license key, and configures Claude Code, Claude Desktop and OpenCode. # Everything it changes is undone by 'aipilot uninstall'. No admin rights needed. & { $ErrorActionPreference = "Stop" $Brand = "aipilot" $BaseUrl = if ($env:AIPILOT_URL) { $env:AIPILOT_URL.TrimEnd("/") } else { "https://aipilot-api.ouedernidev.workers.dev" } $Dir = if ($env:AIPILOT_DIR) { $env:AIPILOT_DIR } else { Join-Path $env:LOCALAPPDATA "aipilot" } Write-Host "`n$Brand installer" -ForegroundColor Cyan [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 New-Item -ItemType Directory -Force $Dir | Out-Null $helper = Join-Path $Dir "aipilot.ps1" Invoke-WebRequest -UseBasicParsing "$BaseUrl/aipilot.ps1" -OutFile $helper # 'aipilot' works from cmd and PowerShell without changing the execution policy. Set-Content -Path (Join-Path $Dir "aipilot.cmd") -Encoding ASCII -Value "@powershell.exe -NoProfile -ExecutionPolicy Bypass -File `"%~dp0aipilot.ps1`" %* & exit /b" # Seed the helper's config with the server URL before activation. $cfgFile = Join-Path $Dir "config.json" if (-not (Test-Path $cfgFile)) { [IO.File]::WriteAllText($cfgFile, (@{ baseUrl = $BaseUrl } | ConvertTo-Json), (New-Object Text.UTF8Encoding $false)) } Write-Host " [ok] Installed the 'aipilot' command to $Dir" -ForegroundColor Green if (-not $env:AIPILOT_SKIP_PATH) { $userPath = [Environment]::GetEnvironmentVariable("Path", "User") if (-not (($userPath -split ";") -contains $Dir)) { [Environment]::SetEnvironmentVariable("Path", (@($userPath, $Dir) | Where-Object { $_ }) -join ";", "User") Write-Host " [ok] Added to your PATH (open a new terminal to use 'aipilot')" -ForegroundColor Green } $env:Path = "$env:Path;$Dir" } $run = { param($cmd, $arg) & powershell.exe -NoProfile -ExecutionPolicy Bypass -File $helper $cmd $arg $(if ($env:AIPILOT_YES) { "-Yes" }) } $license = $env:AIPILOT_LICENSE if (-not $license) { $license = Read-Host "Enter your $Brand license key (AIP-XXXX-XXXX-XXXX-XXXX)" } & $run "activate" $license if ($LASTEXITCODE -ne 0) { Write-Host "Activation failed - check the key and run: aipilot activate " -ForegroundColor Red; return } & $run "setup" }