#!/bin/bash
# Automated GitHub Repository Setup Script
# This script will create and push the MCP Home Assistant server to GitHub
echo "========================================"
echo "Home Assistant MCP Server - GitHub Setup"
echo "========================================"
echo
# Check if git is installed
if ! command -v git &> /dev/null; then
echo "ERROR: Git is not installed"
echo "Please install Git from https://git-scm.com/"
exit 1
fi
# Check if gh CLI is installed
if ! command -v gh &> /dev/null; then
echo "WARNING: GitHub CLI is not installed"
echo
echo "Install with:"
echo " macOS: brew install gh"
echo " Linux: See https://github.com/cli/cli#installation"
echo
echo "Or follow manual setup instructions in GITHUB_SETUP_GUIDE.md"
echo
exit 1
fi
# Check if already initialized
if [ -d .git ]; then
echo "Git repository already initialized"
else
echo "Initializing git repository..."
git init
fi
echo
echo "Adding files to git..."
git add .
echo
echo "Creating initial commit..."
git commit -m "Initial commit: Home Assistant MCP server with 13 tools for smart home control" \
-m "Features:" \
-m "- Entity state management and discovery" \
-m "- Service calls for device control" \
-m "- Historical data retrieval" \
-m "- Full automation management (create, update, delete, enable, disable)" \
-m "- 13 tools total for comprehensive Home Assistant integration"
echo
echo "Creating GitHub repository..."
gh repo create mcp-homeassistant --public --source=. --remote=origin --push
echo
echo "Setting repository description..."
gh repo edit --description "Model Context Protocol (MCP) server for Home Assistant integration - enables AI assistants to control smart home devices, manage automations, and query entity states"
echo
echo "Adding topics..."
gh repo edit --add-topic home-assistant --add-topic mcp --add-topic python --add-topic smart-home --add-topic ai --add-topic claude
echo
echo "========================================"
echo "SUCCESS! Repository created and pushed!"
echo "========================================"
echo
echo "View repository:"
gh repo view --web