Giter Site home page Giter Site logo

ghub's Introduction

ghub

Build Status

A command line interface for github.

Requirements

  • Python 3.4.3 or greater
  • git

Introduction

ghub is a simple command line utility for facilitating common tasks with github. It uses the repository found in the current working directory to determine upstream and origin URLs. You can also use a single origin repo if you prefer.

More exhaustive tools exist (see http://hub.github.com for one example). This tool is intended to be simple, fast and have few dependencies.

This tool is a work in progress.

Getting Started

  1. Install ghub:
    git clone [email protected]:ccstolley/ghub
    
    cd ghub
    
    python3 ./setup.py install
    
  2. Generate a personal access token from github.
  3. Stash the access token. This has potentially serious security implications. The token will be stored in the clear on the file system in a file readable only by you. Only do this on a machine you trust:
    ghub -S
    Enter token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    API token has been successfully stashed.
    
  4. Create remote repositories for upstream and origin. Eg.:
    git remote add origin [email protected]:joesmith/ghub
    
    # optional
    git remote add upstream [email protected]:ccstolley/ghub
    
  5. Drink a beer.

Usage

usage: ghub [-h] [-i] [-p] [-d] [-n base] [-m] [-c] [-o] [-x] [-a [login]]
            [-v] [-ok] [-r [login[,login2]]] [-S] [-U]
            [number] [message]

command line interface to github

positional arguments:
  number                optional issue/PR number/login
  message               optional message

optional arguments:
  -h, --help            show this help message and exit
  -i, --showissue       show issue #, or show all for specified user
  -p, --showpull        show pull request # or show all open pull requests by
                        default if number is not specified
  -d, --diff            show diff for pull request #
  -n base, --newpull base
                        create a new pull request from the current branch to
                        base_branch
  -m, --mergepull       merge pull request #
  -c, --comment         post comment on issue #
  -o, --openissue       create a new issue
  -x, --close           close an issue #
  -a [login], --assign [login]
                        assign an issue to login
  -v, --verbose         be verbose
  -ok, --approve        approve pull request #
  -r [login[,login2]], --review [login[,login2]]
                        request review from login(s)
  -S, --stashtoken      Stash github API token
  -U, --unstashtoken    Destroy stashed github API token

Examples

Display issue 442:

ghub -i 442

Post a comment issue 442:

ghub -c 442

Close issue 442:

ghub -x 442

List all open issues in this repo:

ghub -i

List all open pull requests in this repo:

ghub -p

List issues assigned to ccstolley, including comments and summary:

ghub -i ccstolley -v

Create a pull request from the current branch to the specific upstream branch:

ghub -n master

Add reviewers to pull request 414:

ghub -r manny,moe,jack 414

Display pull request and comments:

ghub -p 101

Approve pull request:

ghub -ok 101

Merge pull request:

ghub -m 101

Most commands also allow you to specify a message as an additional argument, eg:

ghub -ok 101 'LGTM'

ghub -x 442 'resolved by #440'

Display pull request diff in color (requires cdiff):

ghub -d 101 | cdiff

ghub's People

Contributors

bmaca avatar ccstolley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

bmaca shrikant224

ghub's Issues

Support GHE Hostnames

Github Enterprise accounts have different hostnames rather then the regular api.github.com

If the repo is hosted by GHE, the endpoints need to point to http(s)://[hostname]/api/v3 else api.github.com

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.