-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
96 lines (82 loc) · 2.19 KB
/
install.sh
File metadata and controls
96 lines (82 loc) · 2.19 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
#!/bin/bash
# ShowMe Installation Script
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CLAUDE_SETTINGS_DIR="$HOME/.claude"
CLAUDE_SETTINGS_FILE="$CLAUDE_SETTINGS_DIR/settings.json"
echo "Installing ShowMe..."
# Check for Bun
if ! command -v bun &> /dev/null; then
echo "Error: Bun is required. Install it from https://bun.sh"
exit 1
fi
# Install dependencies
echo "Installing dependencies..."
cd "$SCRIPT_DIR"
bun install
# Build the UI
echo "Building UI..."
bun run build
# Create Claude settings directory if it doesn't exist
mkdir -p "$CLAUDE_SETTINGS_DIR"
# Create or update settings.json
if [ -f "$CLAUDE_SETTINGS_FILE" ]; then
# Check if hooks already exist
if grep -q '"hooks"' "$CLAUDE_SETTINGS_FILE"; then
echo "Note: Claude settings already has hooks configured."
echo "Please manually add the ShowMe hook to your settings.json"
echo ""
echo "Add this to your hooks configuration:"
cat << EOF
{
"hooks": {
"PreToolUse": [
{
"matcher": "Skill",
"hooks": [
{
"type": "command",
"command": "bun run $SCRIPT_DIR/server/index.ts",
"timeout": 300000
}
]
}
]
}
}
EOF
fi
else
# Create new settings file
cat > "$CLAUDE_SETTINGS_FILE" << EOF
{
"hooks": {
"PreToolUse": [
{
"matcher": "Skill",
"hooks": [
{
"type": "command",
"command": "bun run $SCRIPT_DIR/server/index.ts",
"timeout": 300000
}
]
}
]
}
}
EOF
echo "Created Claude settings with ShowMe hook."
fi
# Create skill directory in Claude skills directory
SKILLS_DIR="$CLAUDE_SETTINGS_DIR/skills/showme"
mkdir -p "$SKILLS_DIR"
# Copy skill file as SKILL.md (Claude Code convention)
cp "$SCRIPT_DIR/skills/showme.md" "$SKILLS_DIR/SKILL.md"
# Update the server path in SKILL.md to use absolute path
sed -i "s|bun run .*/server/index.ts|bun run $SCRIPT_DIR/server/index.ts|g" "$SKILLS_DIR/SKILL.md"
echo "Installed /showme skill to $SKILLS_DIR/SKILL.md"
echo ""
echo "ShowMe installed successfully!"
echo ""
echo "Usage: Type /showme in Claude Code to open the visual canvas."