UNPKG

73.3 kBMarkdownView Raw
1<h1 align="center">Node GH</h1>
2
3<p align="center">
4 <a href="#contributors" alt="All Contributors Badge">
5 <img src="https://img.shields.io/badge/all_contributors-88-orange.svg?style=flat-square" />
6 </a>
7 <a href="http://npmjs.org/gh" alt="NPM version Badge">
8 <img src="http://img.shields.io/npm/v/gh.svg?style=flat" />
9 </a>
10 <a href="https://travis-ci.org/node-gh/gh" alt="Build Status Badge">
11 <img src="http://img.shields.io/travis/node-gh/gh/master.svg?style=flat" />
12 </a>
13 <a href="https://snyk.io/test/github/node-gh/gh" alt="Known Vulnerabilities Badge">
14 <img src="https://snyk.io/test/github/node-gh/gh/badge.svg" />
15 </a>
16 <a href="https://github.com/semantic-release/semantic-release" alt="Semantic Release Badge">
17 <img src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg" />
18 </a>
19 <a href="https://lgtm.com/projects/g/node-gh/gh/context:javascript" alt="LGTM Grade Badge">
20 <img src="https://img.shields.io/lgtm/grade/javascript/g/node-gh/gh.svg?logo=lgtm&logoWidth=18" />
21 </a>
22 <a href="https://lgtm.com/projects/g/node-gh/gh/alerts" alt="LGTM Total Alerts Badge">
23 <img src="https://img.shields.io/lgtm/alerts/g/node-gh/gh.svg?logo=lgtm&logoWidth=18" />
24 </a>
25</p>
26
27> Boost your productivity & automate tasks when working with GitHub, all from the comfort of your CLI.
28
29## Table of contents
30
31[Contributors](#contributors)
32
33<details><summary>Getting Started</summary>
34
35- [Install](#install)
36- [Usage](#usage)
37- [Config](#config)
38- [Plugins](#plugins)
39- [Contributing](#contributing)
40 </details>
41
42<details><summary>Available Commands</summary><br/>
43
44<details><summary>Pull Requests `pr`</summary>
45
46- [`--info` - Get information about a pull request](#pr-info)
47- [`--list` - List pull requests](#pr-list)
48- [`--fetch` - Rebase or Merge pull request into new branch](#pr-merge-or-rebase)
49- [`--comment` - Comment on a pull request](#pr-comment)
50- [`--fwd` - Forward a pull request to another reviewer](#pr-forward)
51- [`--open` | `--close` - Open or Close a pull request](#pr-open-or-close)
52- [`--submit` - Open or Close a pull request](#pr-submit)
53- [`--browser` - Open GitHub pull request page in the browser](#pr-open-in-browser)
54 </details>
55
56<details><summary>Issues `is`</summary>
57
58- [`--new` - Create new issues](#issue-create)
59- [`--comment` - Comment on an issue of a repository](#issue-comment)
60- [`--list` - List issues on a repository](#issue-list)
61- [`--open` | `--close` - Open or Close an issue](#issue-open-or-close)
62- [`--browser` - Open GitHub issue page in the browser](#issue-open-in-browser)
63- [`--lock` - Lock GitHub issue](#issue-lock)
64- [`--search` - Search issues in current repository](#issue-search)
65- [`--assign` - Assign an issue on a repository to a user](#issue-assign)
66 </details>
67
68<details><summary>Repos `re`</summary>
69
70- [`--browser` - Open the GitHub repository page in the browser](#repo-open-in-browser)
71- [`--list` - List repos](#repo-list)
72- [`--create` - Create a new GitHub repository and clone on the current directory](#repo-create)
73- [`--fork` - Fork a GitHub repository](#repo-fork)
74- [`--delete` - Delete a repository of specified user](#repo-delete)
75- [`--clone` - Clone a repository](#repo-clone)
76- [`--label --new` - Create or delete a label for a repository](#repo-create-label)
77- [`--label --delete` - Delete a label for a repository](#repo-delete-label)
78- [`--label --list` - List labels for a repository](#repo-list-label)
79- [`--label --update` - Update a label for a repository](#repo-list-labels)
80- [`--search` - Find repositories via various criteria](#repo-search)
81 </details>
82
83<details><summary>Gists `gi`</summary>
84
85- [`--browser` - Open a Gist in the browser](#gist-open-in-browser)
86- [`--list` - List user's gists](#gist-list)
87- [`--create` - Create new gists](#gist-create)
88- [`--fork` - Fork a gist](#gist-fork)
89- [`--delete` - Delete a gist](#gist-delete)
90 </details>
91
92<details><summary>User `us`</summary>
93
94- [`--login` - Automates saving user name & developer token credentials to your ~/.gh.json config](#user-login-or-logout)
95- [`--logout` - Automates removing user name & developer token credentials from your ~/.gh.json config](#user-login-or-logout)
96- [`--whoami` - Prints the user name from ~/.gh.json to your console](#user-whoami)
97 </details>
98
99<details><summary>Notifications `nt`</summary>
100
101- [`--latest` - Display the latest activities on a repository](#notifications-latest)
102- [`--list` - Watch for any activity on repository](#notifications-watch)
103 </details>
104
105<details><summary>Milestones `ms`</summary>
106
107- [`--list` - List milestones for a specific repo](#milestone-list)
108 </details>
109
110<details><summary>Alias `al`</summary>
111
112- [`--add` - Add a shell-like alias for users](#alias-add)
113- [`--remove` - Remove alias](#alias-remove)
114- [`--list` - List aliases for a specific repo](#alias-list)
115 </details>
116
117<br/>
118</details>
119
120<details><summary>General</summary>
121
122- [History](#history)
123- [License](#license)
124- [Demonstration](#demonstration)
125- [Supported Node Versions](#supported-node-versions)
126 </details>
127
128## Install
129
130```
131npm install -g gh
132```
133
134## Usage
135
136- Most commands require you to use a developer key
137- We automate the process for you the first time you run a command
138- [Instructions](#user-login-or-logout) on manually adding a developer key for extra security
139
140Simple example: _list prs for current repo_
141
142```
143gh pr
144```
145
146## Contributors
147
148Huge thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
149
150<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
151<!-- prettier-ignore -->
152<table>
153 <tr>
154 <td align="center"><a href="https://github.com/eduardolundgren"><img src="https://avatars0.githubusercontent.com/u/113087?v=4" width="50px;" alt="Eduardo Lundgren"/><br /><sub><b>Eduardo Lundgren</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=eduardolundgren" title="Code">💻</a> <a href="https://github.com/node-gh/gh/issues?q=author%3Aeduardolundgren" title="Bug reports">🐛</a> <a href="https://github.com/node-gh/gh/commits?author=eduardolundgren" title="Documentation">📖</a> <a href="#question-eduardolundgren" title="Answering Questions">💬</a> <a href="#infra-eduardolundgren" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#plugin-eduardolundgren" title="Plugin/utility libraries">🔌</a> <a href="https://github.com/node-gh/gh/commits?author=eduardolundgren" title="Tests">⚠️</a> <a href="#review-eduardolundgren" title="Reviewed Pull Requests">👀</a> <a href="#ideas-eduardolundgren" title="Ideas, Planning, & Feedback">🤔</a></td>
155 <td align="center"><a href="https://zenorocha.com"><img src="https://avatars1.githubusercontent.com/u/398893?v=4" width="50px;" alt="Zeno Rocha"/><br /><sub><b>Zeno Rocha</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=zenorocha" title="Code">💻</a> <a href="https://github.com/node-gh/gh/issues?q=author%3Azenorocha" title="Bug reports">🐛</a> <a href="https://github.com/node-gh/gh/commits?author=zenorocha" title="Documentation">📖</a> <a href="#question-zenorocha" title="Answering Questions">💬</a> <a href="#infra-zenorocha" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#plugin-zenorocha" title="Plugin/utility libraries">🔌</a> <a href="https://github.com/node-gh/gh/commits?author=zenorocha" title="Tests">⚠️</a> <a href="#review-zenorocha" title="Reviewed Pull Requests">👀</a> <a href="#ideas-zenorocha" title="Ideas, Planning, & Feedback">🤔</a> <a href="#content-zenorocha" title="Content">🖋</a></td>
156 <td align="center"><a href="https://henvic.github.io/"><img src="https://avatars3.githubusercontent.com/u/936421?v=4" width="50px;" alt="Henrique Vicente"/><br /><sub><b>Henrique Vicente</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=henvic" title="Code">💻</a> <a href="https://github.com/node-gh/gh/issues?q=author%3Ahenvic" title="Bug reports">🐛</a> <a href="#question-henvic" title="Answering Questions">💬</a> <a href="#infra-henvic" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#plugin-henvic" title="Plugin/utility libraries">🔌</a> <a href="https://github.com/node-gh/gh/commits?author=henvic" title="Tests">⚠️</a> <a href="#review-henvic" title="Reviewed Pull Requests">👀</a> <a href="#security-henvic" title="Security">🛡️</a> <a href="#ideas-henvic" title="Ideas, Planning, & Feedback">🤔</a></td>
157 <td align="center"><a href="https://github.com/protoEvangelion"><img src="https://avatars3.githubusercontent.com/u/20076677?v=4" width="50px;" alt="Ryan Garant"/><br /><sub><b>Ryan Garant</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3AprotoEvangelion" title="Bug reports">🐛</a> <a href="#question-protoEvangelion" title="Answering Questions">💬</a> <a href="#infra-protoEvangelion" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#plugin-protoEvangelion" title="Plugin/utility libraries">🔌</a> <a href="https://github.com/node-gh/gh/commits?author=protoEvangelion" title="Tests">⚠️</a> <a href="#review-protoEvangelion" title="Reviewed Pull Requests">👀</a> <a href="#security-protoEvangelion" title="Security">🛡️</a> <a href="#ideas-protoEvangelion" title="Ideas, Planning, & Feedback">🤔</a></td>
158 <td align="center"><a href="https://github.com/brunocoelho"><img src="https://avatars1.githubusercontent.com/u/827445?v=4" width="50px;" alt="Bruno Coelho"/><br /><sub><b>Bruno Coelho</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=brunocoelho" title="Code">💻</a> <a href="https://github.com/node-gh/gh/issues?q=author%3Abrunocoelho" title="Bug reports">🐛</a></td>
159 <td align="center"><a href="https://www.joyent.com/"><img src="https://avatars1.githubusercontent.com/u/2080476?v=4" width="50px;" alt="Dustin Ryerson"/><br /><sub><b>Dustin Ryerson</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=dustinryerson" title="Code">💻</a></td>
160 <td align="center"><a href="https://github.com/drewbrokke"><img src="https://avatars1.githubusercontent.com/u/6403097?v=4" width="50px;" alt="Drew Brokke"/><br /><sub><b>Drew Brokke</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=drewbrokke" title="Code">💻</a> <a href="#ideas-drewbrokke" title="Ideas, Planning, & Feedback">🤔</a></td>
161 </tr>
162 <tr>
163 <td align="center"><a href="http://twitter.com/joserobleda"><img src="https://avatars1.githubusercontent.com/u/1263865?v=4" width="50px;" alt="Jose Ignacio"/><br /><sub><b>Jose Ignacio</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=joserobleda" title="Code">💻</a></td>
164 <td align="center"><a href="https://github.com/rodrigovidal"><img src="https://avatars0.githubusercontent.com/u/388081?v=4" width="50px;" alt="Rodrigo Vidal"/><br /><sub><b>Rodrigo Vidal</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=rodrigovidal" title="Code">💻</a></td>
165 <td align="center"><a href="http://hamxabaig.github.io"><img src="https://avatars2.githubusercontent.com/u/12872177?v=4" width="50px;" alt="Hamza Baig"/><br /><sub><b>Hamza Baig</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=hamxabaig" title="Code">💻</a></td>
166 <td align="center"><a href="http://www.liferay.com/web/gregory.amerson/blog"><img src="https://avatars2.githubusercontent.com/u/595221?v=4" width="50px;" alt="Gregory Amerson"/><br /><sub><b>Gregory Amerson</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=gamerson" title="Code">💻</a> <a href="https://github.com/node-gh/gh/issues?q=author%3Agamerson" title="Bug reports">🐛</a></td>
167 <td align="center"><a href="https://blog.tomrochette.com"><img src="https://avatars2.githubusercontent.com/u/188960?v=4" width="50px;" alt="Tom Rochette"/><br /><sub><b>Tom Rochette</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=tomzx" title="Code">💻</a> <a href="https://github.com/node-gh/gh/issues?q=author%3Atomzx" title="Bug reports">🐛</a> <a href="#infra-tomzx" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
168 <td align="center"><a href="https://m-roberts.github.io"><img src="https://avatars2.githubusercontent.com/u/2947595?v=4" width="50px;" alt="Mike Roberts"/><br /><sub><b>Mike Roberts</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=m-roberts" title="Code">💻</a></td>
169 <td align="center"><a href="https://snyk.io"><img src="https://avatars2.githubusercontent.com/u/19733683?v=4" width="50px;" alt="Snyk bot"/><br /><sub><b>Snyk bot</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=snyk-bot" title="Code">💻</a></td>
170 </tr>
171 <tr>
172 <td align="center"><a href="https://github.com/TheBlockchainDeveloper"><img src="https://avatars1.githubusercontent.com/u/139483?v=4" width="50px;" alt="BlockchainDeveloper"/><br /><sub><b>BlockchainDeveloper</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=TheBlockchainDeveloper" title="Code">💻</a></td>
173 <td align="center"><a href="https://www.linkedin.com/in/jpbochi"><img src="https://avatars1.githubusercontent.com/u/96475?v=4" width="50px;" alt="João Paulo Bochi"/><br /><sub><b>João Paulo Bochi</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=jpbochi" title="Code">💻</a></td>
174 <td align="center"><a href="http://maael.github.io/"><img src="https://avatars3.githubusercontent.com/u/5610674?v=4" width="50px;" alt="Matthew Elphick"/><br /><sub><b>Matthew Elphick</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=maael" title="Code">💻</a></td>
175 <td align="center"><a href="http://alterform.com"><img src="https://avatars2.githubusercontent.com/u/116871?v=4" width="50px;" alt="Nate Cavanaugh"/><br /><sub><b>Nate Cavanaugh</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=natecavanaugh" title="Code">💻</a></td>
176 <td align="center"><a href="https://www.peterdavehello.org/"><img src="https://avatars3.githubusercontent.com/u/3691490?v=4" width="50px;" alt="Peter Dave Hello"/><br /><sub><b>Peter Dave Hello</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=PeterDaveHello" title="Code">💻</a></td>
177 <td align="center"><a href="https://mattdesl.com/"><img src="https://avatars1.githubusercontent.com/u/1383811?v=4" width="50px;" alt="Matt DesLauriers"/><br /><sub><b>Matt DesLauriers</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=mattdesl" title="Code">💻</a></td>
178 <td align="center"><a href="https://github.com/oughter"><img src="https://avatars1.githubusercontent.com/u/18747026?v=4" width="50px;" alt="oughter"/><br /><sub><b>oughter</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=oughter" title="Code">💻</a></td>
179 </tr>
180 <tr>
181 <td align="center"><a href="https://adrianmacneil.com/"><img src="https://avatars2.githubusercontent.com/u/637671?v=4" width="50px;" alt="Adrian Macneil"/><br /><sub><b>Adrian Macneil</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=amacneil" title="Code">💻</a></td>
182 <td align="center"><a href="http://kbakba.net/"><img src="https://avatars1.githubusercontent.com/u/36834?v=4" width="50px;" alt="Aleksey Ostapenko"/><br /><sub><b>Aleksey Ostapenko</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=kbakba" title="Code">💻</a></td>
183 <td align="center"><a href="https://github.com/roadhump"><img src="https://avatars3.githubusercontent.com/u/234692?v=4" width="50px;" alt="Aliaksei"/><br /><sub><b>Aliaksei</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=roadhump" title="Code">💻</a></td>
184 <td align="center"><a href="https://akv.io"><img src="https://avatars2.githubusercontent.com/u/967317?v=4" width="50px;" alt="Andrey"/><br /><sub><b>Andrey</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=andreyvital" title="Code">💻</a></td>
185 <td align="center"><a href="http://arbo.com.br"><img src="https://avatars0.githubusercontent.com/u/859765?v=4" width="50px;" alt="André de Oliveira"/><br /><sub><b>André de Oliveira</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=arboliveira" title="Code">💻</a></td>
186 <td align="center"><a href="https://slewsystems.com"><img src="https://avatars1.githubusercontent.com/u/5579960?v=4" width="50px;" alt="Brandon Patram"/><br /><sub><b>Brandon Patram</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=bpatram" title="Code">💻</a></td>
187 <td align="center"><a href="https://twitter.com/jbalsas"><img src="https://avatars1.githubusercontent.com/u/905006?v=4" width="50px;" alt="Chema Balsas"/><br /><sub><b>Chema Balsas</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=jbalsas" title="Code">💻</a></td>
188 </tr>
189 <tr>
190 <td align="center"><a href="http://cswebartisan.com"><img src="https://avatars2.githubusercontent.com/u/555044?v=4" width="50px;" alt="Christian Schlensker"/><br /><sub><b>Christian Schlensker</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=wordofchristian" title="Code">💻</a></td>
191 <td align="center"><a href="http://cironunes.com/"><img src="https://avatars2.githubusercontent.com/u/469908?v=4" width="50px;" alt="Ciro Nunes"/><br /><sub><b>Ciro Nunes</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=cironunes" title="Code">💻</a></td>
192 <td align="center"><a href="https://t.me/piterden"><img src="https://avatars3.githubusercontent.com/u/5930429?v=4" width="50px;" alt="Denis Efremov"/><br /><sub><b>Denis Efremov</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=Piterden" title="Code">💻</a></td>
193 <td align="center"><a href="http://henrimichel.com.br"><img src="https://avatars1.githubusercontent.com/u/2352034?v=4" width="50px;" alt="Henri Cavalcante"/><br /><sub><b>Henri Cavalcante</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=henricavalcante" title="Code">💻</a></td>
194 <td align="center"><a href="http://www.jakahudoklin.com"><img src="https://avatars2.githubusercontent.com/u/585547?v=4" width="50px;" alt="Jaka Hudoklin"/><br /><sub><b>Jaka Hudoklin</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=offlinehacker" title="Code">💻</a></td>
195 <td align="center"><a href="http://twitter.com/jfroma"><img src="https://avatars3.githubusercontent.com/u/178512?v=4" width="50px;" alt="José F. Romaniello"/><br /><sub><b>José F. Romaniello</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=jfromaniello" title="Code">💻</a></td>
196 <td align="center"><a href="http://joshuawu.me/"><img src="https://avatars2.githubusercontent.com/u/12107969?v=4" width="50px;" alt="Joshua Wu"/><br /><sub><b>Joshua Wu</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=jwu910" title="Code">💻</a></td>
197 </tr>
198 <tr>
199 <td align="center"><a href="https://keaglin.com"><img src="https://avatars0.githubusercontent.com/u/1952896?v=4" width="50px;" alt="Kevon Eaglin"/><br /><sub><b>Kevon Eaglin</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=keaglin" title="Code">💻</a></td>
200 <td align="center"><a href="https://mtyurt.net"><img src="https://avatars0.githubusercontent.com/u/2225537?v=4" width="50px;" alt="M. Tarık Yurt"/><br /><sub><b>M. Tarık Yurt</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=mtyurt" title="Code">💻</a></td>
201 <td align="center"><a href="https://mbuffett.com"><img src="https://avatars3.githubusercontent.com/u/1834328?v=4" width="50px;" alt="Marcus Buffett"/><br /><sub><b>Marcus Buffett</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=marcusbuffett" title="Code">💻</a></td>
202 <td align="center"><a href="https://rands0n.com"><img src="https://avatars2.githubusercontent.com/u/4191734?v=4" width="50px;" alt="Randѕon"/><br /><sub><b>Randѕon</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=rands0n" title="Code">💻</a></td>
203 <td align="center"><a href="http://www.earthbound.io"><img src="https://avatars1.githubusercontent.com/u/2556781?v=4" width="50px;" alt="Alex Hall"/><br /><sub><b>Alex Hall</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=earthbound19" title="Code">💻</a></td>
204 <td align="center"><a href="http://www.dev-institut.fr"><img src="https://avatars1.githubusercontent.com/u/1372183?v=4" width="50px;" alt="Rossi Oddet"/><br /><sub><b>Rossi Oddet</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=roddet" title="Code">💻</a></td>
205 <td align="center"><a href="https://github.com/rschmukler"><img src="https://avatars1.githubusercontent.com/u/651740?v=4" width="50px;" alt="Ryan Schmukler"/><br /><sub><b>Ryan Schmukler</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=rschmukler" title="Code">💻</a></td>
206 </tr>
207 <tr>
208 <td align="center"><a href="https://www.onato.com/"><img src="https://avatars2.githubusercontent.com/u/107999?v=4" width="50px;" alt="Stephen Williams"/><br /><sub><b>Stephen Williams</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=onato" title="Code">💻</a></td>
209 <td align="center"><a href="http://www.wulftone.com"><img src="https://avatars3.githubusercontent.com/u/142784?v=4" width="50px;" alt="Trevor Bortins"/><br /><sub><b>Trevor Bortins</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=wulftone" title="Code">💻</a></td>
210 <td align="center"><a href="https://github.com/wbyoung"><img src="https://avatars1.githubusercontent.com/u/57162?v=4" width="50px;" alt="Whitney Young"/><br /><sub><b>Whitney Young</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=wbyoung" title="Code">💻</a></td>
211 <td align="center"><a href="https://www.lgtm.com"><img src="https://avatars3.githubusercontent.com/u/7395402?v=4" width="50px;" alt="Xavier RENE-CORAIL"/><br /><sub><b>Xavier RENE-CORAIL</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=xcorail" title="Code">💻</a></td>
212 <td align="center"><a href="http://the.igreque.info/"><img src="https://avatars2.githubusercontent.com/u/227057?v=4" width="50px;" alt="YAMAMOTO Yuji"/><br /><sub><b>YAMAMOTO Yuji</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=igrep" title="Code">💻</a></td>
213 <td align="center"><a href="https://github.com/smikes"><img src="https://avatars0.githubusercontent.com/u/5124609?v=4" width="50px;" alt="Sam Mikes"/><br /><sub><b>Sam Mikes</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=smikes" title="Code">💻</a></td>
214 <td align="center"><a href="https://github.com/tijuthomas"><img src="https://avatars0.githubusercontent.com/u/8406974?v=4" width="50px;" alt="Tiju Thomas"/><br /><sub><b>Tiju Thomas</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=tijuthomas" title="Code">💻</a></td>
215 </tr>
216 <tr>
217 <td align="center"><a href="https://averba.ch"><img src="https://avatars3.githubusercontent.com/u/2838836?v=4" width="50px;" alt="Zev Averbach"/><br /><sub><b>Zev Averbach</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=zevaverbach" title="Code">💻</a> <a href="https://github.com/node-gh/gh/issues?q=author%3Azevaverbach" title="Bug reports">🐛</a></td>
218 <td align="center"><a href="http://aaronkjones.com"><img src="https://avatars1.githubusercontent.com/u/17125755?v=4" width="50px;" alt="Aaron Jones"/><br /><sub><b>Aaron Jones</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Aaaronkjones" title="Bug reports">🐛</a></td>
219 <td align="center"><a href="https://linkedin.com/in/jrschumacher"><img src="https://avatars1.githubusercontent.com/u/46549?v=4" width="50px;" alt="Ryan Schumacher"/><br /><sub><b>Ryan Schumacher</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Ajrschumacher" title="Bug reports">🐛</a></td>
220 <td align="center"><a href="http://robdodson.me"><img src="https://avatars0.githubusercontent.com/u/1066253?v=4" width="50px;" alt="Rob Dodson"/><br /><sub><b>Rob Dodson</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Arobdodson" title="Bug reports">🐛</a></td>
221 <td align="center"><a href="https://github.com/dsifford"><img src="https://avatars0.githubusercontent.com/u/5240018?v=4" width="50px;" alt="Derek Sifford"/><br /><sub><b>Derek Sifford</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Adsifford" title="Bug reports">🐛</a></td>
222 <td align="center"><a href="https://github.com/rachidbch"><img src="https://avatars1.githubusercontent.com/u/1119174?v=4" width="50px;" alt="rachidbch"/><br /><sub><b>rachidbch</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Arachidbch" title="Bug reports">🐛</a></td>
223 <td align="center"><a href="https://www.tabookey.com/"><img src="https://avatars0.githubusercontent.com/u/1171354?v=4" width="50px;" alt="Liraz Siri"/><br /><sub><b>Liraz Siri</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Alirazsiri" title="Bug reports">🐛</a></td>
224 </tr>
225 <tr>
226 <td align="center"><a href="https://github.com/zsoltbalogh"><img src="https://avatars1.githubusercontent.com/u/866157?v=4" width="50px;" alt="Zsolt Balogh"/><br /><sub><b>Zsolt Balogh</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Azsoltbalogh" title="Bug reports">🐛</a> <a href="https://github.com/node-gh/gh/commits?author=zsoltbalogh" title="Documentation">📖</a></td>
227 <td align="center"><a href="https://www.liferay.com/"><img src="https://avatars3.githubusercontent.com/u/78014?v=4" width="50px;" alt="Iliyan Peychev"/><br /><sub><b>Iliyan Peychev</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Aipeychev" title="Bug reports">🐛</a></td>
228 <td align="center"><a href="https://dante.io"><img src="https://avatars0.githubusercontent.com/u/1185063?v=4" width="50px;" alt="Dante Wang"/><br /><sub><b>Dante Wang</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Adantewang" title="Bug reports">🐛</a></td>
229 <td align="center"><a href="http://rotty3000.github.io"><img src="https://avatars1.githubusercontent.com/u/146764?v=4" width="50px;" alt="Raymond Augé"/><br /><sub><b>Raymond Augé</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Arotty3000" title="Bug reports">🐛</a></td>
230 <td align="center"><a href="https://mbassem.com"><img src="https://avatars2.githubusercontent.com/u/2418637?v=4" width="50px;" alt="Mohamed Bassem"/><br /><sub><b>Mohamed Bassem</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3AMohamedBassem" title="Bug reports">🐛</a></td>
231 <td align="center"><a href="https://github.com/sez11a"><img src="https://avatars3.githubusercontent.com/u/515497?v=4" width="50px;" alt="Rich Sezov"/><br /><sub><b>Rich Sezov</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Asez11a" title="Bug reports">🐛</a></td>
232 <td align="center"><a href="https://github.com/jasonkuhrt"><img src="https://avatars3.githubusercontent.com/u/284476?v=4" width="50px;" alt="Jason Kuhrt"/><br /><sub><b>Jason Kuhrt</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Ajasonkuhrt" title="Bug reports">🐛</a></td>
233 </tr>
234 <tr>
235 <td align="center"><a href="https://github.com/gon138"><img src="https://avatars0.githubusercontent.com/u/5614711?v=4" width="50px;" alt="gon138"/><br /><sub><b>gon138</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Agon138" title="Bug reports">🐛</a></td>
236 <td align="center"><a href="https://github.com/m-novikov"><img src="https://avatars2.githubusercontent.com/u/5163640?v=4" width="50px;" alt="Maxim Novikov"/><br /><sub><b>Maxim Novikov</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Am-novikov" title="Bug reports">🐛</a></td>
237 <td align="center"><a href="https://andersdjohnson.com"><img src="https://avatars3.githubusercontent.com/u/615381?v=4" width="50px;" alt="Anders D. Johnson"/><br /><sub><b>Anders D. Johnson</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3AAndersDJohnson" title="Bug reports">🐛</a></td>
238 <td align="center"><a href="https://izaias.co"><img src="https://avatars3.githubusercontent.com/u/192261?v=4" width="50px;" alt="Gabriel Izaias"/><br /><sub><b>Gabriel Izaias</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Agabrielizaias" title="Bug reports">🐛</a></td>
239 <td align="center"><a href="https://smyles.dev"><img src="https://avatars3.githubusercontent.com/u/553732?v=4" width="50px;" alt="Myles McNamara"/><br /><sub><b>Myles McNamara</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Atripflex" title="Bug reports">🐛</a></td>
240 <td align="center"><a href="https://www.giladpeleg.com"><img src="https://avatars0.githubusercontent.com/u/4533329?v=4" width="50px;" alt="Gilad Peleg"/><br /><sub><b>Gilad Peleg</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Apgilad" title="Bug reports">🐛</a></td>
241 <td align="center"><a href="https://yoshuawuyts.com"><img src="https://avatars3.githubusercontent.com/u/2467194?v=4" width="50px;" alt="Yoshua Wuyts"/><br /><sub><b>Yoshua Wuyts</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Ayoshuawuyts" title="Bug reports">🐛</a></td>
242 </tr>
243 <tr>
244 <td align="center"><a href="http://marclundgren.github.io/"><img src="https://avatars1.githubusercontent.com/u/1154834?v=4" width="50px;" alt="Marc Lundgren"/><br /><sub><b>Marc Lundgren</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Amarclundgren" title="Bug reports">🐛</a></td>
245 <td align="center"><a href="https://github.com/juliocamarero"><img src="https://avatars0.githubusercontent.com/u/203395?v=4" width="50px;" alt="Julio Camarero"/><br /><sub><b>Julio Camarero</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Ajuliocamarero" title="Bug reports">🐛</a></td>
246 <td align="center"><a href="http://www.liferay.com/web/marcellus.tavares/blog"><img src="https://avatars2.githubusercontent.com/u/286892?v=4" width="50px;" alt="Marcellus Tavares"/><br /><sub><b>Marcellus Tavares</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Amarcellustavares" title="Bug reports">🐛</a></td>
247 <td align="center"><a href="http://www.liferay.com/es/web/sergio.gonzalez/blog"><img src="https://avatars3.githubusercontent.com/u/860987?v=4" width="50px;" alt="Sergio Gonzalez"/><br /><sub><b>Sergio Gonzalez</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Asergiogonzalez" title="Bug reports">🐛</a></td>
248 <td align="center"><a href="http://resume.djalmaaraujo.com/"><img src="https://avatars1.githubusercontent.com/u/3402?v=4" width="50px;" alt="Djalma Araújo"/><br /><sub><b>Djalma Araújo</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Adjalmaaraujo" title="Bug reports">🐛</a></td>
249 <td align="center"><a href="https://github.com/brunobasto"><img src="https://avatars0.githubusercontent.com/u/156388?v=4" width="50px;" alt="Bruno Basto"/><br /><sub><b>Bruno Basto</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Abrunobasto" title="Bug reports">🐛</a></td>
250 <td align="center"><a href="http://jason.pincin.com/"><img src="https://avatars0.githubusercontent.com/u/1831096?v=4" width="50px;" alt="Jason Pincin"/><br /><sub><b>Jason Pincin</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Ajasonpincin" title="Bug reports">🐛</a></td>
251 </tr>
252 <tr>
253 <td align="center"><a href="https://twitter.com/leoj3n"><img src="https://avatars2.githubusercontent.com/u/990216?v=4" width="50px;" alt="Joel Kuzmarski"/><br /><sub><b>Joel Kuzmarski</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Aleoj3n" title="Bug reports">🐛</a></td>
254 <td align="center"><a href="https://github.com/shinzui"><img src="https://avatars3.githubusercontent.com/u/519?v=4" width="50px;" alt="Nadeem Bitar"/><br /><sub><b>Nadeem Bitar</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=shinzui" title="Documentation">📖</a></td>
255 <td align="center"><a href="https://github.com/cleydyr"><img src="https://avatars1.githubusercontent.com/u/441513?v=4" width="50px;" alt="Cleydyr Bezerra de Albuquerque"/><br /><sub><b>Cleydyr Bezerra de Albuquerque</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Acleydyr" title="Bug reports">🐛</a></td>
256 <td align="center"><a href="https://twitter.com/rmnPires"><img src="https://avatars1.githubusercontent.com/u/1796577?v=4" width="50px;" alt="Ramon Pires da Silva"/><br /><sub><b>Ramon Pires da Silva</b></sub></a><br /><a href="#plugin-ramonPires" title="Plugin/utility libraries">🔌</a></td>
257 <td align="center"><a href="https://github.com/Lisiadito"><img src="https://avatars0.githubusercontent.com/u/13214912?v=4" width="50px;" alt="Patrick Weingärtner"/><br /><sub><b>Patrick Weingärtner</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=Lisiadito" title="Code">💻</a></td>
258 <td align="center"><a href="http://gabrieluizramos.com.br/"><img src="https://avatars0.githubusercontent.com/u/13336905?v=4" width="50px;" alt="Gabriel Ramos"/><br /><sub><b>Gabriel Ramos</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=gabrieluizramos" title="Code">💻</a></td>
259 <td align="center"><a href="https://github.com/mdelapenya"><img src="https://avatars2.githubusercontent.com/u/951580?v=4" width="50px;" alt="Manuel de la Peña"/><br /><sub><b>Manuel de la Peña</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=mdelapenya" title="Code">💻</a></td>
260 </tr>
261 <tr>
262 <td align="center"><a href="http://jmvidal.cse.sc.edu"><img src="https://avatars3.githubusercontent.com/u/228704?v=4" width="50px;" alt="Jose M Vidal"/><br /><sub><b>Jose M Vidal</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Ajosemvidal" title="Bug reports">🐛</a></td>
263 <td align="center"><a href="http://saulovallory.com"><img src="https://avatars1.githubusercontent.com/u/117560?v=4" width="50px;" alt="Saulo Vallory"/><br /><sub><b>Saulo Vallory</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=svallory" title="Code">💻</a></td>
264 <td align="center"><a href="https://github.com/hernan"><img src="https://avatars0.githubusercontent.com/u/15841?v=4" width="50px;" alt="Hernan Fernandez"/><br /><sub><b>Hernan Fernandez</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=hernan" title="Code">💻</a></td>
265 <td align="center"><a href="https://github.com/Aaron-K-T-Berry"><img src="https://avatars1.githubusercontent.com/u/24759009?v=4" width="50px;" alt="Aaron Berry"/><br /><sub><b>Aaron Berry</b></sub></a><br /><a href="https://github.com/node-gh/gh/commits?author=Aaron-K-T-Berry" title="Code">💻</a></td>
266 <td align="center"><a href="http://www.liferay.com/web/inacio.nery/profile"><img src="https://avatars0.githubusercontent.com/u/14062516?v=4" width="50px;" alt="Inácio Nery"/><br /><sub><b>Inácio Nery</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Ainacionery" title="Bug reports">🐛</a></td>
267 <td align="center"><a href="http://marcbizal.com"><img src="https://avatars1.githubusercontent.com/u/1304994?v=4" width="50px;" alt="Marcus Bizal"/><br /><sub><b>Marcus Bizal</b></sub></a><br /><a href="https://github.com/node-gh/gh/issues?q=author%3Amarcbizal" title="Bug reports">🐛</a></td>
268 </tr>
269</table>
270
271<!-- ALL-CONTRIBUTORS-LIST:END -->
272
273This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
274
275## Contributing
276
277For detailed instructions, check [Contributing](https://github.com/node-gh/gh/blob/master/CONTRIBUTING.md). Don't miss the [source code reports](https://node-gh.github.io/reports/).
278
279## History
280
281For detailed changelog, check [Releases](https://github.com/node-gh/gh/releases).
282
283## License
284
285[BSD-3-Clause](https://github.com/node-gh/gh/blob/master/LICENSE.txt)
286
287## Demonstration
288
289<a href="https://asciinema.org/a/214594?autoplay=1">
290 <p align="center">
291 <img alt="Terminal Demo" src="http://nodegh.io/images/terminal-demo.svg" width="600">
292 </p>
293</a>
294
295## Supported Node Versions:
296
297We support the node versions that the Node.js organization supports which as of now is Node v6 & up.
298
299<p><img src="https://github.com/nodejs/Release/blob/master/schedule.svg" alt="LTS Schedule"/></p>
300
301## Authentication
302
303Under the hood, we are using [@octokit/rest](https://github.com/octokit/rest.js) to work with the GitHub API
304The method of authentication that we use with octokit, is a personal access token
305You have two options here: 1. Run `gh` which will start the authentication process & generate the token for you automatically - Though they are hidden, the downside of this is having to type your user & pass - Supports 2fa 2. [Manually generate your personal token](https://github.com/node-gh/gh/issues/450#issuecomment-490530739) & add it to your `~/.gh.json`
306
307## Available commands
308
309```
310gh help
311```
312
313List all comands options.
314
315```
316gh help --all
317```
318
319List specific command options.
320
321```
322gh help <command>
323```
324
325### Global flags
326
327| Option | Usage | Type |
328| ------------ | ---------- | --------- |
329| `--verbose` | _Optional_ | `Boolean` |
330| `--insane` | _Optional_ | `Boolean` |
331| `--no-color` | _Optional_ | `Boolean` |
332| `--no-hooks` | _Optional_ | `Boolean` |
333
334The verbose flag is useful for debugging issues.
335The insane flag is a more complete verbose flag, which leaks more privacy sensitive data by default.
336
337## Pull requests
338
339```
340gh pull-request
341```
342
343> **Alias:** `gh pr`
344
345### PR: Info
346
347| Option | Usage | Type |
348| ---------------- | ---------- | --------- |
349| `-u`, `--user` | _Required_ | `String` |
350| `-I`, `--info` | _Required_ | `Boolean` |
351| `-n`, `--number` | _Required_ | `String` |
352| `-r`, `--repo` | _Optional_ | `String` |
353| `-u`, `--user` | _Optional_ | `String` |
354
355Get information about a pull request.
356
357```
358gh pr --info 1
359```
360
361### PR: List
362
363| Option | Usage | Type |
364| ------------------ | ------------ | ------------------------------------------------------------------ |
365| `-l`, `--list` | **Required** | `Boolean` |
366| `-a`, `--all` | _Optional_ | `Boolean` |
367| `-O`, `--org` | _Optional_ | `String` |
368| `-m`, `--me` | _Optional_ | `Boolean` |
369| `-d`, `--detailed` | _Optional_ | `Boolean` |
370| `--direction` | _Optional_ | [`asc`, `desc`] |
371| `--date` | _Optional_ | `String` |
372| `-b`, `--branch` | _Optional_ | `String` |
373| `--remote` | _Optional_ | `String` |
374| `-r`, `--repo` | _Optional_ | `String` |
375| `--sort` | _Optional_ | [`created`, `updated`, `popularity`, `long-running`, `complexity`] |
376| `-S`, `--state` | _Optional_ | [`open`, `closed`] |
377| `-u`, `--user` | _Optional_ | `String` |
378| `--link` | _Optional_ | `Boolean` |
379
380- `user` is owner of the repository, it is the authenticated user by default.
381- `remote` is the name of the remote configuration in a git directory, i.e. origin, upstream.
382- Therefore, it only makes sense when this command is run in a git directory.
383- To turn off pretty printing of output in a table add `"pretty_print": false` to your `~/.gh-json` config
384- To adjust [pagination rules](#set-pagination-rules)
385
386#### Examples
387
388**Shortcut** for listing open pull requests for the current repository
389
390```
391gh pr
392```
393
394List open pull requests for all branches from all your repositories.
395
396```
397gh pr --list --all
398```
399
400List open pull requests for all branches in all repositories belonging to the "github" organization.
401
402```
403gh pr --list --all --org github
404```
405
406List open pull requests sent by logged user on current repository.
407
408```
409gh pr --list --me
410```
411
412List open pull requests in node-gh/gh repository.
413
414```
415gh pr --list --user node-gh --repo gh
416```
417
418List open pull requests with link and content.
419
420```
421gh pr --list --detailed
422```
423
424List open pull requests for a branch.
425
426```
427gh pr --list --branch master
428```
429
430List open pull requests and sort them by popularity _(comment count)_.
431
432```
433gh pr --list --sort popularity
434```
435
436List open pull requests and sort them by asc long-running _(old but still active)_.
437
438```
439gh pr --list --sort long-running --direction asc
440```
441
442List open pull requests and sort them by complexity _(complexity is calculated based on number of additions, deletions, changed files, comments and review comments)_.
443
444```
445gh pr --list --sort complexity
446```
447
448List open pull requests with their link
449
450```
451gh pr --list --link
452```
453
454List open pull requests with a formatted date (_Any string that the moment library's formatter accepts should work: https://momentjs.com/docs/#/displaying/format/_).
455
456```
457gh pr --list --date "dddd, MMMM Do YYYY, h:mm:ss a"
458```
459
460### PR: Merge or Rebase
461
462| Option | Usage | Type |
463| ---------------- | ------------ | --------- |
464| `-f`, `--fetch` | **Required** | `Boolean` |
465| `-M`, `--merge` | **Required** | `Boolean` |
466| `-R`, `--rebase` | **Required** | `Boolean` |
467| `-n`, `--number` | _Optional_ | `Number` |
468| `-b`, `--branch` | _Optional_ | `String` |
469| `--draft` | _Optional_ | `Boolean` |
470| `--remote` | _Optional_ | `String` |
471| `-r`, `--repo` | _Optional_ | `String` |
472| `-u`, `--user` | _Optional_ | `String` |
473
474Omitting `--number` will try to guess the pull number from branch name e.g. `pr-1` results in `--number 1`. Omitting `--branch` will merge or rebase into `config.default_branch`.
475
476#### Examples
477
478**Shortcut** for fetching pull request and checkout into a new branch `pr-1`.
479
480```
481gh pr 1
482```
483
484Merge or rebase pull request into a local branch.
485
486```
487gh pr 1 --fetch --merge
488```
489
490```
491gh pr 1 --fetch --rebase
492```
493
494Merge or rebase pull request into branch `dev`.
495
496```
497gh pr 1 --fetch --rebase --branch dev
498```
499
500```
501gh pr 1 --fetch --merge --branch dev
502```
503
504### PR: Comment
505
506| Option | Usage | Type |
507| ----------------- | ------------ | -------- |
508| `-c`, `--comment` | **Required** | `String` |
509| `-n`, `--number` | **Required** | `Number` |
510| `--remote` | _Optional_ | `String` |
511| `-r`, `--repo` | _Optional_ | `String` |
512| `-u`, `--user` | _Optional_ | `String` |
513
514#### Examples
515
516Comment on a pull request.
517
518```
519gh pr 1 --comment "Merged, thank you!"
520```
521
522Submit a pull request using your [default editor](#set-default-editor-to-use-when-creating-a-new-message) by passing an empty `--comment`
523
524```
525gh pr 1 --comment
526```
527
528### PR Forward
529
530| Option | Usage | Type |
531| ---------------- | ------------ | -------- |
532| `--fwd` | **Required** | `String` |
533| `-n`, `--number` | **Required** | `Number` |
534
535Omitting a value for `--fwd` fallbacks to the `default_pr_forwarder` key found
536in your [config file](#config).
537
538#### Examples
539
540Forward a pull request to another reviewer.
541
542```
543gh pr 1 --fwd username
544```
545
546### PR: Open or Close
547
548| Option | Usage | Type |
549| ---------------- | ------------ | --------- |
550| `-o`, `--open` | **Required** | `Boolean` |
551| `-C`, `--close` | **Required** | `Boolean` |
552| `-n`, `--number` | **Required** | `Number` |
553| `--remote` | _Optional_ | `String` |
554| `-r`, `--repo` | _Optional_ | `String` |
555| `-u`, `--user` | _Optional_ | `String` |
556
557#### Examples
558
559Open a pull request.
560
561```
562gh pr 1 --open
563```
564
565Close a pull request.
566
567```
568gh pr 1 --close
569```
570
571Close multiple pull requests.
572
573```
574gh pr --close --number 1 --number 2
575```
576
577Open multiple pull requests.
578
579```
580gh pr --open --number 1 --number 2
581```
582
583Open or close a pull request that you've sent to someone.
584
585```
586gh pr 1 --close --user eduardolundgren
587```
588
589### PR: Submit
590
591| Option | Usage | Type |
592| --------------------- | ------------ | -------- |
593| `-s`, `--submit` | **Required** | `String` |
594| `-b`, `--branch` | _Optional_ | `String` |
595| `-D`, `--description` | _Optional_ | `String` |
596| `-i`, `--issue` | _Optional_ | `Number` |
597| `-r`, `--repo` | _Optional_ | `String` |
598| `-t`, `--title` | _Optional_ | `String` |
599
600Omitting a value for `--submit` fallbacks to the `default_pr_reviewer` key found
601in your [config file](#config). Omitting `--title` will submit a pull request
602using the last commit message as title.
603
604#### Examples
605
606Submit a pull request using the current branch.
607
608```
609gh pr --submit eduardolundgren --title 'Fix #32' --description 'Awesome fix'
610```
611
612Submit a pull request using your [default editor](#set-default-editor-to-use-when-creating-a-new-message) by passing an empty `--title` and or `--description`
613
614```
615gh pr --submit eduardolundgren --title --description
616```
617
618Submit a pull request using the current branch to dev branch.
619
620```
621gh pr --submit eduardolundgren --branch dev
622```
623
624Submit a pull request from a issue.
625
626```
627gh pr --submit eduardolundgren --issue 150
628```
629
630Submit a pull request in draft state.
631
632```
633gh pr --submit eduardolundgren --draft
634```
635
636### PR: Open in Browser
637
638| Option | Usage | Type |
639| ----------------- | ------------ | --------- |
640| `-B`, `--browser` | **Required** | `Boolean` |
641| `-n`, `--number` | **Required** | `Number` |
642| `-u`, `--user` | _Optional_ | `String` |
643| `-r`, `--repo` | _Optional_ | `String` |
644
645#### Examples
646
647Open GitHub pull request page in the browser.
648
649```
650gh pr 100 --browser
651```
652
653## Notifications
654
655```
656gh notification
657```
658
659> **Alias:** `gh nt`
660
661### Notifications: Latest
662
663| Option | Usage | Type |
664| ---------------- | ------------ | --------- |
665| `-l`, `--latest` | **Required** | `Boolean` |
666| `--remote` | _Optional_ | `String` |
667| `-r`, `--repo` | _Optional_ | `String` |
668| `-u`, `--user` | _Optional_ | `String` |
669| `--date` | _Optional_ | `String` |
670
671#### Examples
672
673**Shortcut** for displaying the latest activities on the current repository.
674
675```
676gh nt
677```
678
679Display the latest activities on a certain repository.
680
681```
682gh nt --latest --user eduardolundgren --repo node-gh
683```
684
685Diplay notifications with a formatted date (_Any string that the moment library's formatter accepts should work: https://momentjs.com/docs/#/displaying/format/_).
686
687```
688gh nt --date "dddd, MMMM Do YYYY, h:mm:ss a"
689```
690
691### Notifications: Watch
692
693| Option | Usage | Type |
694| --------------- | ------------ | --------- |
695| `-w`, `--watch` | **Required** | `Boolean` |
696| `--remote` | _Optional_ | `String` |
697| `-r`, `--repo` | _Optional_ | `String` |
698| `-u`, `--user` | _Optional_ | `String` |
699
700#### Examples
701
702Watch for any activity on the current repository.
703
704```
705gh nt --watch
706```
707
708Watch for any activity on a certain repository.
709
710```
711gh nt --watch --user eduardolundgren --repo node-gh
712```
713
714## Issues
715
716```
717gh issue
718```
719
720> **Alias:** `gh is`
721
722### Issue: Create
723
724| Option | Usage | Type |
725| ------------------ | ------------ | --------- |
726| `-N`, `--new` | **Required** | `Boolean` |
727| `-t`, `--title` | **Required** | `String` |
728| `-A`, `--assignee` | _Optional_ | `String` |
729| `-L`, `--labels` | _Optional_ | `String` |
730| `-m`, `--message` | _Optional_ | `String` |
731| `--remote` | _Optional_ | `String` |
732| `-r`, `--repo` | _Optional_ | `String` |
733| `-u`, `--user` | _Optional_ | `String` |
734
735#### Examples
736
737**Shortcut** for creating a new issue on the current repository.
738
739```
740gh is 'Node GH rocks!' 'Body with **Markdown** support'
741```
742
743Create a new issue using your [default editor](#set-default-editor-to-use-when-creating-a-new-message) by passing an empty `--message` (_also works with an empty title_)
744
745```
746gh is --new --title 'Node GH rocks!' --message
747```
748
749Create a new issue on a certain repository.
750
751```
752gh is --new --title 'Node GH rocks!' --message 'Body with **Markdown** support' --user eduardolundgren --repo node-gh
753```
754
755Create a new issue with labels.
756
757```
758gh is --new --title 'Node GH rocks!' --labels bug,question,test
759```
760
761Create a new issue and assign it to someone.
762
763```
764gh is --new --title 'Node GH rocks!' --assignee zenorocha
765```
766
767### Issue: Comment
768
769| Option | Usage | Type |
770| ----------------- | ------------ | -------- |
771| `-c`, `--comment` | **Required** | `String` |
772| `-n`, `--number` | **Required** | `Number` |
773| `--remote` | _Optional_ | `String` |
774| `-r`, `--repo` | _Optional_ | `String` |
775| `-u`, `--user` | _Optional_ | `String` |
776
777#### Examples
778
779Comment on an issue of the current repository.
780
781```
782gh is 1 --comment 'Node GH rocks!'
783```
784
785Comment on an issue using your [default editor](#set-default-editor-to-use-when-creating-a-new-message) by passing an empty `--comment` (_also works with an empty title_)
786
787```
788gh is 1 --comment
789```
790
791Comment on an issue of a certain repository.
792
793```
794gh is 1 --comment 'Node GH rocks!' --user eduardolundgren --repo node-gh
795```
796
797### Issue: Open or Close
798
799| Option | Usage | Type |
800| ---------------- | ------------ | --------- |
801| `-o`, `--open` | **Required** | `Boolean` |
802| `-C`, `--close` | **Required** | `Boolean` |
803| `-n`, `--number` | **Required** | `Number` |
804| `--remote` | _Optional_ | `String` |
805| `-r`, `--repo` | _Optional_ | `String` |
806| `-u`, `--user` | _Optional_ | `String` |
807
808#### Examples
809
810Open an issue.
811
812```
813gh is 1 --open
814```
815
816Close an issue.
817
818```
819gh is 1 --close
820```
821
822Close multiple issues.
823
824```
825gh is --close --number 1 --number 2
826```
827
828Open multiple issues.
829
830```
831gh is --open --number 1 --number 2
832```
833
834Open or close an issue that you've sent to someone.
835
836```
837gh is 1 --close --user eduardolundgren
838```
839
840### Issue: List
841
842| Option | Usage | Type |
843| ------------------- | ------------ | -------------------- |
844| `-l`, `--list` | **Required** | `Boolean` |
845| `-a`, `--all` | _Optional_ | `Boolean` |
846| `-A`, `--assignee` | _Optional_ | `String` |
847| `--date` | _Optional_ | `String` |
848| `-d`, `--detailed` | _Optional_ | `Boolean` |
849| `-L`, `--labels` | _Optional_ | `String` |
850| `-M`, `--milestone` | _Optional_ | [`Number`, `String`] |
851| `--remote` | _Optional_ | `String` |
852| `-r`, `--repo` | _Optional_ | `String` |
853| `-S`, `--state` | _Optional_ | [`open`, `closed`] |
854| `-u`, `--user` | _Optional_ | `String` |
855
856- To adjust [pagination rules](#set-pagination-rules)
857
858#### Examples
859
860**Shortcut** for listing all issues on the current repository.
861
862```
863gh is
864```
865
866List all issues from all repositories.
867
868```
869gh is --list --all
870```
871
872List issues assigned to someone.
873
874```
875gh is --list --assignee zenorocha
876```
877
878List issues with link and content.
879
880```
881gh is --list --detailed
882```
883
884List only closed issues on the current repository.
885
886```
887gh is --list --state closed
888```
889
890List issues with a formatted date (_Any string that the moment library's formatter accepts should work: https://momentjs.com/docs/#/displaying/format/_).
891
892```
893gh is --list --date "dddd, MMMM Do YYYY, h:mm:ss a"
894```
895
896List issues filtered by milestone title.
897
898```
899gh is --list --milestone "milestone title"
900```
901
902List issues that contains labels `todo` and `bug`.
903
904```
905gh is --list --labels todo,bug
906```
907
908List all issues on a certain repository.
909
910```
911gh is --list --user eduardolundgren --repo node-gh
912```
913
914### Issue: Open in Browser
915
916| Option | Usage | Type |
917| ----------------- | ------------ | --------- |
918| `-B`, `--browser` | **Required** | `Boolean` |
919| `-n`, `--number` | **Required** | `Number` |
920| `-u`, `--user` | _Optional_ | `String` |
921| `-r`, `--repo` | _Optional_ | `String` |
922
923#### Examples
924
925**Shortcut** for opening GitHub issue page in the browser.
926
927```
928gh is 100
929```
930
931Open GitHub issue page in the browser.
932
933```
934gh is 100 --browser
935```
936
937### Issue: Lock
938
939| Option | Usage | Type |
940| ---------------- | ------------ | ----------------------------------------------- |
941| `--lock` | **Required** | `Boolean` |
942| `--lock-reason` | _Optional_ | [`off-topic`, `too heated`, `resolved`, `spam`] |
943| `-n`, `--number` | **Required** | `Number` |
944| `--remote` | _Optional_ | `String` |
945| `-r`, `--repo` | _Optional_ | `String` |
946| `-u`, `--user` | _Optional_ | `String` |
947
948#### Examples
949
950Lock issue on the current repository.
951
952```
953gh is 1 --lock
954```
955
956Lock issue on the current repository with a reason.
957
958```
959gh is 1 --lock --lock-reason resolved
960```
961
962### Issue: Search
963
964| Option | Usage | Type |
965| ------------------ | ------------ | --------- |
966| `-s`, `--search` | **Required** | `Boolean` |
967| `-a`, `--all` | _Optional_ | `Boolean` |
968| `-d`, `--detailed` | _Optional_ | `Boolean` |
969| `-r`, `--repo` | _Optional_ | `String` |
970| `-u`, `--user` | _Optional_ | `String` |
971
972#### Examples
973
974Search issues in current repository
975
976```
977gh is --search 'term'
978```
979
980Search issues in all repositories for a user
981
982```
983gh is --all --user node-gh --search 'term'
984```
985
986Search issues in a repository for a user
987
988```
989gh is --user node-gh --repo gh --search 'term'
990```
991
992Search issues in a repository for a user with link and content
993
994```
995gh is --user node-gh --repo gh --search 'term'
996```
997
998Search issues with github filters
999
1000```
1001gh is --user node-gh --repo gh --search 'updated:<=2013-05-24'
1002```
1003
1004### Issue: Assign
1005
1006| Option | Usage | Type |
1007| ------------------ | ------------ | --------- |
1008| `--assign` | **Required** | `Boolean` |
1009| `-A`, `--assignee` | **Required** | `String` |
1010| `-n`, `--number` | **Required** | `Number` |
1011| `-r`, `--repo` | _Optional_ | `String` |
1012| `-u`, `--user` | _Optional_ | `String` |
1013
1014#### Examples
1015
1016Assign an issue on the current repository to a user.
1017
1018```
1019gh is --assign --assignee zenorocha --number 1
1020```
1021
1022Assign an issue on a specific repository to a user.
1023
1024```
1025gh is --assign --assignee zenorocha --number 1 --user eduardolundgren --repo gh
1026```
1027
1028## Repo
1029
1030```
1031gh repo
1032```
1033
1034> **Alias:** `gh re`
1035
1036### Repo: Open in Browser
1037
1038| Option | Usage | Type |
1039| ----------------- | ------------ | --------- |
1040| `-B`, `--browser` | **Required** | `Boolean` |
1041| `-u`, `--user` | _Optional_ | `String` |
1042| `-r`, `--repo` | _Optional_ | `String` |
1043
1044#### Examples
1045
1046**Shortcut** for opening the GitHub repository page in the browser.
1047
1048```
1049gh re
1050```
1051
1052Open GitHub repository page in the browser.
1053
1054```
1055gh re --browser --user eduardolundgren --repo node-gh
1056```
1057
1058### Repo: List
1059
1060| Option | Usage | Type |
1061| ------------------ | ------------ | ----------------------------------------------- |
1062| `-l`, `--list` | **Required** | `Boolean` |
1063| `-d`, `--detailed` | _Optional_ | `Boolean` |
1064| `-u`, `--user` | _Optional_ | `String` |
1065| `-t`, `--type` | _Optional_ | [`all`, `owner`, `public`, `private`, `member`] |
1066| `--date` | _Optional_ | `String` |
1067
1068#### Examples
1069
1070List all repositories.
1071
1072```
1073gh re --list
1074```
1075
1076List all private repositories.
1077
1078```
1079gh re --list --type private
1080```
1081
1082List all repositories from someone.
1083
1084```
1085gh re --list --user zenorocha
1086```
1087
1088List open repositories with a formatted date (_Any string that the moment library's formatter accepts should work: https://momentjs.com/docs/#/displaying/format/_).
1089
1090```
1091gh re --list --detailed --date "dddd, MMMM Do YYYY, h:mm:ss a"
1092```
1093
1094### Repo: Create
1095
1096| Option | Usage | Type |
1097| ---------------------- | ------------ | ----------- |
1098| `-N`, `--new` | **Required** | `String` |
1099| `-O`, `--organization` | _Optional_ | `String` |
1100| `-c`, `--clone` | _Optional_ | `Boolean` |
1101| `-t`, `--type` | _Optional_ | [`private`] |
1102| `--init` | _Optional_ | `Boolean` |
1103| `--gitignore` | _Optional_ | `String` |
1104| `--homepage` | _Optional_ | `String` |
1105| `--description` | _Optional_ | `String` |
1106
1107#### Examples
1108
1109Create a new GitHub repository and clone on the current directory.
1110
1111```
1112gh re --new foo --clone
1113```
1114
1115Create a new GitHub repository based on the name of the current directory & init with a README
1116
1117```
1118gh re --new --clone --init
1119```
1120
1121Create a new GitHub repository for an organization.
1122
1123```
1124gh re --new foo --organization node-gh
1125```
1126
1127Create a new GitHub repository using .gitignore template for Ruby.
1128
1129```
1130gh re --new gemified --gitignore Ruby
1131```
1132
1133Create a new private repository on GitHub, initializing it with a initial commit of the README.
1134
1135```
1136gh re --new foo --init --type private
1137```
1138
1139### Repo: Fork
1140
1141| Option | Usage | Type |
1142| ---------------------- | ------------ | -------- |
1143| `-f`, `--fork` | **Required** | `String` |
1144| `-u`, `--user` | **Required** | `String` |
1145| `-O`, `--organization` | _Optional_ | `String` |
1146
1147#### Examples
1148
1149Fork a GitHub repository.
1150
1151```
1152gh re --fork repo --user user
1153```
1154
1155Fork a GitHub repository into the node-gh organization.
1156
1157```
1158gh re --fork repo --user user --organization node-gh
1159```
1160
1161### Repo: Delete
1162
1163| Option | Usage | Type |
1164| ---------------- | ------------ | -------- |
1165| `-D`, `--delete` | **Required** | `String` |
1166| `-u`, `--user` | **Required** | `String` |
1167
1168#### Example
1169
1170Delete a repository of the logged user.
1171
1172```
1173gh re --delete foo
1174```
1175
1176### Repo: Clone
1177
1178| Option | Usage | Type |
1179| ---------------------- | ------------ | -------- |
1180| `-c`, `--clone` | **Required** | `String` |
1181| `-r`, `--repo` | **Required** | `String` |
1182| `-O`, `--organization` | _Optional_ | `String` |
1183| `-P`, `--protocol` | _Optional_ | `String` |
1184| `-u`, `--user` | _Optional_ | `String` |
1185
1186> If you have custom ssh config, you can add `"api": { "ssh_host": "custom-name", ... }` to your .gh.json file.
1187
1188#### Examples
1189
1190Clone a repository.
1191
1192```
1193gh re --clone --repo gh
1194```
1195
1196Clone a repository from a specific user using HTTPS protocol.
1197
1198```
1199gh re --clone --user eduardolundgren --repo gh --protocol https
1200```
1201
1202### Repo: Create Label
1203
1204| Option | Usage | Type |
1205| ---------------------- | ------------ | --------- |
1206| `-C`, `--color` | **Required** | `String` |
1207| `-L`, `--label` | **Required** | `Boolean` |
1208| `-N`, `--new` | **Required** | `String` |
1209| `-r`, `--repo` | **Required** | `String` |
1210| `-O`, `--organization` | _Optional_ | `String` |
1211| `-u`, `--user` | _Optional_ | `String` |
1212
1213#### Examples
1214
1215Create a label for a repository (_color is a hex code with or without literal hex symbol_).
1216
1217```
1218gh re --label --new bug --color '#7057ff' --repo gh
1219```
1220
1221Create a label for a user's repository.
1222
1223```
1224gh re --label --new bug --color '#7057ff' --user eduardolundgren --repo gh
1225```
1226
1227### Repo: Delete Label
1228
1229| Option | Usage | Type |
1230| ---------------------- | ------------ | --------- |
1231| `-L`, `--label` | **Required** | `Boolean` |
1232| `-D`, `--delete` | **Required** | `String` |
1233| `-r`, `--repo` | **Required** | `String` |
1234| `-O`, `--organization` | _Optional_ | `String` |
1235| `-u`, `--user` | _Optional_ | `String` |
1236
1237#### Examples
1238
1239Delete a label from a repository.
1240
1241```
1242gh re --label --delete bug --repo gh
1243```
1244
1245Delete a label from a user's repository.
1246
1247```
1248gh re --label --delete bug --user eduardolundgren --repo gh
1249```
1250
1251### Repo: List Labels
1252
1253| Option | Usage | Type |
1254| ---------------------- | ------------ | --------- |
1255| `-L`, `--label` | **Required** | `Boolean` |
1256| `-l`, `--list` | **Required** | `Boolean` |
1257| `-r`, `--repo` | **Required** | `String` |
1258| `-O`, `--organization` | _Optional_ | `String` |
1259| `-u`, `--user` | _Optional_ | `String` |
1260
1261#### Examples
1262
1263List labels for a repository.
1264
1265```
1266gh re --label --list --repo gh
1267```
1268
1269List labels for a user's repository.
1270
1271```
1272gh re --label --list --user eduardolundgren --repo gh
1273```
1274
1275### Repo: Update Label
1276
1277| Option | Usage | Type |
1278| ---------------------- | ------------ | --------- |
1279| `-C`, `--color` | **Required** | `String` |
1280| `-L`, `--label` | **Required** | `Boolean` |
1281| `-r`, `--repo` | **Required** | `String` |
1282| `-U`, `--update` | **Required** | `String` |
1283| `-O`, `--organization` | _Optional_ | `String` |
1284| `-u`, `--user` | _Optional_ | `String` |
1285
1286#### Examples
1287
1288Update a label for a repository (_color is a hex code with or without literal hex symbol_).
1289
1290```
1291gh re --label --update bug --color color --repo gh
1292```
1293
1294Update a label for a user's repository.
1295
1296```
1297gh re --label --update bug --color color --user eduardolundgren --repo gh
1298```
1299
1300### Repo: Search
1301
1302Find repositories via various criteria. Repository search looks through the projects you have access to on GitHub.
1303You can filter the results using GitHub's search qualifiers.
1304[Examples:](https://help.github.com/articles/searching-for-repositories/)
1305
1306| Option | Usage | Type |
1307| ---------------------- | ------------ | ----------------------------------------------- |
1308| `-s`, `--search` | **Required** | `Boolean` |
1309| `-d`, `--detailed` | _Optional_ | `Boolean` |
1310| `-u`, `--user` | _Optional_ | `String` |
1311| `-r`, `--repo` | _Optional_ | `String` |
1312| `-O`, `--organization` | _Optional_ | `String` |
1313| `-t`, `--type` | _Optional_ | [`all`, `owner`, `public`, `private`, `member`] |
1314
1315#### Examples
1316
1317Search private repositories you have access to with the term "secret".
1318
1319```
1320gh re --search secret --type private
1321```
1322
1323OR
1324
1325```
1326gh re --search secret is:private
1327```
1328
1329Matches repositories from GitHub org showing detailed results.
1330
1331```
1332gh re --detailed -o github --search octocat
1333```
1334
1335OR
1336
1337```
1338gh re --detailed --search octocat org:github
1339```
1340
1341## Gists
1342
1343```
1344gh gists
1345```
1346
1347> **Alias:** `gh gi`
1348
1349### Gist: Open in Browser
1350
1351| Option | Usage | Type |
1352| ----------------- | ------------ | --------- |
1353| `-B`, `--browser` | **Required** | `Boolean` |
1354| `-u`, `--user` | _Optional_ | `String` |
1355| `-i`, `--id` | _Optional_ | `String` |
1356
1357#### Examples
1358
1359**Shortcut** for opening your Gists in the browser.
1360
1361```
1362gh gi
1363```
1364
1365Open a Gist in the browser.
1366
1367```
1368gh gi --browser --id 5991877
1369```
1370
1371### Gist: List
1372
1373| Option | Usage | Type |
1374| -------------- | ------------ | --------- |
1375| `-l`, `--list` | **Required** | `Boolean` |
1376| `-u`, `--user` | _Optional_ | `String` |
1377| `--date` | _Optional_ | `String` |
1378
1379#### Examples
1380
1381List all gists.
1382
1383```
1384gh gi --list
1385```
1386
1387List all gists from someone.
1388
1389```
1390gh gi --list --user brunocoelho
1391```
1392
1393List gists with a formatted date (_Any string that the moment library's formatter accepts should work: https://momentjs.com/docs/#/displaying/format/_).
1394
1395```
1396gh gi --list --date "dddd, MMMM Do YYYY, h:mm:ss a"
1397```
1398
1399### Gist: Create
1400
1401| Option | Usage | Type |
1402| --------------------- | ------------ | --------- |
1403| `-N`, `--new` | **Required** | `String` |
1404| `-c`, `--content` | _Optional_ | `String` |
1405| `-d`, `--description` | _Optional_ | `String` |
1406| `-p`, `--private` | _Optional_ | `Boolean` |
1407
1408#### Examples
1409
1410Create a Gist `hello` containing "Hello World".
1411
1412```
1413gh gi --new hello --content "Hello World!"
1414```
1415
1416Create a private Gist `hello` containing "Hello World".
1417
1418```
1419gh gi --new hello --content "Hello World!" --private
1420```
1421
1422### Gist: Fork
1423
1424| Option | Usage | Type |
1425| -------------- | ------------ | -------- |
1426| `-f`, `--fork` | **Required** | `String` |
1427
1428#### Examples
1429
1430Fork a Gist.
1431
1432```
1433gh gi --fork 5444883
1434```
1435
1436### Gist: Delete
1437
1438| Option | Usage | Type |
1439| ---------------- | ------------ | -------- |
1440| `-D`, `--delete` | **Required** | `String` |
1441
1442#### Example
1443
1444Delete a Gist.
1445
1446```
1447gh gi --delete 4252323
1448```
1449
1450Delete multiple Gists.
1451
1452```
1453gh gi --delete 4252321 --delete 4252322
1454```
1455
1456## User
1457
1458```
1459gh user
1460```
1461
1462> **Alias:** `gh us`
1463
1464### User: Login or Logout
1465
1466| Option | Usage | Type |
1467| ---------------- | ------------ | --------- |
1468| `-l`, `--login` | **Required** | `Boolean` |
1469| `-L`, `--logout` | **Required** | `Boolean` |
1470
1471#### Examples
1472
1473Automates saving user name & generating developer token credentials to your ~/.gh.json config
1474
1475- This is the the user that will be used if you do not manually pass in `--user username`
1476- After you are logged in, you should no longer be prompted to go through the login process again
1477- Alternatively you can create your own developer key and copy and paste it
1478 - First add a file in your home directory called `~/.gh.json`
1479 - You can use the `default.gh.json` file in our repo as a template
1480 - [Create a developer key](https://github.com/settings/tokens/new): with these scopes: `['user', 'public_repo', 'repo', 'repo:status', 'delete_repo', 'gist']`
1481 - Then copy & paste your token in the file at: `"github_token"`
1482 - Write your user name at `"github_user"`
1483
1484```
1485gh user --login
1486```
1487
1488Automates removing user name & developer token credentials to your ~/.gh.json config
1489
1490```
1491gh user --logout
1492```
1493
1494### User: Whoami
1495
1496| Option | Usage | Type |
1497| ---------------- | ------------ | --------- |
1498| `-w`, `--whoami` | **Required** | `Boolean` |
1499
1500#### Examples
1501
1502Prints the user name from ~/.gh.json to your console.
1503
1504```
1505gh user --whoami
1506```
1507
1508## Milestones
1509
1510```
1511gh milestone
1512```
1513
1514> **Alias:** `gh ms`
1515
1516### Milestone: List
1517
1518| Option | Usage | Type |
1519| ---------------------- | ------------ | --------- |
1520| `-l`, `--list` | **Required** | `Boolean` |
1521| `-u`, `--user` | _Required_ | `String` |
1522| `-a`, `--all` | _Required_ | `Boolean` |
1523| `-r`, `--repo` | _Optional_ | `String` |
1524| `-o`, `--organization` | _Optional_ | `String` |
1525
1526#### Examples
1527
1528**Shortcut** for listing milestones for a specific repo.
1529
1530```
1531gh ms
1532```
1533
1534Listing milestones for a specific repo & user.
1535
1536```
1537gh ms --list --user node-gh --repo gh
1538```
1539
1540Listing all milestones for a specific organization.
1541
1542```
1543gh ms --list --all --organization node-gh
1544```
1545
1546## Alias
1547
1548This cmd provides something similar to shell aliases. If there are aliases in your .gh.json file, we will attempt to resolve the user, PR forwarder or PR submitter to your alias.
1549
1550```
1551gh alias
1552```
1553
1554> **Alias:** `gh al`
1555
1556### Alias: List
1557
1558| Option | Usage | Type |
1559| -------------- | ------------ | --------- |
1560| `-l`, `--list` | **Required** | `Boolean` |
1561
1562#### Examples
1563
1564**Shortcut** for listing aliases.
1565
1566```
1567gh alias
1568```
1569
1570List aliases.
1571
1572```
1573gh alias --list
1574```
1575
1576### Alias: Add
1577
1578| Option | Usage | Type |
1579| -------------- | ------------ | -------- |
1580| `-a`, `--add` | **Required** | `String` |
1581| `-u`, `--user` | **Required** | `String` |
1582
1583#### Examples
1584
1585Create alias for username.
1586
1587```
1588gh alias --add zeno --user zenorocha
1589```
1590
1591And use like:
1592
1593```
1594gh pr --submit zeno -b master -t Title
1595```
1596
1597### Alias: Remove
1598
1599| Option | Usage | Type |
1600| ---------------- | ------------ | -------- |
1601| `-r`, `--remove` | **Required** | `String` |
1602
1603#### Examples
1604
1605Remove alias.
1606
1607```
1608gh alias --remove zeno
1609```
1610
1611## Config
1612
1613There are some pretty useful configurations that you can set on [.gh.json](default.gh.json).
1614This file can be found under home directory _(on MacOSx: `/Users/yourName/.gh.json` on Windows: `C:\\Users\yourName\.gh.json`)_.
1615
1616You can also set per-project configurations by adding a `.gh.json` file in your project's root folder and overriding existing keys.
1617
1618### GitHub API configurations.
1619
1620Change it if you're a [GitHub Enterprise](https://enterprise.github.com/) user.
1621
1622```javascript
1623"api": {
1624 "host": "github.mydomain.com",
1625 "protocol": "https"
1626}
1627```
1628
1629### Set Pagination Rules
1630
1631- For list based commands (_like listing prs, issues, or repos_) we **default to 30**
1632- That means if you ran `gh pr` you would see a max of 30 pull requests
1633- If you would like to see more, we will prompt you in your terminal to see the next batch
1634- You can set your page size up from `1` to `100`
1635
1636```json
1637"page_size": 77
1638```
1639
1640- If you want to remove the limit & set it to the maximum, use an empty string
1641
1642```json
1643"page_size": ""
1644```
1645
1646### Set default branch and remote.
1647
1648```javascript
1649"default_branch": "master",
1650"default_remote": "origin"
1651```
1652
1653### Set default users
1654
1655For [submitting](#pr-submit) or [forwarding](#pr-forward) pull requests.
1656
1657```javascript
1658"default_pr_forwarder": "",
1659"default_pr_reviewer": ""
1660```
1661
1662### Update GitHub credentials manually
1663
1664```javascript
1665"github_token": "your_dev_token",
1666"github_user": "username"
1667```
1668
1669### Run automated tasks before or after a certain command.
1670
1671```javascript
1672"hooks": {
1673 "pull-request": {
1674 "merge": {
1675 "before": [{"cmd": "ls -la", "log": true}],
1676 "after": [
1677 "gh pr {{options.number}} --comment 'Thank you, pull request merged :D'"
1678 ]
1679 }
1680 }
1681}
1682```
1683
1684### Run automated tasks passing arguments to the commands.
1685
1686Required for prompt commands.
1687
1688```javascript
1689"hooks": {
1690 "pull-request": {
1691 "merge": {
1692 "before": [{"cmd": "foo", "args": ["bar", "qux"]}]
1693 }
1694 }
1695}
1696```
1697
1698### Set default branch name prefix for PR fetching.
1699
1700```javascript
1701"pull_branch_name_prefix": "pr-"
1702```
1703
1704### Set default editor to use when creating a new message
1705
1706- For certain tasks like opening a pull request when you omit the title or description, we will open a new file for you to create the message in.
1707- We first check enviroment variables for the default editor: `$EDITOR` or `$VISUAL` and fallback to the default git editor `git config --global core.editor`
1708- To **disable** this functionality of opening your editor add `"use_editor": false` to `~/.gh.json`
1709
1710### Insert signature below issue comment.
1711
1712```javascript
1713"signature": "<br><br>:octocat: *Sent from [GH](http://nodegh.io).*"
1714```
1715
1716### Turn off ssh when pulling a repo and use https instead.
1717
1718```javascript
1719"ssh": false,
1720```
1721
1722If you need to use a custom git command, set the environment variable `GH_GIT_COMMAND`.
1723
1724## Plugins
1725
1726[GH Gif](https://github.com/node-gh/gh-gif) - A plugin for commenting on pull requests/issues using GIF reactions.
1727[GH Travis](https://github.com/node-gh/gh-travis) - A plugin for integrating Travis, a continous integration server.
1728[GH Jira](https://github.com/node-gh/gh-jira) - A plugin for integrating Jira, an issue management system.
1729
1730Feel free to create your own plugins by forking [GH Boilerplate](https://github.com/node-gh/gh-boilerplate).