-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathuninstall.ps1
More file actions
67 lines (57 loc) · 2.16 KB
/
uninstall.ps1
File metadata and controls
67 lines (57 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<#
.SYNOPSIS
Smriti uninstaller for Windows
.PARAMETER CI
Non-interactive mode. Removes the CI temp home created by install.ps1 -CI.
.EXAMPLE
irm https://raw.githubusercontent.com/zero8dotdev/smriti/main/uninstall.ps1 | iex
#>
param([switch]$CI)
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
# Note: CI flag is accepted for compatibility but temp HOME is no longer used
# (runner HOME is cleaned up automatically after job)
$SMRITI_HOME = Join-Path $env:USERPROFILE ".smriti"
$BIN_DIR = Join-Path $env:USERPROFILE ".local\bin"
$CLAUDE_HOOKS = Join-Path $env:USERPROFILE ".claude\hooks"
function Step([string]$msg) { Write-Host "`n==> $msg" -ForegroundColor Cyan }
function Ok([string]$msg) { Write-Host " OK $msg" -ForegroundColor Green }
# Remove smriti installation directory
Step "Removing smriti"
if (Test-Path $SMRITI_HOME) {
Remove-Item -Recurse -Force $SMRITI_HOME
Ok "Removed $SMRITI_HOME"
} else {
Ok "Not found: $SMRITI_HOME (already removed)"
}
# Remove smriti.cmd shim
$shimPath = Join-Path $BIN_DIR "smriti.cmd"
if (Test-Path $shimPath) {
Remove-Item -Force $shimPath
Ok "Removed $shimPath"
}
# Remove BIN_DIR from user PATH if it's now empty
$remaining = Get-ChildItem $BIN_DIR -ErrorAction SilentlyContinue
if (-not $remaining) {
$userPath = [System.Environment]::GetEnvironmentVariable("PATH","User")
$cleaned = ($userPath -split ";") | Where-Object { $_ -ne $BIN_DIR } | Join-String -Separator ";"
[System.Environment]::SetEnvironmentVariable("PATH",$cleaned,"User")
Ok "Removed $BIN_DIR from PATH"
}
# Remove Claude Code hook
$hook = Join-Path $CLAUDE_HOOKS "post-session.cmd"
if (Test-Path $hook) {
Remove-Item -Force $hook
Ok "Removed Claude Code hook"
}
# Remove daemon files
$daemonDir = Join-Path $env:USERPROFILE ".cache\smriti"
if (Test-Path $daemonDir) {
Remove-Item -Recurse -Force $daemonDir
Ok "Removed daemon cache"
}
Write-Host ""
Write-Host " Smriti uninstalled." -ForegroundColor Green
Write-Host " Your database (~/.cache/qmd/index.sqlite) was NOT removed." -ForegroundColor Gray
Write-Host " To also remove the database, delete: $(Join-Path $env:USERPROFILE '.cache\qmd')" -ForegroundColor Gray
Write-Host ""