#!/bin/bash # Recovery Compass MCP Hub Setup Script # This script helps you set up and configure the Recovery Compass Space set -e echo "๐Ÿงญ Recovery Compass MCP Hub Setup" echo "==================================" echo "" # Colors for output RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' # No Color # Check if Python is installed if ! command -v python3 &> /dev/null; then echo -e "${RED}Error: Python 3 is not installed${NC}" exit 1 fi echo -e "${GREEN}โœ“ Python 3 found${NC}" # Check if pip is installed if ! command -v pip3 &> /dev/null; then echo -e "${RED}Error: pip3 is not installed${NC}" exit 1 fi echo -e "${GREEN}โœ“ pip3 found${NC}" # Install dependencies echo "" echo "๐Ÿ“ฆ Installing dependencies..." pip3 install -r requirements.txt # Check if HF token is configured echo "" echo "๐Ÿ”‘ Checking Hugging Face authentication..." if python3 -c "from huggingface_hub import HfApi; HfApi().whoami()" 2>/dev/null; then echo -e "${GREEN}โœ“ Already authenticated with Hugging Face${NC}" else echo -e "${YELLOW}! Not authenticated. Run: python3 -c 'from huggingface_hub import login; login()'${NC}" fi # Create .env file if it doesn't exist if [ ! -f .env ]; then echo "" echo "๐Ÿ“ Creating .env file from template..." cp .env.example .env echo -e "${YELLOW}! Please edit .env file with your credentials${NC}" fi # Test the application echo "" echo "๐Ÿงช Testing application..." if python3 -c "import app; print('โœ“ App imports successfully')" 2>/dev/null; then echo -e "${GREEN}โœ“ Application is ready${NC}" else echo -e "${RED}โœ— Application import failed${NC}" exit 1 fi echo "" echo "==================================" echo -e "${GREEN}โœ… Setup complete!${NC}" echo "" echo "๐Ÿš€ Next steps:" echo "1. Edit .env file with your credentials" echo "2. Run locally: uvicorn app:app --host 0.0.0.0 --port 7860" echo "3. Or deploy to Hugging Face: git push" echo "" echo "๐Ÿ“š Documentation: https://huggingface.co/spaces/Recovery-Compass-79/README" echo ""