Home

Awesome

<h1 align="center"> <br> <img width="150" height="150" src="gh-f-logo.png"> <br> </h1> <h2 align="center"> <a href="https://github.com/gennaro-tedesco/gh-f/releases"> <img alt="releases" src="https://img.shields.io/github/release/gennaro-tedesco/gh-f?color=2aa198&style=for-the-badge"/> </a> </h2> <h4 align="center">the ultimate compact fzf gh extension</h4> <h3 align="center"> <a href="#Installation">Installation</a> • <a href="#Usage">Usage</a> • <a href="#Customisation">Customisation</a> • <a href="#Feedback">Feedback</a> </h3>

gh-f is the ultimate, compact and snappy fzf extension for gh cli. It addresses most of your daily GitHub workflow, if not all of it: f stands for filter, fzf or fomething felse.

Installation

gh extension install gennaro-tedesco/gh-f

Requirements

Usage

Get started!

gh f

shows the help page. Or watch it in action:

asciicast

or a quick replay

quick-demo

gh f [cmd]

takes one of the following arguments or flags

commanddescriptionbinds
-a, addsadd files to staging areaenter: add files to staging area<br>ctrl-d: diff selected file
-r, runsshow github workflow runs and filter logsenter: search run logs
-g, grepsgrep in files in revision historyinteractive prompt: insert regex, select files, show pattern in revision history
-p, prsview, diff and checkout PRenter: checkout selected PR<br>ctrl-d: diff selected PR<br>ctrl-v: view selected PR
-b, branchescheckout and diff branchesenter: checkout selected branch<br>ctrl-d: diff selected branch<br>ctrl-x: delete selected branch
-l, logsview, diff and checkout from logs historyenter: checkout selected commit<br>ctrl-d: diff selected commit<br>ctrl-v: view commit patch
-t, tagscheckout and diff version tagsenter: checkout tag in detached HEAD<br>ctrl-d diff against current branch
-s, searchsearch issues in any repositoryinteractive prompt: follow instructions
-m, myissuesearch issues you opened somewhereinteractive prompt: follow instructions
-k, pickcherrypick files between branchesenter: checkout cherrypicked files from branch
-e, envsshow git config listenter: print selected config variable
-h, helpshow help page
-V, versionprint the current version

Most commands follow the semantics of git standard instructions (so that you can remember them easily), only we append an s to avoid conflicts, should you have those commands lying around in the shell as aliases or for scripting.

Customisation

If you want to skip typing gh f before each command you may alias it directly, for instance

gh alias set prs 'f -p' # show PRs
gh alias set l 'f -l' # show git logs

and likewise for the rest.

The prompt colours are defined via their ANSI sequences here: change yourself accordingly, if you like different ones. Moreover notice that the rendering of text in the fzf preview window follows the options set in the FZF_DEFAULT_OPTS env variable: if you want to replicate exactly what is shown in the demo, here are my settings.

Feedback

If you find this application useful consider awarding it a ⭐, it is a great way to give feedback! Otherwise, any additional suggestions or merge request is warmly welcome!

See also the complete family of extensions