-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·100 lines (87 loc) · 2.75 KB
/
install.sh
File metadata and controls
executable file
·100 lines (87 loc) · 2.75 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
#!/bin/bash
# Samocode installation script
# Creates symlinks for skills and commands in ~/.claude/
set -e
SAMOCODE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CLAUDE_DIR="$HOME/.claude"
echo "Installing samocode from: $SAMOCODE_DIR"
echo "Target: $CLAUDE_DIR"
echo ""
# Create skills symlinks
echo "Installing skills..."
for skill in "$SAMOCODE_DIR/skills/"*/; do
skill_name=$(basename "$skill")
target="$CLAUDE_DIR/skills/$skill_name"
if [ -L "$target" ]; then
echo " Updating: $skill_name"
rm "$target"
elif [ -d "$target" ]; then
echo " Warning: $skill_name exists and is not a symlink, skipping"
continue
else
echo " Installing: $skill_name"
fi
ln -s "$skill" "$target"
done
# Create agents symlinks
echo ""
echo "Installing agents..."
mkdir -p "$CLAUDE_DIR/agents"
for agent in "$SAMOCODE_DIR/agents/"*.md; do
[ -f "$agent" ] || continue # Skip if no matches
agent_name=$(basename "$agent")
target="$CLAUDE_DIR/agents/$agent_name"
if [ -L "$target" ]; then
echo " Updating: $agent_name"
rm "$target"
elif [ -f "$target" ]; then
echo " Warning: $agent_name exists and is not a symlink, skipping"
continue
else
echo " Installing: $agent_name"
fi
ln -s "$agent" "$target"
done
# Create commands symlinks
echo ""
echo "Installing commands..."
for cmd in "$SAMOCODE_DIR/commands/"*.md; do
cmd_name=$(basename "$cmd")
target="$CLAUDE_DIR/commands/$cmd_name"
if [ -L "$target" ]; then
echo " Updating: $cmd_name"
rm "$target"
elif [ -f "$target" ]; then
echo " Warning: $cmd_name exists and is not a symlink, skipping"
continue
else
echo " Installing: $cmd_name"
fi
ln -s "$cmd" "$target"
done
echo ""
echo "Installation complete!"
echo ""
SKILL_COUNT=$(ls -d "$SAMOCODE_DIR/skills/"*/ 2>/dev/null | wc -l | tr -d ' ')
AGENT_COUNT=$(ls "$SAMOCODE_DIR/agents/"*.md 2>/dev/null | wc -l | tr -d ' ')
CMD_COUNT=$(ls "$SAMOCODE_DIR/commands/"*.md 2>/dev/null | wc -l | tr -d ' ')
echo "Installed:"
echo " - $SKILL_COUNT skills"
echo " - $AGENT_COUNT agents"
echo " - $CMD_COUNT commands"
echo ""
echo "============================================================"
echo "IMPORTANT: Project Setup Required"
echo "============================================================"
echo ""
echo "For each project where you use samocode, create a .samocode file:"
echo ""
echo " MAIN_REPO=~/your-project/repo"
echo " WORKTREES=~/your-project/worktrees/"
echo " SESSIONS=~/your-project/_sessions/"
echo ""
echo "Without this file, samocode will refuse to run."
echo ""
echo "============================================================"
echo ""
echo "Restart Claude Code to apply changes."