Spaces:
Running
Running
File size: 2,176 Bytes
565a26a |
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 |
#!/bin/bash
# A1D MCP Server - Push to Hugging Face Space
# Usage: ./push_to_space.sh
echo "π A1D MCP Server - Pushing to Hugging Face Space"
echo "=================================================="
# Check if we're in the right directory
if [ ! -f "app.py" ]; then
echo "β Error: app.py not found. Please run this script from the project root directory."
exit 1
fi
# Check if git is initialized
if [ ! -d ".git" ]; then
echo "β Error: Git repository not initialized. Please run 'git init' first."
exit 1
fi
echo "π Current git status:"
git status
echo ""
echo "π§ Preparing to push to Hugging Face Space..."
echo "Space URL: https://huggingface.co/spaces/aigchacker/a1d-mcp-server"
# Check if remote is set
if ! git remote get-url origin > /dev/null 2>&1; then
echo "π‘ Adding remote origin..."
git remote add origin https://huggingface.co/spaces/aigchacker/a1d-mcp-server
else
echo "β
Remote origin already set"
fi
echo ""
echo "π Authentication Required:"
echo "1. Go to: https://huggingface.co/settings/tokens"
echo "2. Create a new token with 'Write' permissions"
echo "3. When prompted, enter your Hugging Face username and token as password"
echo ""
echo "π Pushing to Space..."
echo "Note: You'll be prompted for your Hugging Face credentials"
# Push to main branch
git push -u origin main
if [ $? -eq 0 ]; then
echo ""
echo "π Successfully pushed to Hugging Face Space!"
echo "π± Your Space will be available at:"
echo " https://huggingface.co/spaces/aigchacker/a1d-mcp-server"
echo ""
echo "β οΈ Don't forget to set the A1D_API_KEY environment variable in your Space settings!"
echo " 1. Go to your Space settings"
echo " 2. Add environment variable: A1D_API_KEY = your_api_key"
echo " 3. Set it as 'Secret' for security"
echo " 4. Restart the Space"
else
echo ""
echo "β Push failed. Please check your credentials and try again."
echo ""
echo "π§ Troubleshooting:"
echo " - Make sure you have a valid Hugging Face token"
echo " - Check your internet connection"
echo " - Verify the Space URL is correct"
fi
|