DEV Community

Cover image for Github CLI 1.0
Mahesh Sv
Mahesh Sv

Posted on • Originally published at Medium on

Github CLI 1.0

GitHub is like a Bank to Developer, Where you can store all important code in it and use it whenever and wherever. You might as well know that it offers the distributed version control and source code management functionality of Git.

GitHub CLI is Terminal Interface. Where you can interact with your code on GitHub right from Terminal. This saves few clicks and makes Developer focus less distracted.

So, GitHub launched GitHub CLI. I want to be clear here GitHub CLI is not replacement of Git. GitHub just bringing their services to your Terminal.

You might say that “Hey, Mahesh! I’m already doing everything on terminal”. Of course, you do but GitHub CLI makes that experience now more feasible and flawless. For example, now you can create or resolve issues raised in your GitHub right from your terminal.

They calling it as gh. You need to start command line with starting gh.

Installation:

GitHub CLI is available on Windows, mac OS, Linux

Windows :

  • You can download directly from Link here
  • Download it and Open the file you downloaded.
  • Installation Done

mac OS :

  • gh is available via Homebrew and MacPorts.

Via brew

  • brew install gh - Install
  • brew upgrade gh - Upgrade

Via MacPorts

  • sudo port install gh - Install
  • sudo port selfupdate && sudo port upgrade gh - Upgrade

Linux :

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
sudo apt-add-repository <https://cli.github.com/packages>
sudo apt update
sudo apt install gh

So Installation Done, Next step is..

Authentication

We need to authentication GitHub CLI with GitHub Server

gh auth login - for logging in

Basic Commands to get Started with GitHub CLI:-

gh repo clone @username/@reponame - to clone a Public Repo

gh pr create - to create a Pull Requests

gh pr diff - to view difference Pull Request and Master

gh pr merge - to merge a Pull Request

gh pr checks - to check all test cases are passing

gh issue status - to know opened issues for you

If you’re Open source contributor and want to Contribute to GitHub CLI. Contribute here 👉🏻 cli/cli

This is it. Hope this post is helpful to you!

You can check out my recent post on How to Secure API token and more


Thanks for Reading, This is Mahesh Sv(MaheshtheDev) signing off.

Top comments (0)