/cli-github

Github within the CLI :computer:

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

#cli-github

A Command-Line Python Application to display Github from the CLI !

Click here to see it live in action!

Build Status Version Downloads
Build Status PyPI version PyPi downloads

##Version 1.0.5

  • Fixed URL parsing bugs
  • Left Indented repo names
  • Fixed Python 2/3 compatibility issues
  • Option to list releases of a user's repo

#Screenshots

To fetch repos and stars using the username

Username

To fetch repos and stars using the profile URL

URL

To get all the files and folders within a repo from its link

Tree

To get the RAW version of readme file from the repo link

Readme

To get the list of releases of a user's repository

Releases

#Installation

##Using pip

pip install cli-github

##Get the latest build from the Source

  • Clone the repo git clone https://github.com/harshasrinivas/cli-github.git
  • Run python setup.py install

##Dependencies

  • prettytable pip install prettytable
  • future pip install future
  • python-dateutil pip install python-dateutil

#Setting Up

Github Token as Temporary Environment Variable

$ GITHUB_TOKEN=<your-token-with-quotes>

Github Token as Permanent Environment Variable

$ echo "export GITHUB_TOKEN=<your-token-with-quotes>" | sudo tee -a /etc/environment

Without saving your Environment Variable

$ cat cli_github/mains.py | sed -e "s/API_TOKEN = os.environ.get('GITHUB_TOKEN')/API_TOKEN = <your-token-with-quotes>/" > cli_github/mains.py


#Options

-h, --help            show this help message and exit
-n USERNAME, --username USERNAME
                    Get the list of repositories of the given username
-u URL, --url URL 
                    Get repos from the user profile URL
-r RECURSIVE, --recursive RECURSIVE
                    Get the file structure from the repo link URL
-R README, --readme README
                    Get the raw version of the repository readme file from repo link URL
-re RELEASES, --releases RELEASES
                 	Get the list of releases from repo link

#Usage

Display the list of a user's repositories from the username, along with the number of stargazers

$ cli-github -n harshasrinivas

Display the list of a user's repositories from the profile URL, along with the number of stargazers

$ cli-github -u https://github.com/harshasrinivas

Display all the files and folders within a repository recursively from the repository URL, along with their sizes

$ cli-github -r https://github.com/harshasrinivas/cli-github

Get the RAW version of the readme file of a repository from the repository URL

$ cli-github -R https://github.com/harshasrinivas/cli-github

Get the list of releases from the user's repo link

$ cli-github -re https://github.com/sananth12/ImageScraper

#Live Demo

DEMO : Display the list of a user's repositories from the username, along with the number of stargazers

DEMO : Display the list of a user's repositories from the profile URL, along with the number of stargazers

DEMO : Display all the folders and files within a repository recursively from the repository URL, along with their sizes

DEMO : To get the RAW version of the readme file of a repository from the repository URL

DEMO : To get the list of releases from the user's repository URL

#Contribute

If you want to add features, improve them, or report issues, feel free to send a pull request.

#License

GPL V3