README / setup.sh
Compass79's picture
Add MCP integration, OAuth support, and comprehensive API endpoints
5849687
Raw History Blame Contribute Delete
2.06 kB
#!/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 ""