-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·286 lines (244 loc) · 7.79 KB
/
install.sh
File metadata and controls
executable file
·286 lines (244 loc) · 7.79 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
#!/bin/bash
# Claude Arsenal Installer
# https://github.com/majiayu000/claude-arsenal
set -e
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Config
REPO_URL="https://github.com/majiayu000/claude-arsenal.git"
CLAUDE_DIR="$HOME/.claude"
SKILLS_DIR="$CLAUDE_DIR/skills"
INSTALL_DIR="$HOME/.claude-arsenal"
# Print banner
print_banner() {
echo -e "${BLUE}"
echo "╔═══════════════════════════════════════════════════════════╗"
echo "║ ║"
echo "║ Claude Arsenal Installer ║"
echo "║ 52 Skills | 7 Agents | Production Ready ║"
echo "║ ║"
echo "╚═══════════════════════════════════════════════════════════╝"
echo -e "${NC}"
}
# Print colored message
info() { echo -e "${BLUE}[INFO]${NC} $1"; }
success() { echo -e "${GREEN}[SUCCESS]${NC} $1"; }
warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
error() { echo -e "${RED}[ERROR]${NC} $1"; exit 1; }
# Check prerequisites
check_prerequisites() {
info "Checking prerequisites..."
if ! command -v git &> /dev/null; then
error "Git is not installed. Please install git first."
fi
success "Prerequisites check passed"
}
# Clone or update repository
setup_repo() {
info "Setting up Claude Arsenal repository..."
if [ -d "$INSTALL_DIR" ]; then
info "Updating existing installation..."
cd "$INSTALL_DIR"
git pull --quiet
else
info "Cloning repository..."
git clone --quiet "$REPO_URL" "$INSTALL_DIR"
fi
success "Repository ready at $INSTALL_DIR"
}
# Create claude directories
setup_directories() {
info "Setting up Claude directories..."
mkdir -p "$SKILLS_DIR"
mkdir -p "$CLAUDE_DIR/agents"
success "Directories created"
}
# Install all skills
install_all_skills() {
info "Installing all skills..."
local count=0
# Install directory-based skills
for skill_dir in "$INSTALL_DIR/skills"/*/; do
if [ -d "$skill_dir" ]; then
skill_name=$(basename "$skill_dir")
ln -sfn "$skill_dir" "$SKILLS_DIR/$skill_name"
((count++))
fi
done
# Install file-based skills (.SKILL.md files)
for skill_file in "$INSTALL_DIR/skills"/*.SKILL.md; do
if [ -f "$skill_file" ]; then
skill_name=$(basename "$skill_file" .SKILL.md)
mkdir -p "$SKILLS_DIR/$skill_name"
ln -sfn "$skill_file" "$SKILLS_DIR/$skill_name/SKILL.md"
((count++))
fi
done
success "Installed $count skills"
}
# Install specific skills
install_skills() {
local skills_list="$1"
info "Installing selected skills: $skills_list"
IFS=',' read -ra SKILLS <<< "$skills_list"
local count=0
for skill in "${SKILLS[@]}"; do
skill=$(echo "$skill" | xargs) # trim whitespace
# Check if directory-based skill
if [ -d "$INSTALL_DIR/skills/$skill" ]; then
ln -sfn "$INSTALL_DIR/skills/$skill" "$SKILLS_DIR/$skill"
((count++))
info " ✓ $skill"
# Check if file-based skill
elif [ -f "$INSTALL_DIR/skills/$skill.SKILL.md" ]; then
mkdir -p "$SKILLS_DIR/$skill"
ln -sfn "$INSTALL_DIR/skills/$skill.SKILL.md" "$SKILLS_DIR/$skill/SKILL.md"
((count++))
info " ✓ $skill"
else
warn " ✗ $skill (not found)"
fi
done
success "Installed $count skills"
}
# Install all agents
install_agents() {
info "Installing agents..."
local count=0
for agent_file in "$INSTALL_DIR/agents"/*.md; do
if [ -f "$agent_file" ]; then
agent_name=$(basename "$agent_file")
ln -sfn "$agent_file" "$CLAUDE_DIR/agents/$agent_name"
((count++))
fi
done
success "Installed $count agents"
}
# List available skills
list_skills() {
echo -e "\n${BLUE}Available Skills:${NC}\n"
echo "Directory-based skills:"
for skill_dir in "$INSTALL_DIR/skills"/*/; do
if [ -d "$skill_dir" ]; then
echo " - $(basename "$skill_dir")"
fi
done
echo -e "\nFile-based skills:"
for skill_file in "$INSTALL_DIR/skills"/*.SKILL.md; do
if [ -f "$skill_file" ]; then
echo " - $(basename "$skill_file" .SKILL.md)"
fi
done
}
# Uninstall
uninstall() {
warn "Uninstalling Claude Arsenal..."
# Remove skill symlinks
for skill_dir in "$SKILLS_DIR"/*/; do
if [ -L "$skill_dir" ] || [ -L "${skill_dir%/}" ]; then
target=$(readlink -f "$skill_dir" 2>/dev/null || readlink "$skill_dir" 2>/dev/null)
if [[ "$target" == *"claude-arsenal"* ]]; then
rm -f "$skill_dir"
fi
fi
done
# Remove agent symlinks
for agent_file in "$CLAUDE_DIR/agents"/*.md; do
if [ -L "$agent_file" ]; then
target=$(readlink -f "$agent_file" 2>/dev/null || readlink "$agent_file" 2>/dev/null)
if [[ "$target" == *"claude-arsenal"* ]]; then
rm -f "$agent_file"
fi
fi
done
# Remove installation directory
rm -rf "$INSTALL_DIR"
success "Claude Arsenal uninstalled"
}
# Print usage
usage() {
echo "Usage: $0 [OPTIONS]"
echo ""
echo "Options:"
echo " --all Install all skills and agents"
echo " --skills SKILL_LIST Install specific skills (comma-separated)"
echo " --agents Install only agents"
echo " --list List available skills"
echo " --uninstall Remove Claude Arsenal"
echo " --help Show this help message"
echo ""
echo "Examples:"
echo " $0 --all"
echo " $0 --skills typescript-project,python-project,devops-excellence"
echo " $0 --list"
}
# Main
main() {
print_banner
# Parse arguments
if [ $# -eq 0 ]; then
# Default: install all
check_prerequisites
setup_repo
setup_directories
install_all_skills
install_agents
else
case "$1" in
--all)
check_prerequisites
setup_repo
setup_directories
install_all_skills
install_agents
;;
--skills)
if [ -z "$2" ]; then
error "Please provide a comma-separated list of skills"
fi
check_prerequisites
setup_repo
setup_directories
install_skills "$2"
;;
--agents)
check_prerequisites
setup_repo
setup_directories
install_agents
;;
--list)
setup_repo
list_skills
exit 0
;;
--uninstall)
uninstall
exit 0
;;
--help|-h)
usage
exit 0
;;
*)
error "Unknown option: $1\nRun '$0 --help' for usage."
;;
esac
fi
echo ""
success "Installation complete!"
echo ""
info "Next steps:"
echo " 1. Open Claude Code"
echo " 2. Type '/' to see your installed skills"
echo " 3. Start using skills like /typescript-project"
echo ""
info "Installation directory: $INSTALL_DIR"
info "Skills directory: $SKILLS_DIR"
echo ""
}
main "$@"