Skip to content

Commit

Permalink
docs(readme, license): formatting cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
benelan committed Dec 22, 2023
1 parent 4ee118a commit 746bc4b
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 17 deletions.
4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT Licence
# MIT License

Copyright (c) Ben Elan
Copyright (c) 2023 Ben Elan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
68 changes: 53 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,39 @@ An fzf wrapper around the GitHub CLI.
- [`run`](#run)
- [Configuration](#configuration)
- [Related projects](#related-projects)
<!--toc:end-->

<!--toc:end-->

## Installation

1. Install [`gh`](https://github.com/cli/cli#installation) and [`fzf`](https://github.com/junegunn/fzf#installation) if you don't already have them. For example:
1. Install [`gh`](https://github.com/cli/cli#installation) and
[`fzf`](https://github.com/junegunn/fzf#installation) if you don't already have
them. For example:
- **Homebrew:** `brew install gh fzf`
- **DNF:** `sudo dnf install gh fzf`
- ... see the links above for other package managers
2. Authenticate with the GitHub CLI: `gh auth login`
3. Install the extension: `gh extension install benelan/gh-fzf`
4. [???](#usage)
5. PROFIT
5. **PROFIT**

## Usage

```sh
gh fzf <command> [flags]
```

The extension adds a new command that wraps GitHub's "list" subcommands with fzf to make them fuzzy findable. All of the arguments after `<command>` are passed directly to `gh`. Because of the way shell works, you need to escape quotes required by GitHub, e.g. [strings with whitespace](https://docs.github.com/en/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#use-quotation-marks-for-queries-with-whitespace). There are example usages for each command in the sections below.
This extension adds a new command that wraps GitHub's "list" subcommands with
fzf to make them fuzzy findable. All of the arguments after `<command>` are
passed directly to `gh`. Because of the way shell works, you need to escape
quotes required by GitHub, e.g.
[strings with whitespace](https://docs.github.com/en/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#use-quotation-marks-for-queries-with-whitespace).
There are example usages for each command in the sections below.

A preview of the current selection is displayed when navigating through the resulting list. Each command has keybindings to further filter the list or to call other `gh` subcommands on the item. There are also a few global keybindings that can be used with any `gh fzf` command:
A preview of the current selection is displayed when navigating through the
resulting list. Each command has keybindings to further filter the list or to
call other `gh` subcommands on the item. There are also a few global
keybindings that can be used with any `gh fzf` command:

- `ctrl-o`: Open the selected item in the browser
- `ctrl-y`: Copy the selected item's URL to the clipboard
Expand All @@ -58,8 +69,17 @@ A preview of the current selection is displayed when navigating through the resu
- `alt-m`: Filter the list, showing issues where you are mentioned
- `alt-s`: Filter the list, showing issues with any state (open or closed)
- **Examples:**
- `gh fzf issue --assignee @me --milestone "v1.33.7" --state all`: Filter the initial list to open and closed issues assigned to you in the "v1.33.7" milestone.
- `gh fzf i -S \'no:assignee label:\"good first issue\" milestone:backburner'`: Filter the initial list to issues with the "good first issue" label, no assignee, and in the "backburner" milestone. Uses [GitHub's search syntax](https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests).
- Filter the initial list to open and closed issues assigned to you in the
"v1.33.7" milestone:
```sh
gh fzf issue --assignee @me --milestone "v1.33.7" --state all
```
- Filter the initial list to issues with the "good first issue" label,
no assignee, and in the "backburner" milestone. Uses
[GitHub's search syntax](https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests):
```sh
gh fzf i -S \'no:assignee label:\"good first issue\" milestone:backburner\'
```
### `pr`
Expand All @@ -80,10 +100,20 @@ A preview of the current selection is displayed when navigating through the resu
- `alt-a`: Filter the list, showing pull requests assigned to you
- `alt-A`: Filter the list, showing pull requests authored by you
- `alt-b`: Filter the list, showing pull requests from the current branch
- `alt-s`: Filter the list, showing pull requests with any state (open, closed, or merged)
- `alt-s`: Filter the list, showing pull requests with any state
(open, closed, or merged)
- **Examples:**
- `gh fzf pr --state merged --author @me --label \"breaking change\"`: Filter the initial list to your merged pull requests with the "breaking change" label
- `gh fzf p -S \'merged:">=2023-01-01" \"breaking change\" in:body author:@me\'`: Filter the initial list to your pull requests merged since the beginning of 2023 that have "breaking change" in the body. Uses [GitHub's search syntax](https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests).
- Filter the initial list to your merged pull requests with the
"breaking change" label:
```sh
gh fzf pr --state merged --author @me --label \"breaking change\"
```
- Filter the initial list to your pull requests merged since the beginning
of 2023 that have "breaking change" in the body. Uses
[GitHub's search syntax](https://docs.github.com/en/search-github/searching-on-github/searching-issues-and-pull-requests):
```sh
gh fzf p -S \'merged:">=2023-01-01" \"breaking change\" in:body author:@me\'
```
### `run`
Expand All @@ -99,8 +129,14 @@ A preview of the current selection is displayed when navigating through the resu
- `alt-u`: Filter the list, showing runs triggered by you
- `alt-f`: Filter the list, showing failed runs
- **Examples:**
- `gh fzf run --workflow test`: Filter the initial list to runs for the "test" workflow.
- `gh fzf r -b main -s failure`: Filter the initial list to failed runs on the main branch.
- Filter the initial list to runs for the "test" workflow.
```sh
gh fzf run --workflow test
```
- Filter the initial list to failed runs on the main branch.
```sh
gh fzf r -b main -s failure
```
## Configuration
Expand All @@ -114,10 +150,12 @@ Environment variables are used to configure different options in `gh-fzf`.
## Related projects
- [`gh-f`](https://github.com/gennaro-tedesco/gh-f): another `fzf` wrapper around `gh`, which also provides some `git` functionality.
- [`gh-f`](https://github.com/gennaro-tedesco/gh-f):
another `fzf` wrapper around `gh`, which also provides some `git` functionality.
**NOTE:** `gh-fzf` leaves `git` functionality to other tools, and instead focuses on providing more keybindings for the GitHub commands.
The following `fzf` wrappers around `git` are both good options to bridge that gap:
**NOTE:** `gh-fzf` leaves `git` functionality to other tools, and instead
focuses on providing more keybindings for the GitHub commands. The following
`fzf` wrappers around `git` are both good options to bridge that gap:
- [`forgit`](https://github.com/wfxr/forgit) (I use this one)
- [`git-fuzzy`](https://github.com/bigH/git-fuzzy)

0 comments on commit 746bc4b

Please sign in to comment.