-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.py
More file actions
139 lines (121 loc) · 4.19 KB
/
Copy pathuninstall.py
File metadata and controls
139 lines (121 loc) · 4.19 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/usr/bin/env python3
# AI DevStudio Uninstaller
"""
AI DevStudio Uninstaller
Removes skill directories from ~/.claude/skills/ and legacy command files from ~/.claude/commands/
"""
import os
import shutil
from pathlib import Path
def main():
claude_dir = Path.home() / ".claude"
skills_dir = claude_dir / "skills"
commands_dir = claude_dir / "commands"
# Skills to remove
skills = [
"cleanproject",
"commit",
"contributing",
"create-todos",
"docs",
"explain-like-senior",
"find-todos",
"fix-imports",
"fix-todos",
"format",
"implement",
"make-it-pretty",
"predict-issues",
"refactor",
"remove-comments",
"review",
"scaffold",
"security-scan",
"session-current",
"session-end",
"session-help",
"session-list",
"session-resume",
"session-start",
"session-update",
"sessions-init",
"test",
"todos-to-issues",
"understand",
"undo"
]
# Legacy command files (for backward compatibility)
legacy_commands = [f"{skill}.md" for skill in skills]
legacy_commands.extend(["cleanup-types.md", "context-cache.md"]) # Old removed commands
print("AI DevStudio Uninstaller")
print("=" * 40)
# Check for skills (new format)
installed_skills = 0
if skills_dir.exists():
for skill in skills:
if (skills_dir / skill).exists():
installed_skills += 1
# Check for legacy commands (old format)
installed_legacy = 0
if commands_dir.exists():
for cmd in legacy_commands:
if (commands_dir / cmd).exists():
installed_legacy += 1
if installed_skills == 0 and installed_legacy == 0:
print("[INFO] No AI DevStudio skills or commands found.")
return
# Show what will be removed
if installed_skills > 0:
print(f"[FOUND] {installed_skills} AI DevStudio skills (new format)")
if installed_legacy > 0:
print(f"[FOUND] {installed_legacy} legacy command files (old format)")
response = input("\nRemove all AI DevStudio skills and commands? (y/N): ")
if response.lower() != 'y':
print("[CANCELLED] Uninstall cancelled.")
return
# Remove skills (new format)
removed_skills = 0
if skills_dir.exists():
for skill in skills:
skill_path = skills_dir / skill
if skill_path.exists():
try:
shutil.rmtree(skill_path)
print(f" - Removed skill: {skill}")
removed_skills += 1
except Exception as e:
print(f" ! Failed to remove skill {skill}: {e}")
# Remove legacy commands (old format)
removed_legacy = 0
if commands_dir.exists():
for cmd in legacy_commands:
cmd_path = commands_dir / cmd
if cmd_path.exists():
try:
os.remove(cmd_path)
print(f" - Removed legacy command: {cmd}")
removed_legacy += 1
except Exception as e:
print(f" ! Failed to remove {cmd}: {e}")
# Clean up cache and backups if requested
cache_dir = claude_dir / ".ccplugins_cache"
backup_dir = claude_dir / ".ccplugins_backups"
if cache_dir.exists() or backup_dir.exists():
response = input("\nAlso remove cache and backups? (y/N): ")
if response.lower() == 'y':
if cache_dir.exists():
shutil.rmtree(cache_dir)
print(" - Removed cache directory")
if backup_dir.exists():
shutil.rmtree(backup_dir)
print(" - Removed backups directory")
total_removed = removed_skills + removed_legacy
print(f"\n[SUCCESS] Uninstalled {removed_skills} skills and {removed_legacy} legacy commands ({total_removed} total)")
print("Thanks for trying AI DevStudio!")
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print("\n[CANCELLED] Uninstall cancelled.")
except Exception as e:
print(f"\n[ERROR] Uninstall failed: {e}")