Day 2: GitHub CLI (gh) = Power Moves
Created by: Deep Ghinaiya
Software Developer
linkedin.com/in/deep-ghinaiya
What Is It?
The GitHub CLI (gh) is a powerful command-line tool that lets you interact with GitHub directly
from your terminal.
No need to switch to the browser — you can create issues, pull requests, clone repos, and even
review code — all via commands.
This tool is a must-have for developers who want speed, control, and automation while
working with GitHub.
Why It’s Useful
• Speeds up common GitHub tasks without leaving your terminal
• Ideal for power users and automation workflows
• Great for scripting GitHub operations
• Clean UI and works seamlessly with Git & GitHub
How to Set It Up (Step-by-Step)
Step 1: Install GitHub CLI
Based on your OS:
• Windows:
Download from https://cli.github.com/
Or use:
• winget install --id GitHub.cli
• macOS:
• brew install gh
• Linux (Debian/Ubuntu):
• sudo apt install gh
For other systems, follow: https://cli.github.com/manual/installation
Step 2: Authenticate with GitHub
After installation, run:
gh auth login
• Select GitHub.com
• Choose HTTPS (recommended)
• Authenticate via web or token
• Once authenticated, you're ready to go!
Useful Commands
Action Command
Clone a repo gh repo clone owner/repo-name
Create a new repo gh repo create
View issues gh issue list
Create an issue gh issue create
View pull requests gh pr list
Action Command
Create a pull request gh pr create
Checkout a PR gh pr checkout <number>
Open repo in browser gh repo view --web
Example Usage
# Clone a repo
gh repo clone Ghinaiya-Deep/GitHub-Dev-Series-15-Days-of-Tips-Tricks
# Create a new issue
gh issue create --title "Fix README typo" --body "There's a small typo on line 3"
# View all pull requests
gh pr list
Pro Tips
• Combine with git to become a GitHub ninja
• Use it in CI/CD scripts and shell automation
• Great for managing projects, teams, and contributions without the web UI
Resources to Explore
• GitHub CLI Manual: https://cli.github.com/manual/
• GitHub CLI Repo: https://github.com/cli/cli
Final Thought
"The GitHub CLI isn’t just a tool — it’s your terminal superpower. Code faster. Collaborate
smarter."