-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy pathuninstall.ps1
More file actions
74 lines (64 loc) · 3.21 KB
/
Copy pathuninstall.ps1
File metadata and controls
74 lines (64 loc) · 3.21 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
68
69
70
71
72
73
74
#Requires -Version 5.1
<#
.SYNOPSIS
Claude Ads Uninstaller for Windows (multi-host).
.DESCRIPTION
Removes every ads-* sub-skill directory plus the orchestrator and bundled
agents from the chosen host's install root. Uses glob discovery so new
sub-skills don't require uninstaller updates.
.PARAMETER Target
Which host CLI to uninstall from. Default: claude.
#>
param(
[ValidateSet('claude','codex','cursor','windsurf','gemini','goose')]
[string]$Target = 'claude'
)
$ErrorActionPreference = "Stop"
function Resolve-TargetPaths {
param([string]$T)
switch ($T) {
'claude' { return @{ SkillBase = Join-Path $env:USERPROFILE ".claude\skills"; AgentDir = Join-Path $env:USERPROFILE ".claude\agents" } }
'codex' { return @{ SkillBase = Join-Path $env:USERPROFILE ".codex\skills"; AgentDir = Join-Path $env:USERPROFILE ".codex\agents" } }
'cursor' { return @{ SkillBase = Join-Path $env:USERPROFILE ".cursor\extensions\claude-ads\skills"; AgentDir = Join-Path $env:USERPROFILE ".cursor\extensions\claude-ads\agents" } }
'windsurf' { return @{ SkillBase = Join-Path $env:USERPROFILE ".windsurf\skills"; AgentDir = Join-Path $env:USERPROFILE ".windsurf\agents" } }
'gemini' { return @{ SkillBase = Join-Path $env:USERPROFILE ".gemini\extensions\claude-ads\skills"; AgentDir = Join-Path $env:USERPROFILE ".gemini\extensions\claude-ads\agents" } }
'goose' { return @{ SkillBase = Join-Path $env:USERPROFILE ".config\goose\skills"; AgentDir = Join-Path $env:USERPROFILE ".config\goose\agents" } }
default { throw "Unknown target: $T" }
}
}
function Main {
$paths = Resolve-TargetPaths -T $Target
$SkillBase = $paths.SkillBase
$AgentDir = $paths.AgentDir
Write-Host "Uninstalling Claude Ads from $SkillBase and $AgentDir..."
# Remove orchestrator
$MainSkill = Join-Path $SkillBase "ads"
if (Test-Path $MainSkill) {
Remove-Item -Path $MainSkill -Recurse -Force
}
# Remove all ads-* sub-skills via glob
if (Test-Path $SkillBase) {
Get-ChildItem -Path $SkillBase -Directory -Filter "ads-*" -ErrorAction SilentlyContinue | ForEach-Object {
Remove-Item -Path $_.FullName -Recurse -Force
}
}
# Remove bundled audit + creative agents.
# NOTE: Keep this list in sync with the contents of `agents/` in the repo.
# install.ps1 uses `Copy-Item agents\*.md` so any new agent file added
# there must also be appended below. Pre-v1.7.1 the list contained
# non-existent entries (audit-amazon, audit-attribution, audit-server-side)
# and missed the actual shipped agents.
$Agents = @(
"audit-budget", "audit-compliance", "audit-creative",
"audit-google", "audit-meta", "audit-tracking",
"copy-writer", "creative-strategist", "format-adapter", "visual-designer"
)
foreach ($agent in $Agents) {
$AgentPath = Join-Path $AgentDir "$agent.md"
if (Test-Path $AgentPath) {
Remove-Item -Path $AgentPath -Force
}
}
Write-Host "[OK] Claude Ads uninstalled." -ForegroundColor Green
}
Main