Spaces:
Sleeping
Sleeping
| # 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." | |