forked from nicobailon/visual-explainer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-pi.sh
More file actions
executable file
·49 lines (41 loc) · 1.32 KB
/
install-pi.sh
File metadata and controls
executable file
·49 lines (41 loc) · 1.32 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
#!/bin/bash
# install-pi.sh - Install visual-explainer for Pi
set -e
SKILL_DIR="$HOME/.pi/agent/skills/visual-explainer"
PROMPTS_DIR="$HOME/.pi/agent/prompts"
# Check if we're in the repo or need to clone
if [ ! -f "plugins/visual-explainer/SKILL.md" ]; then
echo "Cloning visual-explainer..."
TEMP_DIR=$(mktemp -d)
git clone --depth 1 https://github.com/nicobailon/visual-explainer.git "$TEMP_DIR"
cd "$TEMP_DIR"
CLEANUP=true
else
CLEANUP=false
fi
# Copy skill
echo "Installing skill to $SKILL_DIR..."
rm -rf "$SKILL_DIR"
cp -r plugins/visual-explainer "$SKILL_DIR"
# Replace {{skill_dir}} with actual path
echo "Patching paths..."
if [[ "$OSTYPE" == "darwin"* ]]; then
find "$SKILL_DIR" -name "*.md" -exec sed -i '' "s|{{skill_dir}}|$SKILL_DIR|g" {} \;
else
find "$SKILL_DIR" -name "*.md" -exec sed -i "s|{{skill_dir}}|$SKILL_DIR|g" {} \;
fi
# Copy prompts (slash commands)
echo "Installing prompts to $PROMPTS_DIR..."
mkdir -p "$PROMPTS_DIR"
cp "$SKILL_DIR/commands/"*.md "$PROMPTS_DIR/"
# Cleanup if we cloned
if [ "$CLEANUP" = true ]; then
rm -rf "$TEMP_DIR"
fi
echo ""
echo "Done! Restart pi to use visual-explainer."
echo ""
echo "Commands available:"
echo " /diff-review, /plan-review, /project-recap, /fact-check"
echo " /generate-web-diagram, /generate-slides, /generate-visual-plan"
echo " /share"