-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathuninstall.sh
More file actions
executable file
·123 lines (100 loc) · 3.2 KB
/
Copy pathuninstall.sh
File metadata and controls
executable file
·123 lines (100 loc) · 3.2 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
#!/usr/bin/env bash
set -euo pipefail
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CONFIG_FILE="${XDG_CONFIG_HOME:-$HOME/.config}/opencode/agentation.json"
BIN_DIR="$HOME/.local/bin"
print_step() { echo -e "\n${BLUE}==>${NC} ${1}"; }
print_success() { echo -e "${GREEN}✓${NC} ${1}"; }
print_warning() { echo -e "${YELLOW}!${NC} ${1}"; }
print_error() { echo -e "${RED}✗${NC} ${1}"; }
KEEP_PROJECT=false
usage() {
cat <<EOF
Usage: ./uninstall.sh [OPTIONS]
Options:
--keep-project Keep project folder (only remove symlinks and binaries)
-h, --help Show this help message
Note: This removes agentation.json only. Your opencode.json settings are untouched.
EOF
exit 0
}
while [[ $# -gt 0 ]]; do
case $1 in
--keep-project) KEEP_PROJECT=true; shift ;;
-h|--help) usage ;;
*) print_error "Unknown option: $1"; usage ;;
esac
done
echo -e "${RED}"
echo " _ _ _ _ _ _ "
echo " | | | |_ __ (_)_ __ ___| |_ __ _| | |"
echo " | | | | '_ \| | '_ \/ __| __/ _\` | | |"
echo " | |_| | | | | | | | \__ \ || (_| | | |"
echo " \___/|_| |_|_|_| |_|___/\__\__,_|_|_|"
echo -e "${NC}"
echo "Agentation Uninstaller"
echo ""
print_step "Removing wrapper scripts..."
if [[ -L "$BIN_DIR/agentation" ]]; then
rm -f "$BIN_DIR/agentation"
print_success "Removed: $BIN_DIR/agentation"
elif [[ -e "$BIN_DIR/agentation" ]]; then
rm -f "$BIN_DIR/agentation"
print_success "Removed: $BIN_DIR/agentation"
else
print_warning "Not found: $BIN_DIR/agentation"
fi
if [[ -e "$BIN_DIR/agentation.cmd" ]]; then
rm -f "$BIN_DIR/agentation.cmd"
print_success "Removed: $BIN_DIR/agentation.cmd"
fi
print_step "Removing downloaded binaries..."
if [[ -d "$SCRIPT_DIR/.opencode" ]]; then
rm -rf "$SCRIPT_DIR/.opencode"
print_success "Removed: $SCRIPT_DIR/.opencode"
else
print_warning "Not found: $SCRIPT_DIR/.opencode"
fi
print_step "Removing configuration..."
if [[ -f "$CONFIG_FILE" ]]; then
rm -f "$CONFIG_FILE"
print_success "Removed: $CONFIG_FILE"
else
print_warning "Not found: $CONFIG_FILE"
fi
print_step "Cleaning build artifacts..."
if [[ -d "$SCRIPT_DIR/node_modules" ]]; then
rm -rf "$SCRIPT_DIR/node_modules"
print_success "Removed: node_modules/"
fi
if [[ -d "$SCRIPT_DIR/packages/mcp-server/dist" ]]; then
rm -rf "$SCRIPT_DIR/packages/mcp-server/dist"
print_success "Removed: packages/mcp-server/dist/"
fi
if [[ -d "$SCRIPT_DIR/packages/shared/dist" ]]; then
rm -rf "$SCRIPT_DIR/packages/shared/dist"
print_success "Removed: packages/shared/dist/"
fi
rm -rf "$SCRIPT_DIR/.turbo" 2>/dev/null || true
echo ""
echo -e "${GREEN}============================================${NC}"
echo -e "${GREEN} Uninstall Complete!${NC}"
echo -e "${GREEN}============================================${NC}"
echo ""
echo -e "${YELLOW}Manual step:${NC} Remove Chrome Extension"
echo ""
echo " 1. Open chrome://extensions/"
echo " 2. Find 'Agentation'"
echo " 3. Click 'Remove'"
echo ""
if [[ "$KEEP_PROJECT" == false ]]; then
echo -e "${YELLOW}To completely remove:${NC}"
echo ""
echo " rm -rf $SCRIPT_DIR"
echo ""
fi