forked from notlikeDev/CCPlugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.py
More file actions
105 lines (90 loc) · 2.92 KB
/
uninstall.py
File metadata and controls
105 lines (90 loc) · 2.92 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
#!/usr/bin/env python3
# CCPlugins Uninstaller
"""
CCPlugins Uninstaller
Removes command files from ~/.claude/commands/
"""
import os
import shutil
from pathlib import Path
def main():
# Command files to remove (including old ones for compatibility)
commands = [
"cleanproject.md",
"cleanup-types.md", # Old command (removed)
"commit.md",
"context-cache.md", # Old command (removed)
"contributing.md",
"create-todos.md",
"docs.md",
"explain-like-senior.md",
"find-todos.md",
"fix-imports.md",
"fix-todos.md",
"format.md",
"implement.md",
"make-it-pretty.md",
"predict-issues.md",
"remove-comments.md",
"review.md",
"scaffold.md",
"security-scan.md",
"session-end.md",
"session-start.md",
"test.md",
"todos-to-issues.md",
"undo.md",
"understand.md",
"refactor.md"
]
commands_dir = Path.home() / ".claude" / "commands"
print("CCPlugins Uninstaller")
print("=" * 40)
if not commands_dir.exists():
print("[INFO] Commands directory not found. Nothing to uninstall.")
return
# Count installed commands
installed = 0
for cmd in commands:
if (commands_dir / cmd).exists():
installed += 1
if installed == 0:
print("[INFO] No CCPlugins commands found.")
return
print(f"[FOUND] {installed} CCPlugins commands installed")
response = input("\nRemove all CCPlugins commands? (y/N): ")
if response.lower() != 'y':
print("[CANCELLED] Uninstall cancelled.")
return
# Remove commands
removed = 0
for cmd in commands:
cmd_path = commands_dir / cmd
if cmd_path.exists():
try:
os.remove(cmd_path)
print(f" - Removed {cmd}")
removed += 1
except Exception as e:
print(f" ! Failed to remove {cmd}: {e}")
# Clean up cache and backups if requested
cache_dir = Path.home() / ".claude" / ".ccplugins_cache"
backup_dir = Path.home() / ".claude" / ".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")
print(f"\n[SUCCESS] Uninstalled {removed} commands")
print("Thanks for trying CCPlugins!")
if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print("\n[CANCELLED] Uninstall cancelled.")
except Exception as e:
print(f"\n[ERROR] Uninstall failed: {e}")