UNPKG

70.7 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>
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- [`--open` | `--close` - Open or Close an issue](#issue-open-or-close)
61- [`--list` - List issues on a repository](#issue-list)
62- [`--browser` - Open GitHub issue page in the browser](#issue-open-in-browser)
63- [`--search` - Search issues in current repository](#issue-search)
64- [`--assign` - Assign an issue on a repository to a user](#issue-assign)
65 </details>
66
67<details><summary>Repos `re`</summary>
68
69- [`--browser` - Open the GitHub repository page in the browser](#repo-open-in-browser)
70- [`--list` - List repos](#repo-list)
71- [`--create` - Create a new GitHub repository and clone on the current directory](#repo-create)
72- [`--fork` - Fork a GitHub repository](#repo-fork)
73- [`--delete` - Delete a repository of specified user](#repo-delete)
74- [`--clone` - Clone a repository](#repo-clone)
75- [`--label --new` - Create or delete a label for a repository](#repo-create-label)
76- [`--label --delete` - Delete a label for a repository](#repo-delete-label)
77- [`--label --list` - List labels for a repository](#repo-list-label)
78- [`--label --update` - Update a label for a repository](#repo-list-labels)
79- [`--search` - Find repositories via various criteria](#repo-search)
80 </details>
81
82<details><summary>Gists `gi`</summary>
83
84- [`--browser` - Open a Gist in the browser](#gist-open-in-browser)
85- [`--list` - List user's gists](#gist-list)
86- [`--create` - Create new gists](#gist-create)
87- [`--fork` - Fork a gist](#gist-fork)
88- [`--delete` - Delete a gist](#gist-delete)
89 </details>
90
91<details><summary>User `us`</summary>
92
93- [`--login` - Automates saving user name & developer token credentials to your ~/.gh.json config](#user-login-or-logout)
94- [`--logout` - Automates removing user name & developer token credentials from your ~/.gh.json config](#user-login-or-logout)
95- [`--whoami` - Prints the user name from ~/.gh.json to your console](#user-whoami)
96 </details>
97
98<details><summary>Notifications `nt`</summary>
99
100- [`--latest` - Display the latest activities on a repository](#notifications-latest)
101- [`--list` - Watch for any activity on repository](#notifications-watch)
102 </details>
103
104<details><summary>Milestones `ms`</summary>
105
106- [`--list` - List milestones for a specific repo](#milestone-list)
107 </details>
108
109<details><summary>Alias `al`</summary>
110
111- [`--add` - Add a shell-like alias for users](#alias-add)
112- [`--remove` - Remove alias](#alias-remove)
113- [`--list` - List aliases for a specific repo](#alias-list)
114 </details>
115
116</details>
117
118<details><summary>General</summary>
119
120- [History](#history)
121- [License](#license)
122- [Demonstration](#demonstration)
123- [Supported Node Versions](#supported-node-versions)
124 </details>
125
126## Install
127
128```
129npm install -g gh
130```
131
132## Usage
133
134- Most commands require you to use a developer key
135- We automate the process for you the first time you run a command
136- [Instructions](#user-login-or-logout) on manually adding a developer key for extra security
137
138Simple example: _list prs for current repo_
139
140```
141gh pr
142```
143
144## Contributors
145
146Huge thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
147
148<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
149<!-- prettier-ignore -->
150<table>
151 <tr>
152 <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>
153 <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>
154 <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>
155 <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>
156 <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>
157 <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>
158 <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>
159 </tr>
160 <tr>
161 <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>
162 <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>
163 <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>
164 <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>
165 <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>
166 <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>
167 <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>
168 </tr>
169 <tr>
170 <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>
171 <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>
172 <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>
173 <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>
174 <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>
175 <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>
176 <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>
177 </tr>
178 <tr>
179 <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>
180 <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>
181 <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>
182 <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>
183 <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>
184 <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>
185 <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>
186 </tr>
187 <tr>
188 <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>
189 <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>
190 <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>
191 <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>
192 <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>
193 <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>
194 <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>
195 </tr>
196 <tr>
197 <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>
198 <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>
199 <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>
200 <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>
201 <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>
202 <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>
203 <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>
204 </tr>
205 <tr>
206 <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>
207 <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>
208 <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>
209 <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>
210 <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>
211 <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>
212 <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>
213 </tr>
214 <tr>
215 <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>
216 <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>
217 <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>
218 <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>
219 <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>
220 <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>
221 <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>
222 </tr>
223 <tr>
224 <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>
225 <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>
226 <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>
227 <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>
228 <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>
229 <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>
230 <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>
231 </tr>
232 <tr>
233 <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>
234 <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>
235 <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>
236 <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>
237 <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>
238 <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>
239 <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>
240 </tr>
241 <tr>
242 <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>
243 <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>
244 <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>
245 <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>
246 <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>
247 <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>
248 <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>
249 </tr>
250 <tr>
251 <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>
252 <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>
253 <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>
254 <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>
255 <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>
256 <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>
257 <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>
258 </tr>
259 <tr>
260 <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>
261 <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>
262 <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>
263 <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>
264 <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>
265 </tr>
266</table>
267
268<!-- ALL-CONTRIBUTORS-LIST:END -->
269
270This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
271
272## Contributing
273
274For 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/).
275
276## History
277
278For detailed changelog, check [Releases](https://github.com/node-gh/gh/releases).
279
280## License
281
282[BSD-3-Clause](https://github.com/node-gh/gh/blob/master/LICENSE.txt)
283
284## Demonstration
285
286<a href="https://asciinema.org/a/214594?autoplay=1">
287 <p align="center">
288 <img alt="Terminal Demo" src="http://nodegh.io/images/terminal-demo.svg" width="600">
289 </p>
290</a>
291
292## Supported Node Versions:
293
294We support the node versions that the Node.js organization supports which as of now is Node v6 & up.
295
296<p><img src="https://github.com/nodejs/Release/blob/master/schedule.svg" alt="LTS Schedule"/></p>
297
298## Authentication
299
300Under the hood, we are using [@octokit/rest](https://github.com/octokit/rest.js) to work with the GitHub API
301The method of authentication that we use with octokit, is a personal access token
302You 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`
303
304## Available commands
305
306```
307gh help
308```
309
310List all comands options.
311
312```
313gh help --all
314```
315
316List specific command options.
317
318```
319gh help <command>
320```
321
322### Global flags
323
324| Option | Usage | Type |
325| ------------ | ---------- | --------- |
326| `--verbose` | _Optional_ | `Boolean` |
327| `--insane` | _Optional_ | `Boolean` |
328| `--no-color` | _Optional_ | `Boolean` |
329| `--no-hooks` | _Optional_ | `Boolean` |
330
331The verbose flag is useful for debugging issues.
332The insane flag is a more complete verbose flag, which leaks more privacy sensitive data by default.
333
334## Pull requests
335
336```
337gh pull-request
338```
339
340> **Alias:** `gh pr`
341
342### PR: Info
343
344| Option | Usage | Type |
345| ---------------- | ---------- | --------- |
346| `-u`, `--user` | _Required_ | `String` |
347| `-I`, `--info` | _Required_ | `Boolean` |
348| `-n`, `--number` | _Required_ | `String` |
349| `-r`, `--repo` | _Optional_ | `String` |
350| `-u`, `--user` | _Optional_ | `String` |
351
352```
353gh pr
354```
355
356Get information about a pull request.
357
358```
359gh pr --info number
360```
361
362### PR: List
363
364| Option | Usage | Type |
365| ------------------ | ------------ | ------------------------------------------------------------------ |
366| `-l`, `--list` | **Required** | `Boolean` |
367| `-a`, `--all` | _Optional_ | `Boolean` |
368| `-O`, `--org` | _Optional_ | `String` |
369| `-m`, `--me` | _Optional_ | `Boolean` |
370| `-d`, `--detailed` | _Optional_ | `Boolean` |
371| `--direction` | _Optional_ | [`asc`, `desc`] |
372| `--date` | _Optional_ | `String` |
373| `-b`, `--branch` | _Optional_ | `String` |
374| `--remote` | _Optional_ | `String` |
375| `-r`, `--repo` | _Optional_ | `String` |
376| `--sort` | _Optional_ | [`created`, `updated`, `popularity`, `long-running`, `complexity`] |
377| `-S`, `--state` | _Optional_ | [`open`, `closed`] |
378| `-u`, `--user` | _Optional_ | `String` |
379| `--link` | _Optional_ | `Boolean` |
380
381- `user` is owner of the repository, it is the authenticated user by default.
382- `remote` is the name of the remote configuration in a git directory, i.e. origin, upstream.
383- Therefore, it only makes sense when this command is run in a git directory.
384
385#### Examples
386
387**Shortcut** for listing open pull requests for the current repository.
388To turn off pretty printing of output in a table add `"pretty_print": false` to your `~/.gh-json` config
389
390List open pull requests for all branches from all your repositories.
391
392```
393gh pr --list --all
394```
395
396List open pull requests for all branches in all repositories belonging to the "github" organization.
397
398```
399gh pr --list --all --org github
400```
401
402List open pull requests sent by logged user on current repository.
403
404```
405gh pr --list --me
406```
407
408List open pull requests in node-gh/gh repository.
409
410```
411gh pr --list --user node-gh --repo gh
412```
413
414List open pull requests with link and content.
415
416```
417gh pr --list --detailed
418```
419
420List open pull requests for a branch.
421
422```
423gh pr --list --branch master
424```
425
426List open pull requests and sort them by popularity _(comment count)_.
427
428```
429gh pr --list --sort popularity
430```
431
432List open pull requests and sort them by asc long-running _(old but still active)_.
433
434```
435gh pr --list --sort long-running --direction asc
436```
437
438List open pull requests and sort them by complexity _(complexity is calculated based on number of additions, deletions, changed files, comments and review comments)_.
439
440```
441gh pr --list --sort complexity
442```
443
444List open pull requests with their link
445
446```
447gh pr --list --link
448```
449
450List open pull requests with a formatted date (_Any string that the moment library's formatter accepts should work: https://momentjs.com/docs/#/displaying/format/_).
451
452```
453gh pr --list --date "dddd, MMMM Do YYYY, h:mm:ss a"
454```
455
456### PR: Merge or Rebase
457
458| Option | Usage | Type |
459| ---------------- | ------------ | --------- |
460| `-f`, `--fetch` | **Required** | `Boolean` |
461| `-M`, `--merge` | **Required** | `Boolean` |
462| `-R`, `--rebase` | **Required** | `Boolean` |
463| `-n`, `--number` | _Optional_ | `Number` |
464| `-b`, `--branch` | _Optional_ | `String` |
465| `--draft` | _Optional_ | `Boolean` |
466| `--remote` | _Optional_ | `String` |
467| `-r`, `--repo` | _Optional_ | `String` |
468| `-u`, `--user` | _Optional_ | `String` |
469
470Omitting `--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`.
471
472#### Examples
473
474**Shortcut** for fetching pull request and checkout into a new branch `pr-1`.
475
476```
477gh pr 1
478```
479
480Merge or rebase pull request into a local branch.
481
482```
483gh pr 1 --fetch --merge
484```
485
486```
487gh pr 1 --fetch --rebase
488```
489
490Merge or rebase pull request into branch `dev`.
491
492```
493gh pr 1 --fetch --rebase --branch dev
494```
495
496```
497gh pr 1 --fetch --merge --branch dev
498```
499
500### PR: Comment
501
502| Option | Usage | Type |
503| ----------------- | ------------ | -------- |
504| `-c`, `--comment` | **Required** | `String` |
505| `-n`, `--number` | **Required** | `Number` |
506| `--remote` | _Optional_ | `String` |
507| `-r`, `--repo` | _Optional_ | `String` |
508| `-u`, `--user` | _Optional_ | `String` |
509
510#### Examples
511
512Comment on a pull request.
513
514```
515gh pr 1 --comment "Merged, thank you!"
516```
517
518Submit a pull request using your default git editor (`git config --global core.editor`) by passing an empty `--comment`
519
520```
521gh pr 1 --comment
522```
523
524### PR Forward
525
526| Option | Usage | Type |
527| ---------------- | ------------ | -------- |
528| `--fwd` | **Required** | `String` |
529| `-n`, `--number` | **Required** | `Number` |
530
531Omitting a value for `--fwd` fallbacks to the `default_pr_forwarder` key found
532in your [config file](#config).
533
534#### Examples
535
536Forward a pull request to another reviewer.
537
538```
539gh pr 1 --fwd username
540```
541
542### PR: Open or Close
543
544| Option | Usage | Type |
545| ---------------- | ------------ | --------- |
546| `-o`, `--open` | **Required** | `Boolean` |
547| `-C`, `--close` | **Required** | `Boolean` |
548| `-n`, `--number` | **Required** | `Number` |
549| `--remote` | _Optional_ | `String` |
550| `-r`, `--repo` | _Optional_ | `String` |
551| `-u`, `--user` | _Optional_ | `String` |
552
553#### Examples
554
555Open a pull request.
556
557```
558gh pr 1 --open
559```
560
561Close a pull request.
562
563```
564gh pr 1 --close
565```
566
567Close multiple pull requests.
568
569```
570gh pr --close --number 1 --number 2
571```
572
573Open multiple pull requests.
574
575```
576gh pr --open --number 1 --number 2
577```
578
579Open or close a pull request that you've sent to someone.
580
581```
582gh pr 1 --close --user eduardolundgren
583```
584
585### PR: Submit
586
587| Option | Usage | Type |
588| --------------------- | ------------ | -------- |
589| `-s`, `--submit` | **Required** | `String` |
590| `-b`, `--branch` | _Optional_ | `String` |
591| `-D`, `--description` | _Optional_ | `String` |
592| `-i`, `--issue` | _Optional_ | `Number` |
593| `-r`, `--repo` | _Optional_ | `String` |
594| `-t`, `--title` | _Optional_ | `String` |
595
596Omitting a value for `--submit` fallbacks to the `default_pr_reviewer` key found
597in your [config file](#config). Omitting `--title` will submit a pull request
598using the last commit message as title.
599
600#### Examples
601
602Submit a pull request using the current branch.
603
604```
605gh pr --submit eduardolundgren --title 'Fix #32' --description 'Awesome fix'
606```
607
608Submit a pull request using your default git editor (`git config --global core.editor`) by passing an empty `--title` and or `--description`
609
610```
611gh pr --submit eduardolundgren --title --description
612```
613
614Submit a pull request using the current branch to dev branch.
615
616```
617gh pr --submit eduardolundgren --branch dev
618```
619
620Submit a pull request from a issue.
621
622```
623gh pr --submit eduardolundgren --issue 150
624```
625
626Submit a pull request in draft state.
627
628```
629gh pr --submit eduardolundgren --draft
630```
631
632### PR: Open in Browser
633
634| Option | Usage | Type |
635| ----------------- | ------------ | --------- |
636| `-B`, `--browser` | **Required** | `Boolean` |
637| `-n`, `--number` | **Required** | `Number` |
638| `-u`, `--user` | _Optional_ | `String` |
639| `-r`, `--repo` | _Optional_ | `String` |
640
641#### Examples
642
643Open GitHub pull request page in the browser.
644
645```
646gh pr 100 --browser
647```
648
649## Notifications
650
651```
652gh notification
653```
654
655> **Alias:** `gh nt`
656
657### Notifications: Latest
658
659| Option | Usage | Type |
660| ---------------- | ------------ | --------- |
661| `-l`, `--latest` | **Required** | `Boolean` |
662| `--remote` | _Optional_ | `String` |
663| `-r`, `--repo` | _Optional_ | `String` |
664| `-u`, `--user` | _Optional_ | `String` |
665| `--date` | _Optional_ | `String` |
666
667#### Examples
668
669**Shortcut** for displaying the latest activities on the current repository.
670
671```
672gh nt
673```
674
675Display the latest activities on a certain repository.
676
677```
678gh nt --latest --user eduardolundgren --repo node-gh
679```
680
681Diplay notifications with a formatted date (_Any string that the moment library's formatter accepts should work: https://momentjs.com/docs/#/displaying/format/_).
682
683```
684gh nt --date "dddd, MMMM Do YYYY, h:mm:ss a"
685```
686
687### Notifications: Watch
688
689| Option | Usage | Type |
690| --------------- | ------------ | --------- |
691| `-w`, `--watch` | **Required** | `Boolean` |
692| `--remote` | _Optional_ | `String` |
693| `-r`, `--repo` | _Optional_ | `String` |
694| `-u`, `--user` | _Optional_ | `String` |
695
696#### Examples
697
698Watch for any activity on the current repository.
699
700```
701gh nt --watch
702```
703
704Watch for any activity on a certain repository.
705
706```
707gh nt --watch --user eduardolundgren --repo node-gh
708```
709
710## Issues
711
712```
713gh issue
714```
715
716> **Alias:** `gh is`
717
718### Issue: Create
719
720| Option | Usage | Type |
721| ------------------ | ------------ | --------- |
722| `-N`, `--new` | **Required** | `Boolean` |
723| `-t`, `--title` | **Required** | `String` |
724| `-A`, `--assignee` | _Optional_ | `String` |
725| `-L`, `--labels` | _Optional_ | `String` |
726| `-m`, `--message` | _Optional_ | `String` |
727| `--remote` | _Optional_ | `String` |
728| `-r`, `--repo` | _Optional_ | `String` |
729| `-u`, `--user` | _Optional_ | `String` |
730
731#### Examples
732
733**Shortcut** for creating a new issue on the current repository.
734
735```
736gh is 'Node GH rocks!' 'Body with **Markdown** support'
737```
738
739Create a new issue using your default git editor (`git config --global core.editor`) by passing an empty `--message` (_also works with an empty title_)
740
741```
742gh is --new --title 'Node GH rocks!' --message
743```
744
745Create a new issue on a certain repository.
746
747```
748gh is --new --title 'Node GH rocks!' --message 'Body with **Markdown** support' --user eduardolundgren --repo node-gh
749```
750
751Create a new issue with labels.
752
753```
754gh is --new --title 'Node GH rocks!' --labels bug,question,test
755```
756
757Create a new issue and assign it to someone.
758
759```
760gh is --new --title 'Node GH rocks!' --assignee zenorocha
761```
762
763### Issue: Comment
764
765| Option | Usage | Type |
766| ----------------- | ------------ | -------- |
767| `-c`, `--comment` | **Required** | `String` |
768| `-n`, `--number` | **Required** | `Number` |
769| `--remote` | _Optional_ | `String` |
770| `-r`, `--repo` | _Optional_ | `String` |
771| `-u`, `--user` | _Optional_ | `String` |
772
773#### Examples
774
775Comment on an issue of the current repository.
776
777```
778gh is 1 --comment 'Node GH rocks!'
779```
780
781Comment on an issue using your default git editor (`git config --global core.editor`) by passing an empty `--comment` (_also works with an empty title_)
782
783```
784gh is 1 --comment
785```
786
787Comment on an issue of a certain repository.
788
789```
790gh is 1 --comment 'Node GH rocks!' --user eduardolundgren --repo node-gh
791```
792
793### Issue: Open or Close
794
795| Option | Usage | Type |
796| ---------------- | ------------ | --------- |
797| `-o`, `--open` | **Required** | `Boolean` |
798| `-C`, `--close` | **Required** | `Boolean` |
799| `-n`, `--number` | **Required** | `Number` |
800| `--remote` | _Optional_ | `String` |
801| `-r`, `--repo` | _Optional_ | `String` |
802| `-u`, `--user` | _Optional_ | `String` |
803
804#### Examples
805
806Open an issue.
807
808```
809gh is 1 --open
810```
811
812Close an issue.
813
814```
815gh is 1 --close
816```
817
818Close multiple issues.
819
820```
821gh is --close --number 1 --number 2
822```
823
824Open multiple issues.
825
826```
827gh is --open --number 1 --number 2
828```
829
830Open or close an issue that you've sent to someone.
831
832```
833gh is 1 --close --user eduardolundgren
834```
835
836### Issue: List
837
838| Option | Usage | Type |
839| ------------------- | ------------ | -------------------- |
840| `-l`, `--list` | **Required** | `Boolean` |
841| `-a`, `--all` | _Optional_ | `Boolean` |
842| `-A`, `--assignee` | _Optional_ | `String` |
843| `--date` | _Optional_ | `String` |
844| `-d`, `--detailed` | _Optional_ | `Boolean` |
845| `-L`, `--labels` | _Optional_ | `String` |
846| `-M`, `--milestone` | _Optional_ | [`Number`, `String`] |
847| `--remote` | _Optional_ | `String` |
848| `-r`, `--repo` | _Optional_ | `String` |
849| `-S`, `--state` | _Optional_ | [`open`, `closed`] |
850| `-u`, `--user` | _Optional_ | `String` |
851
852#### Examples
853
854**Shortcut** for listing all issues on the current repository.
855
856```
857gh is
858```
859
860List all issues from all repositories.
861
862```
863gh is --list --all
864```
865
866List issues assigned to someone.
867
868```
869gh is --list --assignee zenorocha
870```
871
872List issues with link and content.
873
874```
875gh is --list --detailed
876```
877
878List only closed issues on the current repository.
879
880```
881gh is --list --state closed
882```
883
884List issues with a formatted date (_Any string that the moment library's formatter accepts should work: https://momentjs.com/docs/#/displaying/format/_).
885
886```
887gh is --list --date "dddd, MMMM Do YYYY, h:mm:ss a"
888```
889
890List issues filtered by milestone title.
891
892```
893gh is --list --milestone "milestone title"
894```
895
896List issues that contains labels `todo` and `bug`.
897
898```
899gh is --list --labels todo,bug
900```
901
902List all issues on a certain repository.
903
904```
905gh is --list --user eduardolundgren --repo node-gh
906```
907
908### Issue: Open in Browser
909
910| Option | Usage | Type |
911| ----------------- | ------------ | --------- |
912| `-B`, `--browser` | **Required** | `Boolean` |
913| `-n`, `--number` | **Required** | `Number` |
914| `-u`, `--user` | _Optional_ | `String` |
915| `-r`, `--repo` | _Optional_ | `String` |
916
917#### Examples
918
919**Shortcut** for opening GitHub issue page in the browser.
920
921```
922gh is 100
923```
924
925Open GitHub issue page in the browser.
926
927```
928gh is 100 --browser
929```
930
931### Issue: Search
932
933| Option | Usage | Type |
934| ------------------ | ------------ | --------- |
935| `-s`, `--search` | **Required** | `Boolean` |
936| `-a`, `--all` | _Optional_ | `Boolean` |
937| `-d`, `--detailed` | _Optional_ | `Boolean` |
938| `-r`, `--repo` | _Optional_ | `String` |
939| `-u`, `--user` | _Optional_ | `String` |
940
941#### Examples
942
943Search issues in current repository
944
945```
946gh is --search 'term'
947```
948
949Search issues in all repositories for a user
950
951```
952gh is --all --user node-gh --search 'term'
953```
954
955Search issues in a repository for a user
956
957```
958gh is --user node-gh --repo gh --search 'term'
959```
960
961Search issues in a repository for a user with link and content
962
963```
964gh is --user node-gh --repo gh --search 'term'
965```
966
967Search issues with github filters
968
969```
970gh is --user node-gh --repo gh --search 'updated:<=2013-05-24'
971```
972
973### Issue: Assign
974
975| Option | Usage | Type |
976| ------------------ | ------------ | --------- |
977| `--assign` | **Required** | `Boolean` |
978| `-A`, `--assignee` | **Required** | `String` |
979| `-n`, `--number` | **Required** | `Number` |
980| `-r`, `--repo` | _Optional_ | `String` |
981| `-u`, `--user` | _Optional_ | `String` |
982
983#### Examples
984
985Assign an issue on the current repository to a user.
986
987```
988gh is --assign --assignee zenorocha --number 1
989```
990
991Assign an issue on a specific repository to a user.
992
993```
994gh is --assign --assignee zenorocha --number 1 --user eduardolundgren --repo gh
995```
996
997## Repo
998
999```
1000gh repo
1001```
1002
1003> **Alias:** `gh re`
1004
1005### Repo: Open in Browser
1006
1007| Option | Usage | Type |
1008| ----------------- | ------------ | --------- |
1009| `-B`, `--browser` | **Required** | `Boolean` |
1010| `-u`, `--user` | _Optional_ | `String` |
1011| `-r`, `--repo` | _Optional_ | `String` |
1012
1013#### Examples
1014
1015**Shortcut** for opening the GitHub repository page in the browser.
1016
1017```
1018gh re
1019```
1020
1021Open GitHub repository page in the browser.
1022
1023```
1024gh re --browser --user eduardolundgren --repo node-gh
1025```
1026
1027### Repo: List
1028
1029| Option | Usage | Type |
1030| ------------------ | ------------ | ----------------------------------------------- |
1031| `-l`, `--list` | **Required** | `Boolean` |
1032| `-d`, `--detailed` | _Optional_ | `Boolean` |
1033| `-u`, `--user` | _Optional_ | `String` |
1034| `-t`, `--type` | _Optional_ | [`all`, `owner`, `public`, `private`, `member`] |
1035| `--date` | _Optional_ | `String` |
1036
1037#### Examples
1038
1039List all repositories.
1040
1041```
1042gh re --list
1043```
1044
1045List all private repositories.
1046
1047```
1048gh re --list --type private
1049```
1050
1051List all repositories from someone.
1052
1053```
1054gh re --list --user zenorocha
1055```
1056
1057List open repositories with a formatted date (_Any string that the moment library's formatter accepts should work: https://momentjs.com/docs/#/displaying/format/_).
1058
1059```
1060gh re --list --detailed --date "dddd, MMMM Do YYYY, h:mm:ss a"
1061```
1062
1063### Repo: Create
1064
1065| Option | Usage | Type |
1066| ---------------------- | ------------ | ----------- |
1067| `-N`, `--new` | **Required** | `String` |
1068| `-O`, `--organization` | _Optional_ | `String` |
1069| `-c`, `--clone` | _Optional_ | `Boolean` |
1070| `-t`, `--type` | _Optional_ | [`private`] |
1071| `--init` | _Optional_ | `Boolean` |
1072| `--gitignore` | _Optional_ | `String` |
1073| `--homepage` | _Optional_ | `String` |
1074| `--description` | _Optional_ | `String` |
1075
1076#### Examples
1077
1078Create a new GitHub repository and clone on the current directory.
1079
1080```
1081gh re --new foo --clone
1082```
1083
1084Create a new GitHub repository for an organization.
1085
1086```
1087gh re --new foo --organization node-gh
1088```
1089
1090Create a new GitHub repository using .gitignore template for Ruby.
1091
1092```
1093gh re --new gemified --gitignore Ruby
1094```
1095
1096Create a new private repository on GitHub, initializing it with a initial commit of the README.
1097
1098```
1099gh re --new foo --init --type private
1100```
1101
1102### Repo: Fork
1103
1104| Option | Usage | Type |
1105| ---------------------- | ------------ | -------- |
1106| `-f`, `--fork` | **Required** | `String` |
1107| `-u`, `--user` | **Required** | `String` |
1108| `-O`, `--organization` | _Optional_ | `String` |
1109
1110#### Examples
1111
1112Fork a GitHub repository.
1113
1114```
1115gh re --fork repo --user user
1116```
1117
1118Fork a GitHub repository into the node-gh organization.
1119
1120```
1121gh re --fork repo --user user --organization node-gh
1122```
1123
1124### Repo: Delete
1125
1126| Option | Usage | Type |
1127| ---------------- | ------------ | -------- |
1128| `-D`, `--delete` | **Required** | `String` |
1129| `-u`, `--user` | **Required** | `String` |
1130
1131#### Example
1132
1133Delete a repository of the logged user.
1134
1135```
1136gh re --delete foo
1137```
1138
1139### Repo: Clone
1140
1141| Option | Usage | Type |
1142| ---------------------- | ------------ | -------- |
1143| `-c`, `--clone` | **Required** | `String` |
1144| `-r`, `--repo` | **Required** | `String` |
1145| `-O`, `--organization` | _Optional_ | `String` |
1146| `-P`, `--protocol` | _Optional_ | `String` |
1147| `-u`, `--user` | _Optional_ | `String` |
1148
1149> If you have custom ssh config, you can add `"api": { "ssh_host": "custom-name", ... }` to your .gh.json file.
1150
1151#### Examples
1152
1153Clone a repository.
1154
1155```
1156gh re --clone --repo gh
1157```
1158
1159Clone a repository from a specific user using HTTPS protocol.
1160
1161```
1162gh re --clone --user eduardolundgren --repo gh --protocol https
1163```
1164
1165### Repo: Create Label
1166
1167| Option | Usage | Type |
1168| ---------------------- | ------------ | --------- |
1169| `-C`, `--color` | **Required** | `String` |
1170| `-L`, `--label` | **Required** | `Boolean` |
1171| `-N`, `--new` | **Required** | `String` |
1172| `-r`, `--repo` | **Required** | `String` |
1173| `-O`, `--organization` | _Optional_ | `String` |
1174| `-u`, `--user` | _Optional_ | `String` |
1175
1176#### Examples
1177
1178Create a label for a repository (_color is a hex code with or without literal hex symbol_).
1179
1180```
1181gh re --label --new bug --color '#7057ff' --repo gh
1182```
1183
1184Create a label for a user's repository.
1185
1186```
1187gh re --label --new bug --color '#7057ff' --user eduardolundgren --repo gh
1188```
1189
1190### Repo: Delete Label
1191
1192| Option | Usage | Type |
1193| ---------------------- | ------------ | --------- |
1194| `-L`, `--label` | **Required** | `Boolean` |
1195| `-D`, `--delete` | **Required** | `String` |
1196| `-r`, `--repo` | **Required** | `String` |
1197| `-O`, `--organization` | _Optional_ | `String` |
1198| `-u`, `--user` | _Optional_ | `String` |
1199
1200#### Examples
1201
1202Delete a label from a repository.
1203
1204```
1205gh re --label --delete bug --repo gh
1206```
1207
1208Delete a label from a user's repository.
1209
1210```
1211gh re --label --delete bug --user eduardolundgren --repo gh
1212```
1213
1214### Repo: List Labels
1215
1216| Option | Usage | Type |
1217| ---------------------- | ------------ | --------- |
1218| `-L`, `--label` | **Required** | `Boolean` |
1219| `-l`, `--list` | **Required** | `Boolean` |
1220| `-r`, `--repo` | **Required** | `String` |
1221| `-O`, `--organization` | _Optional_ | `String` |
1222| `-u`, `--user` | _Optional_ | `String` |
1223
1224#### Examples
1225
1226List labels for a repository.
1227
1228```
1229gh re --label --list --repo gh
1230```
1231
1232List labels for a user's repository.
1233
1234```
1235gh re --label --list --user eduardolundgren --repo gh
1236```
1237
1238### Repo: Update Label
1239
1240| Option | Usage | Type |
1241| ---------------------- | ------------ | --------- |
1242| `-C`, `--color` | **Required** | `String` |
1243| `-L`, `--label` | **Required** | `Boolean` |
1244| `-r`, `--repo` | **Required** | `String` |
1245| `-U`, `--update` | **Required** | `String` |
1246| `-O`, `--organization` | _Optional_ | `String` |
1247| `-u`, `--user` | _Optional_ | `String` |
1248
1249#### Examples
1250
1251Update a label for a repository (_color is a hex code with or without literal hex symbol_).
1252
1253```
1254gh re --label --update bug --color color --repo gh
1255```
1256
1257Update a label for a user's repository.
1258
1259```
1260gh re --label --update bug --color color --user eduardolundgren --repo gh
1261```
1262
1263### Repo: Search
1264
1265Find repositories via various criteria. Repository search looks through the projects you have access to on GitHub.
1266You can filter the results using GitHub's search qualifiers.
1267[Examples:](https://help.github.com/articles/searching-for-repositories/)
1268
1269| Option | Usage | Type |
1270| ---------------------- | ------------ | ----------------------------------------------- |
1271| `-s`, `--search` | **Required** | `Boolean` |
1272| `-d`, `--detailed` | _Optional_ | `Boolean` |
1273| `-u`, `--user` | _Optional_ | `String` |
1274| `-r`, `--repo` | _Optional_ | `String` |
1275| `-O`, `--organization` | _Optional_ | `String` |
1276| `-t`, `--type` | _Optional_ | [`all`, `owner`, `public`, `private`, `member`] |
1277
1278#### Examples
1279
1280Search private repositories you have access to with the term "secret".
1281
1282```
1283gh re --search secret --type private
1284```
1285
1286OR
1287
1288```
1289gh re --search secret is:private
1290```
1291
1292Matches repositories from GitHub org showing detailed results.
1293
1294```
1295gh re --detailed -o github --search octocat
1296```
1297
1298OR
1299
1300```
1301gh re --detailed --search octocat org:github
1302```
1303
1304## Gists
1305
1306```
1307gh gists
1308```
1309
1310> **Alias:** `gh gi`
1311
1312### Gist: Open in Browser
1313
1314| Option | Usage | Type |
1315| ----------------- | ------------ | --------- |
1316| `-B`, `--browser` | **Required** | `Boolean` |
1317| `-u`, `--user` | _Optional_ | `String` |
1318| `-i`, `--id` | _Optional_ | `String` |
1319
1320#### Examples
1321
1322**Shortcut** for opening your Gists in the browser.
1323
1324```
1325gh gi
1326```
1327
1328Open a Gist in the browser.
1329
1330```
1331gh gi --browser --id 5991877
1332```
1333
1334### Gist: List
1335
1336| Option | Usage | Type |
1337| -------------- | ------------ | --------- |
1338| `-l`, `--list` | **Required** | `Boolean` |
1339| `-u`, `--user` | _Optional_ | `String` |
1340| `--date` | _Optional_ | `String` |
1341
1342#### Examples
1343
1344List all gists.
1345
1346```
1347gh gi --list
1348```
1349
1350List all gists from someone.
1351
1352```
1353gh gi --list --user brunocoelho
1354```
1355
1356List gists with a formatted date (_Any string that the moment library's formatter accepts should work: https://momentjs.com/docs/#/displaying/format/_).
1357
1358```
1359gh gi --list --date "dddd, MMMM Do YYYY, h:mm:ss a"
1360```
1361
1362### Gist: Create
1363
1364| Option | Usage | Type |
1365| --------------------- | ------------ | --------- |
1366| `-N`, `--new` | **Required** | `String` |
1367| `-c`, `--content` | _Optional_ | `String` |
1368| `-d`, `--description` | _Optional_ | `String` |
1369| `-p`, `--private` | _Optional_ | `Boolean` |
1370
1371#### Examples
1372
1373Create a Gist `hello` containing "Hello World".
1374
1375```
1376gh gi --new hello --content "Hello World!"
1377```
1378
1379Create a private Gist `hello` containing "Hello World".
1380
1381```
1382gh gi --new hello --content "Hello World!" --private
1383```
1384
1385### Gist: Fork
1386
1387| Option | Usage | Type |
1388| -------------- | ------------ | -------- |
1389| `-f`, `--fork` | **Required** | `String` |
1390
1391#### Examples
1392
1393Fork a Gist.
1394
1395```
1396gh gi --fork 5444883
1397```
1398
1399### Gist: Delete
1400
1401| Option | Usage | Type |
1402| ---------------- | ------------ | -------- |
1403| `-D`, `--delete` | **Required** | `String` |
1404
1405#### Example
1406
1407Delete a Gist.
1408
1409```
1410gh gi --delete 4252323
1411```
1412
1413Delete multiple Gists.
1414
1415```
1416gh gi --delete 4252321 --delete 4252322
1417```
1418
1419## User
1420
1421```
1422gh user
1423```
1424
1425> **Alias:** `gh us`
1426
1427### User: Login or Logout
1428
1429| Option | Usage | Type |
1430| ---------------- | ------------ | --------- |
1431| `-l`, `--login` | **Required** | `Boolean` |
1432| `-L`, `--logout` | **Required** | `Boolean` |
1433
1434#### Examples
1435
1436Automates saving user name & generating developer token credentials to your ~/.gh.json config
1437
1438- This is the the user that will be used if you do not manually pass in `--user username`
1439- After you are logged in, you should no longer be prompted to go through the login process again
1440- Alternatively you can create your own developer key and copy and paste it
1441 - First add a file in your home directory called `~/.gh.json`
1442 - You can use the `default.gh.json` file in our repo as a template
1443 - [Create a developer key](https://github.com/settings/tokens/new): with these scopes: `['user', 'public_repo', 'repo', 'repo:status', 'delete_repo', 'gist']`
1444 - Then copy & paste your token in the file at: `"github_token"`
1445 - Write your user name at `"github_user"`
1446
1447```
1448gh user --login
1449```
1450
1451Automates removing user name & developer token credentials to your ~/.gh.json config
1452
1453```
1454gh user --logout
1455```
1456
1457### User: Whoami
1458
1459| Option | Usage | Type |
1460| ---------------- | ------------ | --------- |
1461| `-w`, `--whoami` | **Required** | `Boolean` |
1462
1463#### Examples
1464
1465Prints the user name from ~/.gh.json to your console.
1466
1467```
1468gh user --whoami
1469```
1470
1471## Milestones
1472
1473```
1474gh milestone
1475```
1476
1477> **Alias:** `gh ms`
1478
1479### Milestone: List
1480
1481| Option | Usage | Type |
1482| ---------------------- | ------------ | --------- |
1483| `-l`, `--list` | **Required** | `Boolean` |
1484| `-u`, `--user` | _Required_ | `String` |
1485| `-a`, `--all` | _Required_ | `Boolean` |
1486| `-r`, `--repo` | _Optional_ | `String` |
1487| `-o`, `--organization` | _Optional_ | `String` |
1488
1489#### Examples
1490
1491**Shortcut** for listing milestones for a specific repo.
1492
1493```
1494gh ms
1495```
1496
1497Listing milestones for a specific repo & user.
1498
1499```
1500gh ms --list --user node-gh --repo gh
1501```
1502
1503Listing all milestones for a specific organization.
1504
1505```
1506gh ms --list --all --organization node-gh
1507```
1508
1509## Alias
1510
1511This 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.
1512
1513```
1514gh alias
1515```
1516
1517> **Alias:** `gh al`
1518
1519### Alias: List
1520
1521| Option | Usage | Type |
1522| -------------- | ------------ | --------- |
1523| `-l`, `--list` | **Required** | `Boolean` |
1524
1525#### Examples
1526
1527**Shortcut** for listing aliases.
1528
1529```
1530gh alias
1531```
1532
1533List aliases.
1534
1535```
1536gh alias --list
1537```
1538
1539### Alias: Add
1540
1541| Option | Usage | Type |
1542| -------------- | ------------ | -------- |
1543| `-a`, `--add` | **Required** | `String` |
1544| `-u`, `--user` | **Required** | `String` |
1545
1546#### Examples
1547
1548Create alias for username.
1549
1550```
1551gh alias --add zeno --user zenorocha
1552```
1553
1554And use like:
1555
1556```
1557gh pr --submit zeno -b master -t Title
1558```
1559
1560### Alias: Remove
1561
1562| Option | Usage | Type |
1563| ---------------- | ------------ | -------- |
1564| `-r`, `--remove` | **Required** | `String` |
1565
1566#### Examples
1567
1568Remove alias.
1569
1570```
1571gh alias --remove zeno
1572```
1573
1574## Config
1575
1576There are some pretty useful configurations that you can set on [.gh.json](default.gh.json).
1577This file can be found under home directory _(on MacOSx: `/Users/yourName/.gh.json` on Windows: `C:\\Users\yourName\.gh.json`)_.
1578
1579You can also set per-project configurations by adding a `.gh.json` file in your project's root folder and overriding existing keys.
1580
1581GitHub API configurations. Change it if you're a [GitHub Enterprise](https://enterprise.github.com/) user.
1582
1583```javascript
1584"api": {
1585 "host": "github.mydomain.com",
1586 "protocol": "https"
1587}
1588```
1589
1590Set default branch and remote.
1591
1592```javascript
1593"default_branch": "master",
1594"default_remote": "origin"
1595```
1596
1597Set default users when [submitting](#pr-submit) or [forwarding](#pr-forward) pull requests.
1598
1599```javascript
1600"default_pr_forwarder": "",
1601"default_pr_reviewer": ""
1602```
1603
1604GitHub data filled once you log in.
1605
1606```javascript
1607"github_token": "",
1608"github_user": ""
1609```
1610
1611Run automated tasks before or after a certain command.
1612
1613```javascript
1614"hooks": {
1615 "pull-request": {
1616 "merge": {
1617 "before": [{"cmd": "ls -la", "log": true}],
1618 "after": [
1619 "gh pr {{options.number}} --comment 'Thank you, pull request merged :D'"
1620 ]
1621 }
1622 }
1623}
1624```
1625
1626Run automated tasks passing arguments to the commands. Required for prompt commands.
1627
1628```javascript
1629"hooks": {
1630 "pull-request": {
1631 "merge": {
1632 "before": [{"cmd": "foo", "args": ["bar", "qux"]}]
1633 }
1634 }
1635}
1636```
1637
1638Set default branch name prefix for PR fetching.
1639
1640```javascript
1641"pull_branch_name_prefix": "pr-"
1642```
1643
1644Insert signature below issue comment.
1645
1646```javascript
1647"signature": "<br><br>:octocat: *Sent from [GH](http://nodegh.io).*"
1648```
1649
1650Turn off ssh when pulling a repo and use https instead.
1651
1652```javascript
1653"ssh": false,
1654```
1655
1656If you need to use a custom git command, set the environment variable `GH_GIT_COMMAND`.
1657
1658## Plugins
1659
1660[GH Gif](https://github.com/node-gh/gh-gif) - A plugin for commenting on pull requests/issues using GIF reactions.
1661[GH Travis](https://github.com/node-gh/gh-travis) - A plugin for integrating Travis, a continous integration server.
1662[GH Jira](https://github.com/node-gh/gh-jira) - A plugin for integrating Jira, an issue management system.
1663
1664Feel free to create your own plugins by forking [GH Boilerplate](https://github.com/node-gh/gh-boilerplate).