File size: 2,059 Bytes
5849687
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/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 ""