Logo
BlogDashboardAboutProjects
Logo
HomeBlogDashboardAboutProjects
GithubGithub
LinkedinLinkedin
TwitterTwitter
v1.12.1
—
24 Oct 2025
·
3 min read

How I use GitHub CLI day-to-day

I keep most of my work inside the terminal. Here's how I use gh to create repos, track issues, and merge pull requests without touching the GitHub website.

Introduction

When starting a new project, I prefer to keep everything inside the terminal.
With GitHub CLI (gh), I can create repositories, manage issues, and handle pull requests — all without touching the GitHub website.

Here’s how I use gh commands in my day-to-day work.


⚡ Quick Reference

TaskCommand
Log in to GitHubgh auth login
Check login statusgh auth status
Create a new repo in current foldergh repo create
List open issuesgh issue list
Create an issuegh issue create
Develop an issue locallygh issue develop <issue-number> -c
Create a pull requestgh pr create
Merge a pull requestgh pr merge <number>

Setup / Installation

If you haven’t installed GitHub CLI yet, follow the official setup guide here:
👉 Install GitHub CLI


Authentication

Start by logging in:

gh auth login

You can choose SSH or HTTPS for authentication.
To check your current status:

gh auth status

And to sign out:

gh auth logout

Creating a New Repository

When creating a new Next.js project, I use:

pnpm create next-app@latest my-project
cd my-project

Then, inside the project directory:

gh repo create

GitHub CLI automatically detects the current folder and guides you through an interactive setup — such as choosing visibility and initial settings.
Once complete, your project is linked to a new GitHub repository instantly.


Listing Repositories

You can view your repositories directly in the terminal:

gh repo list

Add options like --limit 10 to show only a few results.


Managing Issues

You can check, view, and create issues without leaving your terminal.

PurposeCommandExample
List open issuesgh issue listgh issue list --label enhancement
View issue detailsgh issue view <number>gh issue view 27 --web
Create a new issuegh issue creategh issue create
Develop an issue locallygh issue develop <issue-number> -cgh issue develop 42 -c

The develop command lets you spin up a new branch and start working on an issue immediately.
The -c flag automatically checks out that branch after it’s created — great for jumping straight into development.


Pull Requests

Creating and managing pull requests is seamless with GitHub CLI.

PurposeCommandExample
List pull requestsgh pr listgh pr list --state open
View a pull requestgh pr view <number>gh pr view 12 --web
Create a new pull requestgh pr creategh pr create
Checkout a pull request locallygh pr checkout <number>gh pr checkout 12
Merge a pull requestgh pr merge <number>gh pr merge 12 --squash
Close a pull request without merginggh pr close <number>gh pr close 12

Exploring Commands

If you’re not sure what’s available, explore with:

gh help

Or view details for specific sections:

gh repo --help
gh pr --help

Conclusion

GitHub CLI keeps your workflow smooth and focused.
From creating new repositories to managing issues and pull requests, it lets you stay entirely within the terminal — no browser required.

Related Articles

26 Dec 2022
3 tags
Different Git identities for personal and work projects
I kept committing with my personal email on work projects. Git's includeIf directive fixes this by loading a different config based on which directory you're in. No manual switching.
26 Feb 2023
2 tags
Setting 'main' as your default Git branch
GitHub switched the default branch name from master to main in 2020. One line in your global git config means you never have to set it manually on a new repo again.
21 Apr 2026
2 tags
Per-project shell environments with direnv
Loading the right environment variables when I cd into a project used to mean sourcing .env files by hand or leaking secrets into my global shell. direnv fixes both by loading a per-directory shell environment, and unloading it the moment I leave.
29 Mar 2023
1 tag
Feature flags: ship code without shipping features
A feature flag is an if/else around a piece of code, controlled by an environment variable. It lets you merge and deploy work-in-progress without turning it on. Fewer conflicts, safer releases.