UNPKG

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