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

Level up your workflow with GitHub CLI

A guide on using GitHub CLI to manage a repository from the terminal

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.