# Ageri installer — Windows (PowerShell). # # Usage: # iwr -useb https://get.ageri.ai/install.ps1 | iex # # Environment overrides (set BEFORE the pipe): # $env:AGERI_NONINTERACTIVE = "1" # skip prompts, take defaults # $env:AGERI_SKIP_PYTHON = "1" # assume Python 3.11+ on PATH # $env:AGERI_HOME = "$env:USERPROFILE\ageri" # # Source: https://github.com/ageri-platform/Ageri/blob/main/infra/get.ageri.ai/install.ps1 # Inspect the source before piping to iex — same convention as get.docker.com. # # Once 4I.5 ships, `winget install ageri-platform.ageri` becomes the primary # install path. This script stays as a fallback for users without winget # (older Windows 10 / locked-down enterprise installs / CI). $ErrorActionPreference = "Stop" $SCRIPT_VERSION = "1.0.0" # ─── pretty-printing ───────────────────────────────────────────────────────── function Write-Info { param([string]$msg) Write-Host "[ageri-install] $msg" -ForegroundColor DarkGray } function Write-Ok { param([string]$msg) Write-Host "[ageri-install] $msg" -ForegroundColor Green } function Write-Warn { param([string]$msg) Write-Host "[ageri-install] $msg" -ForegroundColor Yellow } function Write-Fatal { param([string]$msg) Write-Host "[ageri-install] $msg" -ForegroundColor Red; exit 1 } Write-Info "Ageri installer v$SCRIPT_VERSION (Windows)" # ─── arch detection ────────────────────────────────────────────────────────── $arch = [System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture switch ($arch) { "X64" { $archStr = "amd64" } "Arm64" { $archStr = "arm64" } default { Write-Fatal "Unsupported architecture '$arch'. amd64 / arm64 only." } } Write-Info "Windows / $archStr" # ─── defaults ──────────────────────────────────────────────────────────────── $nonInteractive = ($env:AGERI_NONINTERACTIVE -eq "1") $skipPython = ($env:AGERI_SKIP_PYTHON -eq "1") $ageriHome = if ($env:AGERI_HOME) { $env:AGERI_HOME } else { Join-Path $env:USERPROFILE "ageri" } Write-Info "AGERI_HOME=$ageriHome" # ─── prerequisite check: python 3.11+ ──────────────────────────────────────── $pythonBin = $null if (-not $skipPython) { foreach ($candidate in @("python3.13", "python3.12", "python3.11", "python3", "python", "py")) { $cmd = Get-Command $candidate -ErrorAction SilentlyContinue if ($cmd) { try { $ver = & $candidate -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')" 2>$null if ($ver -match "^3\.(1[1-9]|[2-9][0-9])$") { $pythonBin = $candidate break } } catch { } } } if (-not $pythonBin) { Write-Warn "Python 3.11+ not found on PATH." Write-Warn "" Write-Warn "Install Python 3.11+ via one of:" Write-Warn " winget install Python.Python.3.11" Write-Warn " Microsoft Store -> Python 3.11" Write-Warn " https://python.org/downloads" Write-Warn "" Write-Fatal "Then re-run this script." } $pythonVer = & $pythonBin --version 2>&1 Write-Ok "Found $pythonBin ($pythonVer)" } # ─── runtime install (4I.6 — shipped) ──────────────────────────────────────── # ageri-platform pulls ageri-sdk as a dependency, so one install gives us both. # Don't suppress pip output — when something breaks, the user needs the actual # error. Earlier versions of this script swallowed all pip output with `*>$null` # and printed a useless "install failed" line; that made every break opaque. # (Same fix we applied to install.sh after the Ubuntu 22.04 --dry-run regression.) Write-Info "Installing ageri-platform from PyPI (pulls ageri-sdk as a dep)..." & $pythonBin -m pip install --user --upgrade ageri-platform if ($LASTEXITCODE -ne 0) { Write-Fatal "ageri-platform install failed (see pip output above)." } $installedVer = & $pythonBin -c "import importlib.metadata; print(importlib.metadata.version('ageri-platform'))" 2>$null $sdkVer = & $pythonBin -c "import importlib.metadata; print(importlib.metadata.version('ageri-sdk'))" 2>$null Write-Ok "ageri-platform installed (version $installedVer)" Write-Ok "ageri-sdk installed transitively (version $sdkVer)" # ─── code-protection toolchain (Phase 2) ───────────────────────────────────── # Skill authors who publish to the marketplace get compile-by-default # code protection: boss.py → Nuitka-compiled boss.pyd at release time. # Install Nuitka here so the first `Release a new version` doesn't fail # with "Nuitka not installed". Nuitka ALSO needs a C compiler — on # Windows that's Microsoft Visual Studio Build Tools, which can't be # auto-installed silently (~3 GB download, GUI installer). We install # Nuitka itself and check for build tools — actionable warning if # missing. Write-Info "Installing Nuitka for code-protection (compiled releases)..." & $pythonBin -m pip install --user --upgrade nuitka if ($LASTEXITCODE -ne 0) { Write-Warn "Nuitka install failed - publishers will hit an error on first compiled release." Write-Warn "Run later: $pythonBin -m pip install --user nuitka" } else { Write-Ok "Nuitka installed." } # Check whether a C compiler is present. cl.exe (MSVC) is the # canonical choice on Windows. If absent, surface install steps — # can't auto-install without UAC + GUI. $hasCl = $null -ne (Get-Command cl.exe -ErrorAction SilentlyContinue) $hasGcc = $null -ne (Get-Command gcc.exe -ErrorAction SilentlyContinue) if (-not $hasCl -and -not $hasGcc) { Write-Warn "No C compiler found (cl.exe / gcc.exe) — Nuitka compiles will fail." Write-Warn "Install Microsoft Visual Studio Build Tools:" Write-Warn " https://visualstudio.microsoft.com/visual-cpp-build-tools/" Write-Warn "Select 'Desktop development with C++' workload (~3 GB)." Write-Warn "Lighter alternative: install MinGW64 and Nuitka will use it." } elseif ($hasCl) { Write-Ok "MSVC compiler (cl.exe) present." } else { Write-Ok "MinGW gcc.exe present." } # ─── data dir provisioning ─────────────────────────────────────────────────── Write-Info "Provisioning AGERI_HOME at $ageriHome..." New-Item -ItemType Directory -Force -Path $ageriHome | Out-Null New-Item -ItemType Directory -Force -Path (Join-Path $ageriHome "skills\local") | Out-Null New-Item -ItemType Directory -Force -Path (Join-Path $ageriHome "skills\community") | Out-Null New-Item -ItemType Directory -Force -Path (Join-Path $ageriHome "skills\_publish_meta") | Out-Null New-Item -ItemType Directory -Force -Path (Join-Path $ageriHome "skills\_import_meta") | Out-Null Write-Ok "AGERI_HOME ready." # ─── PATH wire-up ──────────────────────────────────────────────────────────── # Python's --user install puts scripts in %APPDATA%\Python\Python3xx\Scripts. # Check whether that's on PATH and surface a fix if not. $pythonUserScripts = & $pythonBin -c "import sysconfig; print(sysconfig.get_path('scripts', f'{sysconfig.get_default_scheme()}_user'))" 2>$null if ($pythonUserScripts -and -not ($env:PATH -split ";" -contains $pythonUserScripts)) { Write-Warn "$pythonUserScripts is not on your PATH." Write-Warn "Add it via System Properties -> Environment Variables -> Path, or run:" Write-Warn " [Environment]::SetEnvironmentVariable('Path', `$env:Path + ';$pythonUserScripts', 'User')" Write-Warn "Then open a new terminal." } # ─── next steps ────────────────────────────────────────────────────────────── Write-Ok "" Write-Ok "Ageri installed. Next:" Write-Ok " 1. Run ageri setup to claim your namespace + configure keys." Write-Ok " 2. Run ageri start to bring the runtime up at http://localhost:7821." Write-Ok " 3. Open http://localhost:7821 in a browser." Write-Ok "" Write-Ok "Docs: https://docs.ageri.ai/" Write-Ok "Issues: https://github.com/ageri-platform/Ageri/issues"