-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuninstall.sh
More file actions
executable file
·90 lines (76 loc) · 3.22 KB
/
Copy pathuninstall.sh
File metadata and controls
executable file
·90 lines (76 loc) · 3.22 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
#!/usr/bin/env bash
set -e
# ==============================================================================
# DevMemory AI v1.1.0 — Automated Uninstaller (macOS & Linux)
# ==============================================================================
BOLD='\033[1m'
GREEN='\033[0;32m'
CYAN='\033[0;36m'
YELLOW='\033[0;33m'
RED='\033[0;31m'
RESET='\033[0m'
info() {
echo -e "${CYAN}${BOLD}[INFO]${RESET} $1"
}
success() {
echo -e "${GREEN}${BOLD}[SUCCESS]${RESET} $1"
}
warn() {
echo -e "${YELLOW}${BOLD}[WARN]${RESET} $1"
}
echo -e "${BOLD}${CYAN}"
echo "========================================================"
echo " DevMemory AI v1.1.0 Uninstallation "
echo "========================================================"
echo -e "${RESET}"
# 1. Safely disable all active projects & unregister OS startup items
if command -v dmai >/dev/null 2>&1; then
info "Disabling all active DevMemory AI projects & unregistering OS services..."
dmai disable --all || true
elif command -v bun >/dev/null 2>&1 && [ -f "$HOME/.devmemory-ai/src/cli/index.ts" ]; then
info "Running direct system disable script..."
bun run "$HOME/.devmemory-ai/src/cli/index.ts" disable --all || true
fi
# 2. Sweep remaining OS background launch agents & systemd services
info "Sweeping background watcher daemons & OS launch agents..."
if [[ "$OSTYPE" == "darwin"* ]]; then
if [ -d "$HOME/Library/LaunchAgents" ]; then
for plist in "$HOME/Library/LaunchAgents"/com.devmemory.watcher.*.plist; do
if [ -f "$plist" ]; then
launchctl unload -w "$plist" 2>/dev/null || true
rm -f "$plist" 2>/dev/null || true
fi
done
fi
elif [[ "$OSTYPE" == "linux"* ]]; then
if [ -d "$HOME/.config/systemd/user" ]; then
for service in "$HOME/.config/systemd/user"/devmemory-*.service; do
if [ -f "$service" ]; then
systemctl --user stop "$(basename "$service")" 2>/dev/null || true
systemctl --user disable "$(basename "$service")" 2>/dev/null || true
rm -f "$service" 2>/dev/null || true
fi
done
systemctl --user daemon-reload 2>/dev/null || true
fi
fi
# 3. Terminate any orphan daemon processes
pkill -f "watcher/daemon" 2>/dev/null || pkill -f "daemon.ts" 2>/dev/null || true
# 4. Unlink dmai CLI executable & remove symlinks
info "Unlinking dmai CLI executable from global PATH..."
if command -v bun >/dev/null 2>&1 && [ -d "$HOME/.devmemory-ai" ]; then
(cd "$HOME/.devmemory-ai" && bun unlink 2>/dev/null || true)
fi
rm -f "$HOME/.bun/bin/dmai" 2>/dev/null || true
rm -f "$HOME/.local/bin/dmai" 2>/dev/null || true
rm -f "/usr/local/bin/dmai" 2>/dev/null || true
# 5. Remove installed DevMemory AI directory & global config registry
info "Removing DevMemory AI system directory (~/.devmemory-ai)..."
rm -rf "$HOME/.devmemory-ai" 2>/dev/null || true
info "Removing global configuration directory (~/.devmemory)..."
rm -rf "$HOME/.devmemory" 2>/dev/null || true
echo -e "\n${BOLD}${GREEN}"
echo "========================================================"
echo " [OK] DevMemory AI Successfully Uninstalled! "
echo "========================================================"
echo -e "${RESET}"