@echo off REM Ensure GitHub CLI is installed where gh >nul 2>nul if %errorlevel% neq 0 ( echo Error: GitHub CLI ^(gh^) is not installed. Install it first: https://cli.github.com/ exit /b 1 ) REM Set repo name to current directory if not provided set "REPO_NAME=%~1" if "%REPO_NAME%"=="" ( for %%i in ("%cd%") do set "REPO_NAME=%%~nxi" ) REM Check if repo name is valid if "%REPO_NAME%"=="" ( echo Error: Unable to determine repository name. exit /b 1 ) REM Check if .git directory exists if not exist .git ( git init if %errorlevel% neq 0 ( exit /b 1 ) ) REM Create Initial Commit git add . if %errorlevel% neq 0 ( exit /b 1 ) git commit -m "Initial commit" if %errorlevel% neq 0 ( exit /b 1 ) REM Create GitHub Repository gh repo create "%REPO_NAME%" --public --source=. --remote=origin if %errorlevel% neq 0 ( exit /b 1 ) REM Push Changes git push -u origin main if %errorlevel% neq 0 ( exit /b 1 ) echo Repository "%REPO_NAME%" created and pushed successfully!