Code Monkey home page Code Monkey logo

gh-f's Introduction



the ultimate compact fzf gh extension

Installation โ€ข Usage โ€ข Customisation โ€ข Feedback

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

  • fzf
  • gnu core utils
  • bat (optional, if not detected it uses less as a pager, instead)

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

command description binds
-a, adds add files to staging area enter: add files to staging area
ctrl-d: diff selected file
-r, runs show github workflow runs and filter logs enter: search run logs
-g, greps grep in files in revision history interactive prompt: insert regex, select files, show pattern in revision history
-p, prs view, diff and checkout PR enter: checkout selected PR
ctrl-d: diff selected PR
ctrl-v: view selected PR
-b, branches checkout and diff branches enter: checkout selected branch
ctrl-d: diff selected branch
ctrl-x: delete selected branch
-l, logs view, diff and checkout from logs history enter: checkout selected commit
ctrl-d: diff selected commit
ctrl-v: view commit patch
-t, tags checkout and diff version tags enter: checkout tag in detached HEAD
ctrl-d diff against current branch
-s, search search issues in any repository interactive prompt: follow instructions
-m, myissue search issues you opened somewhere interactive prompt: follow instructions
-k, pick cherrypick files between branches enter: checkout cherrypicked files from branch
-e, envs show git config list enter: print selected config variable
-h, help show help page
-V, version print 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

  • gh-s to search for repositories with interactive prompt
  • gh-i to search for github issues with interactive prompt

gh-f's People

Contributors

gbirke avatar gennaro-tedesco avatar jonathanio avatar paul-sachs avatar taiki45 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gh-f's Issues

sorry for issue.

I want to add this spin on my little script but I don't know how to add it. please could you show me the code. Please

image

"Add support for secure token storage"

Token storage change in latest release of gh

This is a message from the GitHub CLI team, maintainers of gh, writing to inform you that the most recent release of gh contains changes which may affect your extension. The latest release introduces the feature of storing authentication tokens in the system keyring (encrypted storage) instead of in a plain text file.
The keyrings that are supported are:

  • Keychain on macOS

  • GNOME Keyring on Linux (Secret Service dbus interface)

  • Wincred on Windows

This has huge security benefits for the users of our tool and was one of our oldest outstanding issues. Unfortunately this change has the potential to break extensions that rely on utilizing the users authentication token to work.

In order to have continued compatibility with gh there are some actions you, as an extension author, need to take. These actions will depend on the implementation of your extension.

Extensions built in Go using go-gh:

  1. Upgrade your go-gh version to v1.2.1, the latest version.

  2. Verify that in your extension retrieval of the user authentication token is done using the auth.TokenForHost function.

    • If you were previously accessing the authentication token using any other method it will no longer work.
    • Automatic resolution of the authentication token when using the API clients will continue to work without changes.

All other extensions:

  1. Verify that in your extension retrieval of the user authentication token is done by shelling out to the gh auth token command.

    • If you were previously accessing the authentication token using the gh config get command, reading the configuration file directly, or any other methods it will no longer work.

As of right now storing the authentication token in the system keyring is an opt-in feature, but in the near future it will be required and at that point if the changes above are not made then your extension will be broken for all users. If you have any questions/concerns about this change please feel free to open a discussion in the gh repo.

Thanks,
The GitHub CLI Team

[advice] Make fzf more robust

I advice change 12 fzfs to fzf -d' 's. Because fzf will be affected by $FZF_DEFAULT_OPT. If user use -d: or other -d, it will make fzf work abnormally.

Thanks.

[feature] Add support for checking out from logs

First i'd like to say I love this thing โค๏ธ . It makes working with git branches so much easier.

One of the things I immediately tried was gh f -l and checkout a given entry (often to check for a bug or reset to a sane state). This would be a super useful to be able to add a command to checkout from a log entry (with ctrl+k or something... not sure yet)

That said, my bash-fu is pretty terrible. I'll try to mangle together a PR to add that but figured I'd raise this first to see if it makes sense.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.