# BRIMIND edition - Windows uninstaller. irm https://router.brimind.pro/uninstall.ps1 | iex # Removes the pack, undoes the picker patch; keeps Hermes, sessions and (unless BRIMIND_REMOVE_KEY=1) the key. $ErrorActionPreference = 'Stop' Set-StrictMode -Version 2 function Uninstall-Brimind { [CmdletBinding()] param([string]$HermesHome = $(if ($env:HERMES_HOME) { $env:HERMES_HOME } else { Join-Path $HOME '.hermes' }), [switch]$RemoveKey = ($env:BRIMIND_REMOVE_KEY -eq '1')) $bk = Join-Path $HermesHome ('brimind\backups\uninstall-' + (Get-Date -Format 'yyyyMMdd-HHmmss')) New-Item -ItemType Directory -Force -Path $bk | Out-Null $patcher = Join-Path $HermesHome 'plugins\brimind-edition\patcher.py' $py = Get-ChildItem -Path (Join-Path $HermesHome 'tools') -Filter python.exe -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 if ((Test-Path $patcher) -and $py) { & $py.FullName $patcher --undo } $hermes = Get-Command hermes -ErrorAction SilentlyContinue if ($hermes) { & $hermes.Source plugins disable brimind-edition *> $null } foreach ($r in @('plugins\model-providers\brimind', 'plugins\brimind-edition', 'desktop-plugins\brimind-edition', 'desktop-plugins\bot-context-lengths')) { $p = Join-Path $HermesHome $r if (Test-Path $p) { $d = Join-Path $bk $r; New-Item -ItemType Directory -Force -Path (Split-Path $d) | Out-Null; Move-Item $p $d; Write-Host "removed $r" } } $envf = Join-Path $HermesHome '.env' if ($RemoveKey -and (Test-Path $envf)) { Set-Content -Path $envf -Value @(Get-Content $envf | Where-Object { $_ -notmatch '^BRIMIND_API_KEY=' }) -Encoding ascii; Write-Host 'key removed' } Write-Host "[ok] BRIMIND edition removed (files kept in $bk). Hermes itself is untouched." -ForegroundColor Green } Uninstall-Brimind