Skip to content

Commit 372de3c

Browse files
authored
Merge pull request #9 from aditya-beri/master
added cli
2 parents 01799a1 + 0b0647c commit 372de3c

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,3 +256,56 @@ View repository READMEs.
256256
8. gh alias set
257257
Create a shortcut for a gh command.
258258
```
259+
## GitHub CLI commands:
260+
```sh
261+
List Issues With GitHub CLI
262+
1. gh issue list
263+
list out the open GitHub Issues for our project
264+
265+
2. gh issue list --state "all"
266+
gh issue list -s "all"
267+
If we want to list out ALL of the issues we could use the “state” flag
268+
269+
3. gh issue list --assignee "n8ebel"
270+
Now, maybe we’ve realized that is too many issues to sort through, so we decide we only want to list out your currently assigned issues.
271+
272+
4. gh issue status
273+
Next, we want to check in on the status of a couple of the issues we created yesterday. Maybe we don’t remember their exact numbers, but since we created them, we can use the status command to list them at the terminal
274+
275+
5. gh issue list --state "closed"
276+
gh issue list -s "closed"
277+
After checking in on these issues, we still can’t find the issue we’re looking for, so we might want to check whether it was closed or not.
278+
279+
6. gh issue list --label "bug"
280+
gh issue list -l "bug"
281+
To list out all of our open bugs, we could filter by the “bug” label defined in our GitHub repo
282+
283+
7. gh issue view "15"
284+
Once we’ve found an issue we want to fix, we might want to assign that issue to ourselves. Currently, we can’t do that directly from the command line, but we can quickly open the issue from the command line using the “view” command.
285+
286+
8. gh issue create
287+
We can use the gh issue create command to create a new GitHub Issue directly from the command line.
288+
289+
9. gh issue create -t "Sample Issue Title" -b "Sample issue description"
290+
If you’d like to simplify things a bit, you can specify the issue with the command using additional flags
291+
292+
10. gh pr list
293+
list the open pull requests for our project.
294+
295+
11. gh pr list --state "all"
296+
gh pr list -s "all"
297+
If we want to list out ALL of the pull requests, both open and closed, we could use the “state” flag
298+
299+
12. gh pr status
300+
Next, we want to check in on the status of a couple of the PRs we created yesterday. Maybe we don’t remember their exact numbers, but since we created them, we can use the status command to list them at the terminal
301+
302+
13. gh pr list --state "closed"
303+
gh pr list -s "closed"
304+
After checking in on these PRs, we still can’t find the pull request we’re looking for, so we might want to check whether it was closed or not.
305+
306+
14. gh pr view "14"
307+
Once we’ve found a PR we want to review, we might want to assign that PR to ourself. Currently, we can’t do that directly from the command line, but we can quickly open the PR from the command line using the view command.
308+
```
309+
310+
311+

0 commit comments

Comments
 (0)