/gh-fzf

ghf, CLI With Fuzzy Finder For GitHub & Friends.

Primary LanguageShellMIT LicenseMIT

ghf, CLI With Fuzzy Finder For GitHub & Friends.

License: MIT

demo of ghf repo --public

Features

ghf enhances gh and glabf experimentally enhances glab. Enhancements are

  1. Subcommands gain fzf subsubcommand if they have list subsubcommand. This helps finding a topic of your interest. The return is the identifier (e.g., repository name), and can be piped for example to ghf or gh. Note that the fzf subsubcommand accepts the same arguments as list does.

    ghf repo fzf | ghf repo clone  # Clone one of your repositories
    ghf repo fzf atusy | ghf repo clone  # Clone one of atusy's repositores
  2. Subcommands with fzf subsubcommand runs that subsubcommand by default instead of --help in gh. The result is internally piped to view the page on the web by default.

    # These are equivalent
    ghf issue
    ghf issue fzf | ghf issue view --web
    
    # Viewer can be web (default), text, id, url, or short_url
    export _GHF_FZF_VIEWER="url"
    ghf issue

Installation

Requirements:

For bash and bash-compatible shell users:

Add below in your .bashrc or .zshrc, or else.

source ghf.bash

For Zinit users

Add below in your .zshrc

zinit load atusy/gh-fzf

For bash-inconpatible users

If your system has bash, then add gh-fzf/bin to PATH

# For fish shell
fish_add_path path/to/gh-fzf/bin

Tips

Alias

alias gh=ghf
alias glab=glabf

would be useful as enhanced commands do not conflict with original commands.