Gitsheet
Gitsheet is a command line utility designed to fetch/parse/format GitHub API data. Primary use cases include analytics and report-generating.
Gitsheet requests are authenticated using your Github credentials. As such, the results of all queries are limited to the permissions of your Github account.
Installation
Install RubyGems and follow the setup instructions.
Install the Gitsheet gem:
$ gem install gitsheet
Usage
Synopsis:
$ gitsheet [type] -u [username] -o [organization] -f [format]
Arguments:
type
is the data type to fetch. Can be either 'repos' or 'users'.
-o
the GitHub organization to search within eg: 'vervewireless'
-f
the format to output the results in. Can be either 'csv' or 'json'
Output
By default, gitsheet outputs raw csv data to stdout. This is useful because you can pass the output to various shell commands.
Write to a file:
$ gitsheet ... > report.csv
Keyword search through results:
$ gitsheet ... | grep [keyword]
Examples
Get all repositories in an organization:
$ gitsheet repos -u testuser -o vervewireless
Get all members of an organization:
$ gitsheet users -u testuser -o vervewireless
Get all repositories and write output to a .csv file:
$ gitsheet repos -u testuser -o vervewireless -f csv > report.csv
Development
Clone the repository:
$ git clone ssh@github.com/vervewireless/gitsheet.git
$ cd gitsheet/
Mac OSX Users should have a system version of Ruby installed:
$ ruby -v
Install Bundler:
$ gem install bundler
Install Gitsheet dependencies:
$ bundle install
TODO
Here are the next steps for Gitsheet
- Add unit tests
- Leverage Ruby gem to handle command line argument parsing, control flow etc.
- Better error handling
- More informative error messages
- A much better name!