Spaces:
Running
Running
# 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 | |