<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Anubhav sharma</title>
    <description>The latest articles on DEV Community by Anubhav sharma (@anubhvshrma18).</description>
    <link>https://dev.to/anubhvshrma18</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F491103%2F5989c9ca-79a5-4719-9891-e7b9bc797052.jpg</url>
      <title>DEV Community: Anubhav sharma</title>
      <link>https://dev.to/anubhvshrma18</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anubhvshrma18"/>
    <language>en</language>
    <item>
      <title>Github CLI -  official tool </title>
      <dc:creator>Anubhav sharma</dc:creator>
      <pubDate>Tue, 17 Nov 2020 13:02:45 +0000</pubDate>
      <link>https://dev.to/anubhvshrma18/github-cli-official-tool-47i3</link>
      <guid>https://dev.to/anubhvshrma18/github-cli-official-tool-47i3</guid>
      <description>&lt;p&gt;Github is the most amazing, powerful platform for developers, engineers, and even for organizations as well for serving as a home to millions of projects including open source and some personal projects as well.&lt;br&gt;
Being a terminal lover, working on the terminal is fascinating. &lt;a href="https://hub.github.com"&gt;Hub&lt;/a&gt; has been serving as an unofficial powerful CLI tool for GitHub and it has been mentioned on their website also. &lt;br&gt;
&lt;br&gt;&lt;br&gt;
But a few months ago, the company has decided to serve its purpose and came out with the official command-line tool &lt;a href="https://github.com/cli/cli"&gt;GitHub CLI&lt;/a&gt; so that you don't have to leave your terminal.&lt;/p&gt;

&lt;p&gt;The tool was in the beta stage until September. Then it has been released with its first version v1.0.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;The installation is very simple.&lt;br&gt;
&lt;br&gt;&lt;br&gt;
On macOS, it is available via brew&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install github/gh/gh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;br&gt;&lt;br&gt;
On Windows, it is available via three methods : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scoop
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  scoop bucket add github-gh https://github.com/cli/scoop-gh.git
  scoop install gh 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;WinGet
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;winget install gh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Chocolatey
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;choco install gh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;br&gt;&lt;br&gt;
On Linux, it is available via &lt;code&gt;brew&lt;/code&gt;. For more instructions, see the &lt;a href="https://github.com/cli/cli/blob/trunk/docs/install_linux.md"&gt;Linux installation docs&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Commands
&lt;/h2&gt;

&lt;p&gt;While hub already supports more commands, hub behaves as a proxy to Git and &lt;code&gt;gh&lt;/code&gt; is a standalone tool.&lt;/p&gt;

&lt;p&gt;All commands in the CLI start with &lt;code&gt;gh&lt;/code&gt;.&lt;br&gt;
I have stated several commands for pull requests and issues. For more commands, you can check upon this &lt;a href="https://cli.github.com/manual/"&gt;Manual&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Managing PULL REQUESTS
&lt;/h3&gt;

&lt;p&gt;For pull requests, we use &lt;code&gt;pr&lt;/code&gt; along with &lt;code&gt;gh&lt;/code&gt;. There are several subcommands for managing pull requests -&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;u&gt;list&lt;/u&gt;- this helps in listing the pull requests that have been made on the given repository.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr list [flags]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;u&gt;status&lt;/u&gt;- this tells us about the status of the active &lt;code&gt;pr&lt;/code&gt;, we can provide the info of the requests for which we want to check the status.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr status [flags]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;u&gt;view&lt;/u&gt;- this command is used to view the pull request, title, the code along with the pr, body, etc.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr view [&amp;lt;number&amp;gt; | &amp;lt;url&amp;gt; | &amp;lt;branch&amp;gt;] [flags]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;u&gt;create&lt;/u&gt;- as the word suggests, this command is used to create a pull request. You can use different flags like title body etc. to &lt;code&gt;pr&lt;/code&gt;, just go and check the manual for flags.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr create [flags]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;u&gt;checkout&lt;/u&gt;- this command is used to check out a pull request using the pull request number or URL if you have it.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr checkout {&amp;lt;number&amp;gt; | &amp;lt;url&amp;gt; | &amp;lt;branch&amp;gt;} [flags]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;u&gt;close&lt;/u&gt;- this command closes the pull request provided the pull request number, URL which you want to close.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh pr close [&amp;lt;number&amp;gt; | &amp;lt;url&amp;gt; | &amp;lt;branch&amp;gt;] [flags]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more commands related to managing the Pull requests, you can check out &lt;a href="https://cli.github.com/manual/"&gt;this&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The [flags] part generally represents the parameters values you want to provide with the command. You can check the manual for that.&lt;/p&gt;

&lt;h3&gt;
  
  
  ISSUES
&lt;/h3&gt;

&lt;p&gt;We use the &lt;code&gt;issue&lt;/code&gt; command with &lt;code&gt;gh&lt;/code&gt; to deal with issues on GitHub.There are several commands that are used with issue command -&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;u&gt;create&lt;/u&gt;- you can use the below command to create an issue.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh issue create [flags]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;u&gt;list&lt;/u&gt;- it lists out all the issues that are currently present in the repository.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh issue list [flags]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;u&gt;status&lt;/u&gt;- check the status of the issue, whether it is closed or open
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh issue status [flags]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;u&gt;view&lt;/u&gt;- it outputs the information about the issue provided by the number or URL of the issue.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh issue view {&amp;lt;number&amp;gt; | &amp;lt;url&amp;gt;} [flags]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;u&gt;close&lt;/u&gt;- it closes the issue.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh issue close {&amp;lt;number&amp;gt; | &amp;lt;url&amp;gt;} [flags]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;NOTE&lt;/strong&gt;- &lt;strong&gt;Just don't get confused with the flags part, I have provided the link for the manual above. Go and check out and add flags as per your need&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>programming</category>
      <category>terminal</category>
    </item>
  </channel>
</rss>
