Using Github's CLI on Ubuntu & Commands.

Using Github's CLI on Ubuntu & Commands.

gh cli web

Working with GitHub has never been boring, as a matter of fact, it's the best part of the development process on my side. As usual, we use git and other distributed version control systems like Mercurial and many more.

I have been using the GitHub cli since February this year, and it is great. So let me show you how I got to use it. I'm on Ubuntu by the way. But I guess the process is the same on other OS, I'll check it out.

First, you download it on releases. Select the file with an extension based on your OS.

After download, follow normal procedures of installing an app on your environment/OS. Once the file is installed, BOOM! You are ready to interact with the gh cli.

There are no many configuration settings needed. The commands can be used anywhere regardless of the Operating System. The commands are as shown below:

General Activity

Commandusagedetailed usage
gh --versionview version of gh cli-

Working with repositories (repo)

Commandusagedetailed usage
gh repo viewview current repo on the browser (web)cli.github.com/manual/gh_repo_view
gh repo forkcreate a fork of a repocli.github.com/manual/gh_repo_fork
gh repo createcreate a new repocli.github.com/manual/gh_repo_create
gh repo cloneclone a repo locallycli.github.com/manual/gh_repo_clone

Working with Issues

Commandusagedetailed usage
gh issue viewview an issue of a repocli.github.com/manual/gh_issue_view
gh issue createcreate an issue locallycli.github.com/manual/gh_issue_create
gh issue statusdisplays the status of issues on the repocli.github.com/manual/gh_issue_status
gh issue listlists all issues raised on the repocli.github.com/manual/gh_issue_list

Working with pull requests (pr)

Commandusagedetailed usage
gh pr viewview pull requests in browsercli.github.com/manual/gh_pr_view
gh pr statuslists the statuses of available pull requestscli.github.com/manual/gh_pr_status
gh pr listlists all pull requests in the current repocli.github.com/manual/gh_pr_list
gh pr createcreate a pull requestcli.github.com/manual/gh_pr_create
gh pr checkoutcheck out a pull request in gitcli.github.com/manual/gh_pr_checkout

References

  1. installation instructions
  2. gh cli manual