Git Product home page Git Product logo

hubr's Introduction

hubr

Super simple github commandline tools, for fun, productivity, and Vim

Setup

Generate an oauth token from your GitHub account settings, then create a .hubrrc in your home directory. The vim commands for hubr will also look for a .hubrrc in the root directory of the current git repo, and any configs there will override the global one. See Vim Usage below

Sample:

TOKEN="your-token-here"
REPO_NAME="dhleong/hubr"
ME_LOGIN="dhleong"

hubr can be installed as a vim plugin using Vundle:

" most features rely on tpope's amazing fugitive;
" it may become an optional dependency in the future,
" but for now it's required
Bundle 'tpope/vim-fugitive'
Bundle 'dhleong/hubr'

Vim Usage

The included vim plugin provides direct access to the Github API from pure vimscript. The vimscript methods, by default, override most settings from the .hubrrc file based on the current repo, such as REPO_NAME and ME_LOGIN, so you don't need to include those in your .hubrrc unless you plan to use hubr.py as a terminal command.

hubr function examples

" kwarg methods like get_issues take a vim dict
let issues = hubr#get_issues({'milestone': '1.0'})

" the returned value is a native vim object mirroring the json
for issue in issues
    echo issue.number . ': ' . issue.title

    " null/None is represented by 0
    if type(issue.assignee) == type(0)
        echo "No assignee"
    endif
endfor

Unite.vim plugin

In addition to the API accessor methods, hubr provides a new gh_issue kind to Unite.vim, which lets you quickly access and interact with issues in your Github repo.

For example:

nnoremap ghi :Unite gh_issue:state=open:milestone?<cr>

Will let you type ghi in normal mode to call up a Unite window that lists open issues from GitHub in the milestone specified in a .hubrrc (either the global one, or repo-local). See the vim help file (:help hubr) for more information.

The default action uses open to open the issue in a browser; you can also use it from git commit to insert the Refs or Closes messages for one or more issues.

Command Usage

NOTE: The shell scripts should be considered deprecated in favor of the new python script, hubr.py. As soon as it supports arguments for terminal execution, the examples will be updated

Here are some examples:

  • Assign a ticket to yourself: gh-cmd accept 9001

  • Add a tag (say, "Accepted"): gh-cmd tag 9001 Accepted"

I do this enough that there's a shortcut: gh-cmd accept <issue-number>.

hubr's People

Contributors

dhleong avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

hubr's Issues

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.