forked from AgriciDaniel/claude-blog
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.ps1
More file actions
66 lines (56 loc) · 2.4 KB
/
uninstall.ps1
File metadata and controls
66 lines (56 loc) · 2.4 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
#!/usr/bin/env pwsh
# claude-blog uninstaller for Windows
# Cleanly removes all blog skills, agents, templates, and scripts
$ErrorActionPreference = "Stop"
function Write-Color($Color, $Text) {
Write-Host $Text -ForegroundColor $Color
}
function Main {
$SkillDir = Join-Path (Join-Path $env:USERPROFILE ".claude") "skills"
$AgentDir = Join-Path (Join-Path $env:USERPROFILE ".claude") "agents"
Write-Color Cyan "=== Uninstalling claude-blog ==="
Write-Host ""
# Remove main skill (includes references, templates, scripts)
$blogDir = Join-Path $SkillDir "blog"
if (Test-Path $blogDir) {
Remove-Item -Recurse -Force $blogDir
Write-Color Green " Removed: $blogDir"
}
# Remove sub-skills via glob (closes audit VULN-035: prior static array
# was stale and missed v1.7.0 sub-skills like blog-cluster, blog-flow,
# blog-multilingual, blog-translate, blog-localize, blog-locale-audit,
# blog-notebooklm, blog-audio, blog-google. The glob pattern is the
# same approach uninstall.sh already uses.)
if (Test-Path $SkillDir) {
Get-ChildItem -Path $SkillDir -Directory -Filter "blog-*" | ForEach-Object {
Remove-Item -Recurse -Force $_.FullName
Write-Color Green " Removed: $($_.FullName)"
}
}
# Remove agents via glob (closes VULN-035: blog-translator was missing
# from the static list).
if (Test-Path $AgentDir) {
Get-ChildItem -Path $AgentDir -Filter "blog-*.md" | ForEach-Object {
Remove-Item -Force $_.FullName
Write-Color Green " Removed: $($_.FullName)"
}
}
# Purge credential artifacts from cross-skill data dirs (audit follow-up
# to VULN-805 in cybersec audit: cookies/tokens left behind post-uninstall
# is a meaningful exposure window).
$credPaths = @(
(Join-Path (Join-Path (Join-Path $env:USERPROFILE ".config") "claude-seo") "oauth-token.json"),
(Join-Path (Join-Path (Join-Path $env:USERPROFILE ".config") "claude-seo") "google-api.json")
)
foreach ($credPath in $credPaths) {
if (Test-Path $credPath) {
Remove-Item -Force $credPath -ErrorAction SilentlyContinue
Write-Color Green " Removed credential: $credPath"
}
}
Write-Host ""
Write-Color Cyan "=== claude-blog uninstalled ==="
Write-Host ""
Write-Color Yellow "Restart Claude Code to complete removal."
}
Main