Post

Introducing gitsearch-cli

Description of a tool I've written that can be used to find github projects from the command line

Introducing gitsearch-cli

The first version of gitsearch-cli is now available. This command line interface allows you to search github repositories and users using keywords and (currently) a handful of additional criteria.

Installation

To install git search you can use pip3 with the following command;

1
pip3 install gitsearch-cli

Usage

By default the search will be scoped to look in repositories, however you can change the scope to look specifically for users.

For additional help, just use;

1
git-search --help

Searching for Users

1
2
3
4
5
git-search --scope=users owen rumney

or

git-search --scope=users owenrumney

This will yield the following results;

usernameurl
owenrumneyhttps://github.com/owenrumney

Searching for repositories

When searching for repositories you can create a general search by keyword or focus the search by including the language and/or user.

1
git-search -l=scala -u=apache spark

This will give the following result;

nameownerurl
fluo-muchosapachehttps://github.com/apache/fluo-muchos
predictionioapachehttps://github.com/apache/predictionio
sparkapachehttps://github.com/apache/spark
spark-websiteapachehttps://github.com/apache/spark-website

If you want to only return results where the keyword is in the name, you can use the --nameonly flag

1
git-search -l=scala -u=apache spark --nameonly

This will give the following result;

nameownerurl
sparkapachehttps://github.com/apache/spark
spark-websiteapachehttps://github.com/apache/spark-website

TODO

  • Add date based options for search criteria
  • Refactor the code to be more pythonic
This post is licensed under CC BY 4.0 by the author.