zeroclaw / workspace /setup_skills.sh
personalbotai
Move picoclaw_space to root for Hugging Face Spaces deployment
c1dcaaa
#!/bin/bash
# PicoClaw Skills Setup Script
# This script ensures all dependencies for enabled skills are installed.
echo "🦞 PicoClaw Skills Setup"
echo "========================"
WORKSPACE_DIR="$(dirname "$0")"
SKILLS_DIR="$WORKSPACE_DIR/skills"
echo "πŸ“ Skills Directory: $SKILLS_DIR"
# Helper function to check command existence
check_cmd() {
command -v "$1" >/dev/null 2>&1
}
# 1. Voice TTS (gTTS)
echo ""
echo "🎀 Checking Voice TTS dependencies..."
if check_cmd python3; then
if python3 -c "import gtts" >/dev/null 2>&1; then
echo "βœ… gTTS already installed."
else
echo "πŸ“¦ Installing gTTS..."
pip3 install gTTS
if [ $? -eq 0 ]; then
echo "βœ… gTTS installed successfully."
else
echo "❌ Failed to install gTTS. Voice skill may not work."
fi
fi
else
echo "❌ Python3 not found. Voice skill will be disabled."
fi
# 2. AI Research (jq, curl)
echo ""
echo "πŸ”¬ Checking AI Research dependencies..."
MISSING_AI=0
for cmd in jq curl grep sed; do
if ! check_cmd "$cmd"; then
echo "❌ Missing command: $cmd"
MISSING_AI=1
fi
done
if [ $MISSING_AI -eq 0 ]; then
echo "βœ… AI Research dependencies met."
else
echo "⚠️ Some AI Research dependencies are missing. Please install jq and curl."
fi
# 3. Diagrams (Mermaid CLI)
echo ""
echo "πŸ“Š Checking Diagrams dependencies..."
if check_cmd mmdc; then
echo "βœ… Mermaid CLI (mmdc) found."
else
echo "⚠️ Mermaid CLI (mmdc) not found."
if check_cmd npm; then
echo "πŸ“¦ Installing mermaid-cli globally (requires npm)..."
# npm install -g @mermaid-js/mermaid-cli
echo "ℹ️ Skipping auto-install for npm global packages to avoid permission issues."
echo " Run 'npm install -g @mermaid-js/mermaid-cli' manually if you need image generation."
else
echo "ℹ️ npm not found. Diagrams will be text-only."
fi
fi
# 4. Permissions (chmod +x)
echo ""
echo "πŸ” Setting permissions for skill scripts..."
find "$SKILLS_DIR" -name "*.sh" -exec chmod +x {} \;
find "$SKILLS_DIR" -name "*.py" -exec chmod +x {} \;
echo "βœ… Permissions set."
echo ""
echo "βœ… Setup complete! Your skills are ready to use."