# Terminal CLI -- AhoosAI in the terminal, installed for this Windows user. Terminal CLI made by AhoosAI. # # irm https://ahoos-ai.site/downloads/cli/install.ps1 | iex # # Downloads the program into %LOCALAPPDATA%\Programs\terminal-cli, checks it against the published # checksum, and puts that folder on this user's PATH. No administrator needed. $ErrorActionPreference = 'Stop' $base = 'https://ahoos-ai.site/downloads/cli' $dir = Join-Path $env:LOCALAPPDATA 'Programs\terminal-cli' New-Item -ItemType Directory -Force -Path $dir | Out-Null $sums = (Invoke-WebRequest -UseBasicParsing "$base/SHA256SUMS.txt").Content -split "`n" $line = $sums | Where-Object { $_ -match 'terminal-cli-[\d.]+-windows-x64\.exe$' } | Select-Object -First 1 if (-not $line) { throw 'No Windows program is published yet.' } $hash, $name = $line.Trim() -split '\s+', 2 $target = Join-Path $dir 'terminal-cli.exe' Write-Host "Downloading $name ..." Invoke-WebRequest -UseBasicParsing "$base/$name" -OutFile "$target.part" if ((Get-FileHash "$target.part" -Algorithm SHA256).Hash.ToLower() -ne $hash.ToLower()) { Remove-Item "$target.part"; throw 'The download does not match its checksum; nothing was installed.' } Move-Item -Force "$target.part" $target $path = [Environment]::GetEnvironmentVariable('Path', 'User') if (($path -split ';') -notcontains $dir) { [Environment]::SetEnvironmentVariable('Path', ($path.TrimEnd(';') + ';' + $dir).TrimStart(';'), 'User') Write-Host "Added $dir to your PATH (open a new terminal)." } Write-Host "Installed: $target" Write-Host 'Next: terminal-cli login (a key from https://ahoos-ai.site/services/platforme/)'