gi – I’m-feeling-lucky for Github

I just wrote a new tool, mainly for quickly installing and updating tools used in Infosec.

https://github.com/neilbags/gi.git

It’s called ‘gi’ (so it’s quick to type) and does the following:

  • Searches for a repository best matching your keyword(s)
  • Clones that repository (defaults to /opt)
  • Does a git pull if the destination folder already exists
  • Looks for a requirements.txt file and runs ‘pip install’ if it is found
  • Looks for a go.mod file and runs ‘go build’ if it is found

This saves me time, cutting out a bunch of clicks and copy-pastes. This is obviously basically the same as curling something to bash, so use it with caution. You can add the -i flag to run it interactively, asking for confirmation before running commands.

To install:

$ git clone https://github.com/neilbags/gi.git
$ pip install gi/requirements.txt

Example usage:

$ gi -h
usage: gi [-h] [-i] query [query ...]

'I'm Feeling Lucky' tool for git repositories.

positional arguments:
  query

options:
  -h, --help  show this help message and exit
  -i          ask for confirmation before running commands
$ gi dalfox
Found repository dalfox at https://github.com/hahwul/dalfox.git
Installing to /opt/dalfox
Cloning into 'dalfox'...
remote: Enumerating objects: 5305, done.
remote: Counting objects: 100% (521/521), done.
remote: Compressing objects: 100% (209/209), done.
remote: Total 5305 (delta 418), reused 349 (delta 312), pack-reused 4784
Receiving objects: 100% (5305/5305), 15.87 MiB | 1.14 MiB/s, done.
Resolving deltas: 100% (3501/3501), done.

/opt/dalfox:
cmd                 CONTRIBUTING.md   dalfox     Dockerfile  go.mod  lib          pkg        samples  SECURITY.md
CODE_OF_CONDUCT.md  CONTRIBUTORS.svg  dalfox.go  docs        go.sum  LICENSE.txt  README.md  scripts
$ /opt/dalfox/dalfox

    _..._
  .' .::::.   __   _   _    ___ _ __ __
 :  :::::::: |  \ / \ | |  | __/ \\ V /
 :  :::::::: | o ) o || |_ | _( o )) (
 '. '::::::' |__/|_n_||___||_| \_//_n_\
   '-.::''    

🌙🦊 Powerful open source XSS scanning tool and parameter analyzer, utility
Read the help page using the -h flag to see other options and flags! 

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.