#!/bin/bash # Check deployment status on Hugging Face Spaces echo "📊 Checking Hugging Face Space status..." echo "" # Check if hf remote exists if ! git remote | grep -q "hf"; then echo "❌ No 'hf' remote found. Deploy first with: make deploy" exit 1 fi # Get the remote URL HF_URL=$(git remote get-url hf) echo "🔗 Space URL: $HF_URL" echo "" # Extract space name from URL SPACE_NAME=$(echo "$HF_URL" | sed 's|https://huggingface.co/spaces/||') echo "📍 Space: $SPACE_NAME" echo "" # Check if huggingface-cli is installed if ! command -v huggingface-cli &> /dev/null; then echo "⚠️ huggingface-cli not found. Install with: pip install huggingface-hub" echo "" echo "You can check your Space status manually at:" echo "$HF_URL" exit 0 fi echo "Fetching Space information..." echo "" # Try to get space info (this will fail if not logged in or space doesn't exist) if huggingface-cli repo info --repo-type space "$SPACE_NAME" 2>/dev/null; then echo "" echo "✅ Space is accessible!" else echo "⚠️ Could not fetch Space info. This might mean:" echo " - You're not logged in (run: huggingface-cli login)" echo " - The Space doesn't exist yet" echo " - You don't have access to this Space" fi echo "" echo "🌐 View your Space at: $HF_URL"