Creating GitHub Repositories from CLI
Picture this: You’ve just built a small app and want to share it with the world. Let’s learn how to create a GitHub repository straight from your terminal.
Prerequisites
# Install GitHub CLI# macOSbrew install gh
# Windowswinget install GitHub.cliQuick Setup
Navigate to your project:
cd ~/projects/weather-dashboardInitialize Git:
git initgit add .git commit -m "First forecast: Initial commit"Authenticate with GitHub:
gh auth loginCreate and push your repository:
gh repo create weather-wizard --public --source=. --pushCommand Breakdown
Let’s analyze that last command:
weather-wizard: Repository name--public: Makes it visible to everyone--source=.: Uses current directory--push: Uploads files automatically
Advanced Options
Add metadata:
gh repo create climate-tracker \  --description "Real-time weather monitoring dashboard" \  --homepage "https://weather-app.example.com" \  --public --source=. --pushCreate with license:
gh repo create forecast-pro --license "mit" --public --source=. --pushTroubleshooting
Common issues:
- Repository names must use hyphens instead of spaces
 - For private repos, swap 
--publicwith--private - Conflicts? Use 
--remote-name origin 
Final Thoughts
GitHub CLI transforms repository creation into a streamlined process. No more context switching between terminal and browser - just efficient, focused development.
Written for folks who value their time