Control your Github from the command line with the Github CLI
Kavin Desi Valli
Posted on July 23, 2021
Want to create a repository, but don't want to go to Github and follow that manual and perhaps long process, every single time.
Use the Official Github CLI. It can do a lot of stuff ranging from creating a repo to closing a PR. I have written down some important commands in this blog post. (Have also linked the docs for the commands)
Login
First, to use some of the commands listed below, you will have to authenticate the CLI by running
gh auth login
Creating a repository
This is probably the command I use the most
gh repo create repo_name
List repositories of a user
gh repo list username
View Repository in web
View any repository in web
gh repo view owner/repo_name --web
View the repository you're currently in (cloned repository)
gh repo view --web
Aliases
List Aliases
gh alias list
Set Alias
gh alias set <alias> <expansion>
Delete Alias
gh alias delete <alias>
These are my most used commands but there are a lot more which can be found on the Github CLI Docs. And most of these commands listed above can also be used with some flags which are listed in the documentations.
Posted on July 23, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.