UNPKG

73.2 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 git editor (`git config --global core.editor`) by passing an empty `--comment`
523
524- To disable this functionality of opening your editor add `"use_editor": false` to `~/.gh.json`
525
526```
527gh pr 1 --comment
528```
529
530### PR Forward
531
532| Option | Usage | Type |
533| ---------------- | ------------ | -------- |
534| `--fwd` | **Required** | `String` |
535| `-n`, `--number` | **Required** | `Number` |
536
537Omitting a value for `--fwd` fallbacks to the `default_pr_forwarder` key found
538in your [config file](#config).
539
540#### Examples
541
542Forward a pull request to another reviewer.
543
544```
545gh pr 1 --fwd username
546```
547
548### PR: Open or Close
549
550| Option | Usage | Type |
551| ---------------- | ------------ | --------- |
552| `-o`, `--open` | **Required** | `Boolean` |
553| `-C`, `--close` | **Required** | `Boolean` |
554| `-n`, `--number` | **Required** | `Number` |
555| `--remote` | _Optional_ | `String` |
556| `-r`, `--repo` | _Optional_ | `String` |
557| `-u`, `--user` | _Optional_ | `String` |
558
559#### Examples
560
561Open a pull request.
562
563```
564gh pr 1 --open
565```
566
567Close a pull request.
568
569```
570gh pr 1 --close
571```
572
573Close multiple pull requests.
574
575```
576gh pr --close --number 1 --number 2
577```
578
579Open multiple pull requests.
580
581```
582gh pr --open --number 1 --number 2
583```
584
585Open or close a pull request that you've sent to someone.
586
587```
588gh pr 1 --close --user eduardolundgren
589```
590
591### PR: Submit
592
593| Option | Usage | Type |
594| --------------------- | ------------ | -------- |
595| `-s`, `--submit` | **Required** | `String` |
596| `-b`, `--branch` | _Optional_ | `String` |
597| `-D`, `--description` | _Optional_ | `String` |
598| `-i`, `--issue` | _Optional_ | `Number` |
599| `-r`, `--repo` | _Optional_ | `String` |
600| `-t`, `--title` | _Optional_ | `String` |
601
602Omitting a value for `--submit` fallbacks to the `default_pr_reviewer` key found
603in your [config file](#config). Omitting `--title` will submit a pull request
604using the last commit message as title.
605
606#### Examples
607
608Submit a pull request using the current branch.
609
610```
611gh pr --submit eduardolundgren --title 'Fix #32' --description 'Awesome fix'
612```
613
614Submit a pull request using your default git editor (`git config --global core.editor`) by passing an empty `--title` and or `--description`
615
616- To disable this functionality of opening your editor add `"use_editor": false` to `~/.gh.json`
617
618```
619gh pr --submit eduardolundgren --title --description
620```
621
622Submit a pull request using the current branch to dev branch.
623
624```
625gh pr --submit eduardolundgren --branch dev
626```
627
628Submit a pull request from a issue.
629
630```
631gh pr --submit eduardolundgren --issue 150
632```
633
634Submit a pull request in draft state.
635
636```
637gh pr --submit eduardolundgren --draft
638```
639
640### PR: Open in Browser
641
642| Option | Usage | Type |
643| ----------------- | ------------ | --------- |
644| `-B`, `--browser` | **Required** | `Boolean` |
645| `-n`, `--number` | **Required** | `Number` |
646| `-u`, `--user` | _Optional_ | `String` |
647| `-r`, `--repo` | _Optional_ | `String` |
648
649#### Examples
650
651Open GitHub pull request page in the browser.
652
653```
654gh pr 100 --browser
655```
656
657## Notifications
658
659```
660gh notification
661```
662
663> **Alias:** `gh nt`
664
665### Notifications: Latest
666
667| Option | Usage | Type |
668| ---------------- | ------------ | --------- |
669| `-l`, `--latest` | **Required** | `Boolean` |
670| `--remote` | _Optional_ | `String` |
671| `-r`, `--repo` | _Optional_ | `String` |
672| `-u`, `--user` | _Optional_ | `String` |
673| `--date` | _Optional_ | `String` |
674
675#### Examples
676
677**Shortcut** for displaying the latest activities on the current repository.
678
679```
680gh nt
681```
682
683Display the latest activities on a certain repository.
684
685```
686gh nt --latest --user eduardolundgren --repo node-gh
687```
688
689Diplay notifications with a formatted date (_Any string that the moment library's formatter accepts should work: https://momentjs.com/docs/#/displaying/format/_).
690
691```
692gh nt --date "dddd, MMMM Do YYYY, h:mm:ss a"
693```
694
695### Notifications: Watch
696
697| Option | Usage | Type |
698| --------------- | ------------ | --------- |
699| `-w`, `--watch` | **Required** | `Boolean` |
700| `--remote` | _Optional_ | `String` |
701| `-r`, `--repo` | _Optional_ | `String` |
702| `-u`, `--user` | _Optional_ | `String` |
703
704#### Examples
705
706Watch for any activity on the current repository.
707
708```
709gh nt --watch
710```
711
712Watch for any activity on a certain repository.
713
714```
715gh nt --watch --user eduardolundgren --repo node-gh
716```
717
718## Issues
719
720```
721gh issue
722```
723
724> **Alias:** `gh is`
725
726### Issue: Create
727
728| Option | Usage | Type |
729| ------------------ | ------------ | --------- |
730| `-N`, `--new` | **Required** | `Boolean` |
731| `-t`, `--title` | **Required** | `String` |
732| `-A`, `--assignee` | _Optional_ | `String` |
733| `-L`, `--labels` | _Optional_ | `String` |
734| `-m`, `--message` | _Optional_ | `String` |
735| `--remote` | _Optional_ | `String` |
736| `-r`, `--repo` | _Optional_ | `String` |
737| `-u`, `--user` | _Optional_ | `String` |
738
739#### Examples
740
741**Shortcut** for creating a new issue on the current repository.
742
743```
744gh is 'Node GH rocks!' 'Body with **Markdown** support'
745```
746
747Create a new issue using your default git editor (`git config --global core.editor`) by passing an empty `--message` (_also works with an empty title_)
748
749- To disable this functionality of opening your editor add `"use_editor": false` to `~/.gh.json`
750
751```
752gh is --new --title 'Node GH rocks!' --message
753```
754
755Create a new issue on a certain repository.
756
757```
758gh is --new --title 'Node GH rocks!' --message 'Body with **Markdown** support' --user eduardolundgren --repo node-gh
759```
760
761Create a new issue with labels.
762
763```
764gh is --new --title 'Node GH rocks!' --labels bug,question,test
765```
766
767Create a new issue and assign it to someone.
768
769```
770gh is --new --title 'Node GH rocks!' --assignee zenorocha
771```
772
773### Issue: Comment
774
775| Option | Usage | Type |
776| ----------------- | ------------ | -------- |
777| `-c`, `--comment` | **Required** | `String` |
778| `-n`, `--number` | **Required** | `Number` |
779| `--remote` | _Optional_ | `String` |
780| `-r`, `--repo` | _Optional_ | `String` |
781| `-u`, `--user` | _Optional_ | `String` |
782
783#### Examples
784
785Comment on an issue of the current repository.
786
787```
788gh is 1 --comment 'Node GH rocks!'
789```
790
791Comment on an issue using your default git editor (`git config --global core.editor`) by passing an empty `--comment` (_also works with an empty title_)
792
793- To disable this functionality of opening your editor add `"use_editor": false` to `~/.gh.json`
794
795```
796gh is 1 --comment
797```
798
799Comment on an issue of a certain repository.
800
801```
802gh is 1 --comment 'Node GH rocks!' --user eduardolundgren --repo node-gh
803```
804
805### Issue: Open or Close
806
807| Option | Usage | Type |
808| ---------------- | ------------ | --------- |
809| `-o`, `--open` | **Required** | `Boolean` |
810| `-C`, `--close` | **Required** | `Boolean` |
811| `-n`, `--number` | **Required** | `Number` |
812| `--remote` | _Optional_ | `String` |
813| `-r`, `--repo` | _Optional_ | `String` |
814| `-u`, `--user` | _Optional_ | `String` |
815
816#### Examples
817
818Open an issue.
819
820```
821gh is 1 --open
822```
823
824Close an issue.
825
826```
827gh is 1 --close
828```
829
830Close multiple issues.
831
832```
833gh is --close --number 1 --number 2
834```
835
836Open multiple issues.
837
838```
839gh is --open --number 1 --number 2
840```
841
842Open or close an issue that you've sent to someone.
843
844```
845gh is 1 --close --user eduardolundgren
846```
847
848### Issue: List
849
850| Option | Usage | Type |
851| ------------------- | ------------ | -------------------- |
852| `-l`, `--list` | **Required** | `Boolean` |
853| `-a`, `--all` | _Optional_ | `Boolean` |
854| `-A`, `--assignee` | _Optional_ | `String` |
855| `--date` | _Optional_ | `String` |
856| `-d`, `--detailed` | _Optional_ | `Boolean` |
857| `-L`, `--labels` | _Optional_ | `String` |
858| `-M`, `--milestone` | _Optional_ | [`Number`, `String`] |
859| `--remote` | _Optional_ | `String` |
860| `-r`, `--repo` | _Optional_ | `String` |
861| `-S`, `--state` | _Optional_ | [`open`, `closed`] |
862| `-u`, `--user` | _Optional_ | `String` |
863
864- To adjust [pagination rules](#set-pagination-rules)
865
866#### Examples
867
868**Shortcut** for listing all issues on the current repository.
869
870```
871gh is
872```
873
874List all issues from all repositories.
875
876```
877gh is --list --all
878```
879
880List issues assigned to someone.
881
882```
883gh is --list --assignee zenorocha
884```
885
886List issues with link and content.
887
888```
889gh is --list --detailed
890```
891
892List only closed issues on the current repository.
893
894```
895gh is --list --state closed
896```
897
898List issues with a formatted date (_Any string that the moment library's formatter accepts should work: https://momentjs.com/docs/#/displaying/format/_).
899
900```
901gh is --list --date "dddd, MMMM Do YYYY, h:mm:ss a"
902```
903
904List issues filtered by milestone title.
905
906```
907gh is --list --milestone "milestone title"
908```
909
910List issues that contains labels `todo` and `bug`.
911
912```
913gh is --list --labels todo,bug
914```
915
916List all issues on a certain repository.
917
918```
919gh is --list --user eduardolundgren --repo node-gh
920```
921
922### Issue: Open in Browser
923
924| Option | Usage | Type |
925| ----------------- | ------------ | --------- |
926| `-B`, `--browser` | **Required** | `Boolean` |
927| `-n`, `--number` | **Required** | `Number` |
928| `-u`, `--user` | _Optional_ | `String` |
929| `-r`, `--repo` | _Optional_ | `String` |
930
931#### Examples
932
933**Shortcut** for opening GitHub issue page in the browser.
934
935```
936gh is 100
937```
938
939Open GitHub issue page in the browser.
940
941```
942gh is 100 --browser
943```
944
945### Issue: Lock
946
947| Option | Usage | Type |
948| ---------------- | ------------ | ----------------------------------------------- |
949| `--lock` | **Required** | `Boolean` |
950| `--lock-reason` | _Optional_ | [`off-topic`, `too heated`, `resolved`, `spam`] |
951| `-n`, `--number` | **Required** | `Number` |
952| `--remote` | _Optional_ | `String` |
953| `-r`, `--repo` | _Optional_ | `String` |
954| `-u`, `--user` | _Optional_ | `String` |
955
956#### Examples
957
958Lock issue on the current repository.
959
960```
961gh is 1 --lock
962```
963
964Lock issue on the current repository with a reason.
965
966```
967gh is 1 --lock --lock-reason resolved
968```
969
970### Issue: Search
971
972| Option | Usage | Type |
973| ------------------ | ------------ | --------- |
974| `-s`, `--search` | **Required** | `Boolean` |
975| `-a`, `--all` | _Optional_ | `Boolean` |
976| `-d`, `--detailed` | _Optional_ | `Boolean` |
977| `-r`, `--repo` | _Optional_ | `String` |
978| `-u`, `--user` | _Optional_ | `String` |
979
980#### Examples
981
982Search issues in current repository
983
984```
985gh is --search 'term'
986```
987
988Search issues in all repositories for a user
989
990```
991gh is --all --user node-gh --search 'term'
992```
993
994Search issues in a repository for a user
995
996```
997gh is --user node-gh --repo gh --search 'term'
998```
999
1000Search issues in a repository for a user with link and content
1001
1002```
1003gh is --user node-gh --repo gh --search 'term'
1004```
1005
1006Search issues with github filters
1007
1008```
1009gh is --user node-gh --repo gh --search 'updated:<=2013-05-24'
1010```
1011
1012### Issue: Assign
1013
1014| Option | Usage | Type |
1015| ------------------ | ------------ | --------- |
1016| `--assign` | **Required** | `Boolean` |
1017| `-A`, `--assignee` | **Required** | `String` |
1018| `-n`, `--number` | **Required** | `Number` |
1019| `-r`, `--repo` | _Optional_ | `String` |
1020| `-u`, `--user` | _Optional_ | `String` |
1021
1022#### Examples
1023
1024Assign an issue on the current repository to a user.
1025
1026```
1027gh is --assign --assignee zenorocha --number 1
1028```
1029
1030Assign an issue on a specific repository to a user.
1031
1032```
1033gh is --assign --assignee zenorocha --number 1 --user eduardolundgren --repo gh
1034```
1035
1036## Repo
1037
1038```
1039gh repo
1040```
1041
1042> **Alias:** `gh re`
1043
1044### Repo: Open in Browser
1045
1046| Option | Usage | Type |
1047| ----------------- | ------------ | --------- |
1048| `-B`, `--browser` | **Required** | `Boolean` |
1049| `-u`, `--user` | _Optional_ | `String` |
1050| `-r`, `--repo` | _Optional_ | `String` |
1051
1052#### Examples
1053
1054**Shortcut** for opening the GitHub repository page in the browser.
1055
1056```
1057gh re
1058```
1059
1060Open GitHub repository page in the browser.
1061
1062```
1063gh re --browser --user eduardolundgren --repo node-gh
1064```
1065
1066### Repo: List
1067
1068| Option | Usage | Type |
1069| ------------------ | ------------ | ----------------------------------------------- |
1070| `-l`, `--list` | **Required** | `Boolean` |
1071| `-d`, `--detailed` | _Optional_ | `Boolean` |
1072| `-u`, `--user` | _Optional_ | `String` |
1073| `-t`, `--type` | _Optional_ | [`all`, `owner`, `public`, `private`, `member`] |
1074| `--date` | _Optional_ | `String` |
1075
1076#### Examples
1077
1078List all repositories.
1079
1080```
1081gh re --list
1082```
1083
1084List all private repositories.
1085
1086```
1087gh re --list --type private
1088```
1089
1090List all repositories from someone.
1091
1092```
1093gh re --list --user zenorocha
1094```
1095
1096List open repositories with a formatted date (_Any string that the moment library's formatter accepts should work: https://momentjs.com/docs/#/displaying/format/_).
1097
1098```
1099gh re --list --detailed --date "dddd, MMMM Do YYYY, h:mm:ss a"
1100```
1101
1102### Repo: Create
1103
1104| Option | Usage | Type |
1105| ---------------------- | ------------ | ----------- |
1106| `-N`, `--new` | **Required** | `String` |
1107| `-O`, `--organization` | _Optional_ | `String` |
1108| `-c`, `--clone` | _Optional_ | `Boolean` |
1109| `-t`, `--type` | _Optional_ | [`private`] |
1110| `--init` | _Optional_ | `Boolean` |
1111| `--gitignore` | _Optional_ | `String` |
1112| `--homepage` | _Optional_ | `String` |
1113| `--description` | _Optional_ | `String` |
1114
1115#### Examples
1116
1117Create a new GitHub repository and clone on the current directory.
1118
1119```
1120gh re --new foo --clone
1121```
1122
1123Create a new GitHub repository based on the name of the current directory & init with a README
1124
1125```
1126gh re --new --clone --init
1127```
1128
1129Create a new GitHub repository for an organization.
1130
1131```
1132gh re --new foo --organization node-gh
1133```
1134
1135Create a new GitHub repository using .gitignore template for Ruby.
1136
1137```
1138gh re --new gemified --gitignore Ruby
1139```
1140
1141Create a new private repository on GitHub, initializing it with a initial commit of the README.
1142
1143```
1144gh re --new foo --init --type private
1145```
1146
1147### Repo: Fork
1148
1149| Option | Usage | Type |
1150| ---------------------- | ------------ | -------- |
1151| `-f`, `--fork` | **Required** | `String` |
1152| `-u`, `--user` | **Required** | `String` |
1153| `-O`, `--organization` | _Optional_ | `String` |
1154
1155#### Examples
1156
1157Fork a GitHub repository.
1158
1159```
1160gh re --fork repo --user user
1161```
1162
1163Fork a GitHub repository into the node-gh organization.
1164
1165```
1166gh re --fork repo --user user --organization node-gh
1167```
1168
1169### Repo: Delete
1170
1171| Option | Usage | Type |
1172| ---------------- | ------------ | -------- |
1173| `-D`, `--delete` | **Required** | `String` |
1174| `-u`, `--user` | **Required** | `String` |
1175
1176#### Example
1177
1178Delete a repository of the logged user.
1179
1180```
1181gh re --delete foo
1182```
1183
1184### Repo: Clone
1185
1186| Option | Usage | Type |
1187| ---------------------- | ------------ | -------- |
1188| `-c`, `--clone` | **Required** | `String` |
1189| `-r`, `--repo` | **Required** | `String` |
1190| `-O`, `--organization` | _Optional_ | `String` |
1191| `-P`, `--protocol` | _Optional_ | `String` |
1192| `-u`, `--user` | _Optional_ | `String` |
1193
1194> If you have custom ssh config, you can add `"api": { "ssh_host": "custom-name", ... }` to your .gh.json file.
1195
1196#### Examples
1197
1198Clone a repository.
1199
1200```
1201gh re --clone --repo gh
1202```
1203
1204Clone a repository from a specific user using HTTPS protocol.
1205
1206```
1207gh re --clone --user eduardolundgren --repo gh --protocol https
1208```
1209
1210### Repo: Create Label
1211
1212| Option | Usage | Type |
1213| ---------------------- | ------------ | --------- |
1214| `-C`, `--color` | **Required** | `String` |
1215| `-L`, `--label` | **Required** | `Boolean` |
1216| `-N`, `--new` | **Required** | `String` |
1217| `-r`, `--repo` | **Required** | `String` |
1218| `-O`, `--organization` | _Optional_ | `String` |
1219| `-u`, `--user` | _Optional_ | `String` |
1220
1221#### Examples
1222
1223Create a label for a repository (_color is a hex code with or without literal hex symbol_).
1224
1225```
1226gh re --label --new bug --color '#7057ff' --repo gh
1227```
1228
1229Create a label for a user's repository.
1230
1231```
1232gh re --label --new bug --color '#7057ff' --user eduardolundgren --repo gh
1233```
1234
1235### Repo: Delete Label
1236
1237| Option | Usage | Type |
1238| ---------------------- | ------------ | --------- |
1239| `-L`, `--label` | **Required** | `Boolean` |
1240| `-D`, `--delete` | **Required** | `String` |
1241| `-r`, `--repo` | **Required** | `String` |
1242| `-O`, `--organization` | _Optional_ | `String` |
1243| `-u`, `--user` | _Optional_ | `String` |
1244
1245#### Examples
1246
1247Delete a label from a repository.
1248
1249```
1250gh re --label --delete bug --repo gh
1251```
1252
1253Delete a label from a user's repository.
1254
1255```
1256gh re --label --delete bug --user eduardolundgren --repo gh
1257```
1258
1259### Repo: List Labels
1260
1261| Option | Usage | Type |
1262| ---------------------- | ------------ | --------- |
1263| `-L`, `--label` | **Required** | `Boolean` |
1264| `-l`, `--list` | **Required** | `Boolean` |
1265| `-r`, `--repo` | **Required** | `String` |
1266| `-O`, `--organization` | _Optional_ | `String` |
1267| `-u`, `--user` | _Optional_ | `String` |
1268
1269#### Examples
1270
1271List labels for a repository.
1272
1273```
1274gh re --label --list --repo gh
1275```
1276
1277List labels for a user's repository.
1278
1279```
1280gh re --label --list --user eduardolundgren --repo gh
1281```
1282
1283### Repo: Update Label
1284
1285| Option | Usage | Type |
1286| ---------------------- | ------------ | --------- |
1287| `-C`, `--color` | **Required** | `String` |
1288| `-L`, `--label` | **Required** | `Boolean` |
1289| `-r`, `--repo` | **Required** | `String` |
1290| `-U`, `--update` | **Required** | `String` |
1291| `-O`, `--organization` | _Optional_ | `String` |
1292| `-u`, `--user` | _Optional_ | `String` |
1293
1294#### Examples
1295
1296Update a label for a repository (_color is a hex code with or without literal hex symbol_).
1297
1298```
1299gh re --label --update bug --color color --repo gh
1300```
1301
1302Update a label for a user's repository.
1303
1304```
1305gh re --label --update bug --color color --user eduardolundgren --repo gh
1306```
1307
1308### Repo: Search
1309
1310Find repositories via various criteria. Repository search looks through the projects you have access to on GitHub.
1311You can filter the results using GitHub's search qualifiers.
1312[Examples:](https://help.github.com/articles/searching-for-repositories/)
1313
1314| Option | Usage | Type |
1315| ---------------------- | ------------ | ----------------------------------------------- |
1316| `-s`, `--search` | **Required** | `Boolean` |
1317| `-d`, `--detailed` | _Optional_ | `Boolean` |
1318| `-u`, `--user` | _Optional_ | `String` |
1319| `-r`, `--repo` | _Optional_ | `String` |
1320| `-O`, `--organization` | _Optional_ | `String` |
1321| `-t`, `--type` | _Optional_ | [`all`, `owner`, `public`, `private`, `member`] |
1322
1323#### Examples
1324
1325Search private repositories you have access to with the term "secret".
1326
1327```
1328gh re --search secret --type private
1329```
1330
1331OR
1332
1333```
1334gh re --search secret is:private
1335```
1336
1337Matches repositories from GitHub org showing detailed results.
1338
1339```
1340gh re --detailed -o github --search octocat
1341```
1342
1343OR
1344
1345```
1346gh re --detailed --search octocat org:github
1347```
1348
1349## Gists
1350
1351```
1352gh gists
1353```
1354
1355> **Alias:** `gh gi`
1356
1357### Gist: Open in Browser
1358
1359| Option | Usage | Type |
1360| ----------------- | ------------ | --------- |
1361| `-B`, `--browser` | **Required** | `Boolean` |
1362| `-u`, `--user` | _Optional_ | `String` |
1363| `-i`, `--id` | _Optional_ | `String` |
1364
1365#### Examples
1366
1367**Shortcut** for opening your Gists in the browser.
1368
1369```
1370gh gi
1371```
1372
1373Open a Gist in the browser.
1374
1375```
1376gh gi --browser --id 5991877
1377```
1378
1379### Gist: List
1380
1381| Option | Usage | Type |
1382| -------------- | ------------ | --------- |
1383| `-l`, `--list` | **Required** | `Boolean` |
1384| `-u`, `--user` | _Optional_ | `String` |
1385| `--date` | _Optional_ | `String` |
1386
1387#### Examples
1388
1389List all gists.
1390
1391```
1392gh gi --list
1393```
1394
1395List all gists from someone.
1396
1397```
1398gh gi --list --user brunocoelho
1399```
1400
1401List gists with a formatted date (_Any string that the moment library's formatter accepts should work: https://momentjs.com/docs/#/displaying/format/_).
1402
1403```
1404gh gi --list --date "dddd, MMMM Do YYYY, h:mm:ss a"
1405```
1406
1407### Gist: Create
1408
1409| Option | Usage | Type |
1410| --------------------- | ------------ | --------- |
1411| `-N`, `--new` | **Required** | `String` |
1412| `-c`, `--content` | _Optional_ | `String` |
1413| `-d`, `--description` | _Optional_ | `String` |
1414| `-p`, `--private` | _Optional_ | `Boolean` |
1415
1416#### Examples
1417
1418Create a Gist `hello` containing "Hello World".
1419
1420```
1421gh gi --new hello --content "Hello World!"
1422```
1423
1424Create a private Gist `hello` containing "Hello World".
1425
1426```
1427gh gi --new hello --content "Hello World!" --private
1428```
1429
1430### Gist: Fork
1431
1432| Option | Usage | Type |
1433| -------------- | ------------ | -------- |
1434| `-f`, `--fork` | **Required** | `String` |
1435
1436#### Examples
1437
1438Fork a Gist.
1439
1440```
1441gh gi --fork 5444883
1442```
1443
1444### Gist: Delete
1445
1446| Option | Usage | Type |
1447| ---------------- | ------------ | -------- |
1448| `-D`, `--delete` | **Required** | `String` |
1449
1450#### Example
1451
1452Delete a Gist.
1453
1454```
1455gh gi --delete 4252323
1456```
1457
1458Delete multiple Gists.
1459
1460```
1461gh gi --delete 4252321 --delete 4252322
1462```
1463
1464## User
1465
1466```
1467gh user
1468```
1469
1470> **Alias:** `gh us`
1471
1472### User: Login or Logout
1473
1474| Option | Usage | Type |
1475| ---------------- | ------------ | --------- |
1476| `-l`, `--login` | **Required** | `Boolean` |
1477| `-L`, `--logout` | **Required** | `Boolean` |
1478
1479#### Examples
1480
1481Automates saving user name & generating developer token credentials to your ~/.gh.json config
1482
1483- This is the the user that will be used if you do not manually pass in `--user username`
1484- After you are logged in, you should no longer be prompted to go through the login process again
1485- Alternatively you can create your own developer key and copy and paste it
1486 - First add a file in your home directory called `~/.gh.json`
1487 - You can use the `default.gh.json` file in our repo as a template
1488 - [Create a developer key](https://github.com/settings/tokens/new): with these scopes: `['user', 'public_repo', 'repo', 'repo:status', 'delete_repo', 'gist']`
1489 - Then copy & paste your token in the file at: `"github_token"`
1490 - Write your user name at `"github_user"`
1491
1492```
1493gh user --login
1494```
1495
1496Automates removing user name & developer token credentials to your ~/.gh.json config
1497
1498```
1499gh user --logout
1500```
1501
1502### User: Whoami
1503
1504| Option | Usage | Type |
1505| ---------------- | ------------ | --------- |
1506| `-w`, `--whoami` | **Required** | `Boolean` |
1507
1508#### Examples
1509
1510Prints the user name from ~/.gh.json to your console.
1511
1512```
1513gh user --whoami
1514```
1515
1516## Milestones
1517
1518```
1519gh milestone
1520```
1521
1522> **Alias:** `gh ms`
1523
1524### Milestone: List
1525
1526| Option | Usage | Type |
1527| ---------------------- | ------------ | --------- |
1528| `-l`, `--list` | **Required** | `Boolean` |
1529| `-u`, `--user` | _Required_ | `String` |
1530| `-a`, `--all` | _Required_ | `Boolean` |
1531| `-r`, `--repo` | _Optional_ | `String` |
1532| `-o`, `--organization` | _Optional_ | `String` |
1533
1534#### Examples
1535
1536**Shortcut** for listing milestones for a specific repo.
1537
1538```
1539gh ms
1540```
1541
1542Listing milestones for a specific repo & user.
1543
1544```
1545gh ms --list --user node-gh --repo gh
1546```
1547
1548Listing all milestones for a specific organization.
1549
1550```
1551gh ms --list --all --organization node-gh
1552```
1553
1554## Alias
1555
1556This 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.
1557
1558```
1559gh alias
1560```
1561
1562> **Alias:** `gh al`
1563
1564### Alias: List
1565
1566| Option | Usage | Type |
1567| -------------- | ------------ | --------- |
1568| `-l`, `--list` | **Required** | `Boolean` |
1569
1570#### Examples
1571
1572**Shortcut** for listing aliases.
1573
1574```
1575gh alias
1576```
1577
1578List aliases.
1579
1580```
1581gh alias --list
1582```
1583
1584### Alias: Add
1585
1586| Option | Usage | Type |
1587| -------------- | ------------ | -------- |
1588| `-a`, `--add` | **Required** | `String` |
1589| `-u`, `--user` | **Required** | `String` |
1590
1591#### Examples
1592
1593Create alias for username.
1594
1595```
1596gh alias --add zeno --user zenorocha
1597```
1598
1599And use like:
1600
1601```
1602gh pr --submit zeno -b master -t Title
1603```
1604
1605### Alias: Remove
1606
1607| Option | Usage | Type |
1608| ---------------- | ------------ | -------- |
1609| `-r`, `--remove` | **Required** | `String` |
1610
1611#### Examples
1612
1613Remove alias.
1614
1615```
1616gh alias --remove zeno
1617```
1618
1619## Config
1620
1621There are some pretty useful configurations that you can set on [.gh.json](default.gh.json).
1622This file can be found under home directory _(on MacOSx: `/Users/yourName/.gh.json` on Windows: `C:\\Users\yourName\.gh.json`)_.
1623
1624You can also set per-project configurations by adding a `.gh.json` file in your project's root folder and overriding existing keys.
1625
1626### GitHub API configurations.
1627
1628Change it if you're a [GitHub Enterprise](https://enterprise.github.com/) user.
1629
1630```javascript
1631"api": {
1632 "host": "github.mydomain.com",
1633 "protocol": "https"
1634}
1635```
1636
1637### Set Pagination Rules
1638
1639- For list based commands (_like listing prs, issues, or repos_) we **default to 30**
1640- That means if you ran `gh pr` you would see a max of 30 pull requests
1641- If you would like to see more, we will prompt you in your terminal to see the next batch
1642- You can set your page size up from `1` to `100`
1643
1644```json
1645"page_size": 77
1646```
1647
1648- If you want to remove the limit & set it to the maximum, use an empty string
1649
1650```json
1651"page_size": ""
1652```
1653
1654### Set default branch and remote.
1655
1656```javascript
1657"default_branch": "master",
1658"default_remote": "origin"
1659```
1660
1661### Set default users
1662
1663For [submitting](#pr-submit) or [forwarding](#pr-forward) pull requests.
1664
1665```javascript
1666"default_pr_forwarder": "",
1667"default_pr_reviewer": ""
1668```
1669
1670### Update GitHub credentials manually
1671
1672```javascript
1673"github_token": "your_dev_token",
1674"github_user": "username"
1675```
1676
1677### Run automated tasks before or after a certain command.
1678
1679```javascript
1680"hooks": {
1681 "pull-request": {
1682 "merge": {
1683 "before": [{"cmd": "ls -la", "log": true}],
1684 "after": [
1685 "gh pr {{options.number}} --comment 'Thank you, pull request merged :D'"
1686 ]
1687 }
1688 }
1689}
1690```
1691
1692### Run automated tasks passing arguments to the commands.
1693
1694Required for prompt commands.
1695
1696```javascript
1697"hooks": {
1698 "pull-request": {
1699 "merge": {
1700 "before": [{"cmd": "foo", "args": ["bar", "qux"]}]
1701 }
1702 }
1703}
1704```
1705
1706### Set default branch name prefix for PR fetching.
1707
1708```javascript
1709"pull_branch_name_prefix": "pr-"
1710```
1711
1712### Insert signature below issue comment.
1713
1714```javascript
1715"signature": "<br><br>:octocat: *Sent from [GH](http://nodegh.io).*"
1716```
1717
1718### Turn off ssh when pulling a repo and use https instead.
1719
1720```javascript
1721"ssh": false,
1722```
1723
1724If you need to use a custom git command, set the environment variable `GH_GIT_COMMAND`.
1725
1726## Plugins
1727
1728[GH Gif](https://github.com/node-gh/gh-gif) - A plugin for commenting on pull requests/issues using GIF reactions.
1729[GH Travis](https://github.com/node-gh/gh-travis) - A plugin for integrating Travis, a continous integration server.
1730[GH Jira](https://github.com/node-gh/gh-jira) - A plugin for integrating Jira, an issue management system.
1731
1732Feel free to create your own plugins by forking [GH Boilerplate](https://github.com/node-gh/gh-boilerplate).