Spaces:
Sleeping
Sleeping
Download setup.sh from Recovery-Compass-79/README: direct link, hf CLI and curl.
- Browser
- Download file 2.06 kB
-
https://huggingface.co/spaces/Recovery-Compass-79/README/resolve/main/setup.sh
- Command line
-
hf download hf://spaces/Recovery-Compass-79/README/setup.sh
-
curl -L -o setup.sh https://huggingface.co/spaces/Recovery-Compass-79/README/resolve/main/setup.sh
2.06 kB
| # 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 "" | |