Giter VIP home page Giter VIP logo

ghi's Introduction

ghi

GitHub Issues on the command line. Use your $EDITOR, not your browser.

ghi was originally created by Stephen Celis, and is now maintained by drazisil's fork here.

Install

Via brew (latest stable release):

brew install ghi

Via gem (latest stable release):

gem install ghi

Via curl (latest bleeding-edge versions, may not be stable):

curl -sL https://raw.githubusercontent.com/stephencelis/ghi/master/ghi > ghi && \
chmod 755 ghi && \
mv ghi /usr/local/bin

Usage

usage: ghi [--version] [-p|--paginate|--no-pager] [--help] <command> [<args>]
           [ -- [<user>/]<repo>]

The most commonly used ghi commands are:
   list        List your issues (or a repository's)
   show        Show an issue's details
   open        Open (or reopen) an issue
   close       Close an issue
   lock        Lock an issue's conversation, limiting it to collaborators
   unlock      Unlock an issue's conversation, opening it to all viewers
   edit        Modify an existing issue
   comment     Leave a comment on an issue
   label       Create, list, modify, or delete labels
   assign      Assign an issue to yourself (or someone else)
   milestone   Manage project milestones
   status      Determine whether or not issues are enabled for this repo
   enable      Enable issues for the current repo
   disable     Disable issues for the current repo

See 'ghi help <command>' for more information on a specific command.

Source Tree

You may get a strange error if you use SourceTree, similar to #275 and #189. You can follow the steps here to resolve this.

Contributing

If you're looking for a place to start, there are issues we need help with!

Once you have an idea of what you want to do, there is a section in the wiki to provide more detailed information but the basic steps are as follows.

  1. Fork this repo
  2. Do your work:
  3. Make your changes
  4. Run rake build
  5. Make sure your changes work
  6. Open a pull request!

FAQ

FAQs can be found in the wiki

Screenshot

Example

ghi's People

Contributors

alexchesters avatar davidcelis avatar dracos avatar dspinellis avatar gitusp avatar grayhatter avatar jamie avatar jech avatar john-nanney avatar joshbeckman avatar lfdm avatar mootoh avatar moriarty avatar nahi avatar naholyr avatar okurz avatar parkr avatar pc avatar r4um avatar richardlitt avatar shimpeiws avatar shubhamshuklaer avatar sinasamavati avatar stephencelis avatar tiddolangerak avatar timruffles avatar tomohiro avatar valpackett avatar wakeless avatar zol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ghi's Issues

git ANSI colors?

Hey Stephen,

I'm having trouble understanding how to use the ANSI colors with ghi. My prompt is using colors, and I set it up so git also uses colors (in status, log, etc...).

Do you know of a resource I could check out to get these ANSI colors set up? I'd really love to have a colorful ghi CLI.

Thanks for making this awesome :D

ghi: not a GitHub repo

I have two repos where I get this error message. One is brand new, one is older with only a gh-pages branch. Both are private. Let me know if I can help you troubleshoot.

Show patch

I would like to be able to something like ghi show --patch 200 | git am -3.

Could you add -p, and --patch to to the show command? You will have to suffix the issue URL with .patch to get it. It will only work on pull requests.

This is related to #47.

Verbose listing of issue should include comments

The comments of issues are also exposed, for taking an issue offline to work on it'd be nice to have them for the full issue context.

curl http://github.com/api/v2/json/issues/comments/stephencelis/ghi/2

Probably only want to do if issues has comments > 0 but this is a quick POC

diff --git a/lib/ghi/api.rb b/lib/ghi/api.rb
index ade3da5..6a3bed4 100644
--- a/lib/ghi/api.rb
+++ b/lib/ghi/api.rb
@@ -30,6 +30,10 @@ class GHI::API
     get(:list, state)["issues"].map { |attrs| GHI::Issue.new(attrs) }
   end

+  def comments(number)
+    get(:comments, number)["comments"]
+  end
+
   def show(number)
     GHI::Issue.new get(:show, number)["issue"]
   end
diff --git a/lib/ghi/cli.rb b/lib/ghi/cli.rb
index 6cec7ec..f09910e 100644
--- a/lib/ghi/cli.rb
+++ b/lib/ghi/cli.rb
@@ -129,6 +129,13 @@ module GHI::CLI #:nodoc:
       return l unless verbose
       l << ""
       l += indent(issue.body)[0..-2]
+      comments = api.comments(issue.number)
+      comments.each do |c|
+         l << " user: #{c['user']}"
+         l << " commented at: #{c['created_at']}"
+         l << " #{c['body']}"
+      end
+      return l
     end

     def action_format(value = nil)

Listing all open issues, unassigned

It doesn't seem to be possible to list all issues in a repo. Ideally I'd like to see all issues regardless of assignment.

~|⇒ ghi list -u -- jmazzi/crypt_keeper
/home/justin/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/ghi-0.9.0.20120731/lib/ghi/commands/list.rb:71:in `block (2 levels) in options': undefined method `sub' for nil:NilClass (NoMethodError)
    from /home/justin/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/optparse.rb:1391:in `call'
    from /home/justin/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/optparse.rb:1391:in `block in parse_in_order'
    from /home/justin/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/optparse.rb:1347:in `catch'
    from /home/justin/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/optparse.rb:1347:in `parse_in_order'
    from /home/justin/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/optparse.rb:1341:in `order!'
    from /home/justin/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/optparse.rb:1432:in `permute!'
    from /home/justin/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/optparse.rb:1453:in `parse!'
    from /home/justin/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/ghi-0.9.0.20120731/lib/ghi/commands/list.rb:92:in `execute'
    from /home/justin/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/ghi-0.9.0.20120731/lib/ghi/commands/command.rb:17:in `execute'
    from /home/justin/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/ghi-0.9.0.20120731/lib/ghi.rb:76:in `execute'
    from /home/justin/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/ghi-0.9.0.20120731/bin/ghi:4:in `<top (required)>'
    from /home/justin/.rbenv/versions/1.9.3-p194/bin/ghi:23:in `load'
    from /home/justin/.rbenv/versions/1.9.3-p194/bin/ghi:23:in `<main>'
~|⇒ 

Validate usernames and tokens

We should validate with an innocuous API hit, re-requesting the username if it does not exist, or re-requesting the token if the API hit fails authentication.

ghi open issues: undefined method `link`

when using ghi open -m "Title Here" -L label-here causes this error:

/usr/local/bin/ghi:3648:in `execute': undefined method `unlink' for nil:NilClass (NoMethodError)
    from /usr/local/bin/ghi:2484:in `execute'
    from /usr/local/bin/ghi:70:in `execute'
    from /usr/local/bin/ghi:3717

I can't see anything I type after I run ghi.

The commands still work. I can type "ls" and get output, but when I type something I just don't see it. This happens consistently right after I run ghi, and only if I don't have the username/token set.

Open All in Browser

I've got this in my bash profile to allow me to open up all issues in my browser (sometimes quite a length operation, depending on how many there are). I find it very useful for those times that you want to audit the issues and update yourself with everything to ensure you're update-to-date.

I submit it to you for your consideration.

function ghi-w() {
  ghi $* | awk '{ print substr($1,1,length($1)-1), "\n" }' | cat | xargs -n 1 ghi -w $*
}

Example usage: ghi-w -u icio

Validation Failed

I've tried email:password, username:password nothing works. What's going on? Is it validating my github account? Because it's the right credentials.

ghi broken: issue.rb:6:in `initialize': undefined method `[]'

ghi completely broken on my system.

I'm running the latest snow leopard: 10.6.2

Ruby Version: ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]

Steps to reproduce:

    $ git clone [email protected]:nharbour/git-deploy.git
    $ cd git-deploy
    $ ghi

Gives the following error:

    # Open issues on nharbour/git-deploy
    /Library/Ruby/Gems/1.8/gems/ghi-0.2.4/lib/ghi/issue.rb:6:in `initialize': undefined method `[]' for #<YAML::Object:0x10171de30> (NoMethodError)
            from /Library/Ruby/Gems/1.8/gems/ghi-0.2.4/lib/ghi/api.rb:28:in `new'
            from /Library/Ruby/Gems/1.8/gems/ghi-0.2.4/lib/ghi/api.rb:28:in `list'
            from /Library/Ruby/Gems/1.8/gems/ghi-0.2.4/lib/ghi/api.rb:28:in `map'
            from /Library/Ruby/Gems/1.8/gems/ghi-0.2.4/lib/ghi/api.rb:28:in `list'
            from /Library/Ruby/Gems/1.8/gems/ghi-0.2.4/lib/ghi/cli.rb:460:in `list'
            from /Library/Ruby/Gems/1.8/gems/ghi-0.2.4/lib/ghi/cli.rb:248:in `run!'
            from /Library/Ruby/Gems/1.8/gems/ghi-0.2.4/lib/ghi/cli.rb:239:in `parse!'
            from /Library/Ruby/Gems/1.8/gems/ghi-0.2.4/bin/ghi:6
            from /usr/bin/ghi:19:in `load'
            from /usr/bin/ghi:19

http://pastie.org/780719

API works fine through CURL:

    curl http://github.com/api/v2/yaml/issues/list/nharbour/git-deploy/open
    --- 
    issues: 
    - !ruby/object:Issue 
      attributes: 
        votes: "0"
        number: "1"
        position: "1"
        issue_comments_count: "0"
        created_at: 2010-01-16 04:20:11
        title: my title
        body: test
        updated_at: 2010-01-16 04:20:11
        id: "113989"
        user_id: "38154"
        closed_at: 
        repository_id: "84647"
        state: open
      attributes_cache: {}

    - !ruby/object:Issue 
      attributes: 
        votes: "0"
        number: "2"
        position: "2"
        issue_comments_count: "0"
        created_at: 2010-01-16 04:29:38
        title: second issue
        body: boo
        updated_at: 2010-01-16 04:29:38
        id: "113995"
        user_id: "38154"
        closed_at: 
        repository_id: "84647"
        state: open
      attributes_cache: {}

ghi edit

Isn't it supposed to auto-detect the head branch? I have to specifically declare: -h user:branch for it to change to a pull request

ability to add priority and severity of issues

Not sure if github itself supports capability to assign priority and severity of an issue and wondering if ghi can extend the same to cli.

I am also wondering how to increase the ghi output column size. right now, I have a putty that shows 132 columns, but ghi list output is cut off after 80 columns.

Can't reference github token in another file in .gitconfig

Looks like some responses are simply returning false where they should be hashes. Not sure if this is a shift in the underlying Github API or what. I'm using 0.2.5 of ghi on 1.8.7 on natty.

$ ghi
# Open issues on technomancy/swank-clojure
/var/lib/gems/1.8/gems/ghi-0.2.5/lib/ghi/api.rb:82:in `get': undefined method `[]' for false:FalseClass (NoMethodError)
    from /var/lib/gems/1.8/gems/ghi-0.2.5/lib/ghi/api.rb:30:in `list'
    from /var/lib/gems/1.8/gems/ghi-0.2.5/lib/ghi/cli.rb:465:in `list'
    from /var/lib/gems/1.8/gems/ghi-0.2.5/lib/ghi/cli.rb:249:in `run!'
    from /var/lib/gems/1.8/gems/ghi-0.2.5/lib/ghi/cli.rb:240:in `parse!'
    from /var/lib/gems/1.8/gems/ghi-0.2.5/bin/ghi:6
    from /var/lib/gems/1.8/bin/ghi:19:in `load'
    from /var/lib/gems/1.8/bin/ghi:19

New Dev Environment, "GitHub hiccuped"

Hey, started with a new computer today and moved all of my dotfiles over. I went to use ghi for a project I've been using it for for a while but to no avail. I got this:

aadc-rwmp:CALS-Core pjm336$ ghi list
# Open issues on CALSCommunications/CALS-Core
ghi: GitHub hiccuped on your request (CALSCommunications/CALS-Core)

My .gitconfig contains the appropriate info:

[github]
    user = parkr
    token = [REDACTED]

Ruby 1.9 error?

I can list issues just fine, but when I try to comment on an issue, I receive this error. From the trace, I'm thinking it's a ruby 1.9 error and not specific to ghi. Am I right?

/usr/local/lib/ruby19/1.9.1/net/http.rb:1529:in dup': can't dup Symbol (TypeError) from /usr/local/lib/ruby19/1.9.1/net/http.rb:1529:inurlencode'
from /usr/local/lib/ruby19/1.9.1/net/http.rb:1524:in block in encode_kvpair' from /usr/local/lib/ruby19/1.9.1/net/http.rb:1524:inmap'
from /usr/local/lib/ruby19/1.9.1/net/http.rb:1524:in encode_kvpair' from /usr/local/lib/ruby19/1.9.1/net/http.rb:1517:inblock in set_form_data'
from /usr/local/lib/ruby19/1.9.1/net/http.rb:1517:in each' from /usr/local/lib/ruby19/1.9.1/net/http.rb:1517:inmap'
from /usr/local/lib/ruby19/1.9.1/net/http.rb:1517:in set_form_data' from /usr/local/lib/ruby19/1.9.1/net/http.rb:415:inpost_form'
from /usr/local/lib/ruby19/gems/1.9.1/gems/ghi-0.2.1/lib/ghi/api.rb:79:in post' from /usr/local/lib/ruby19/gems/1.9.1/gems/ghi-0.2.1/lib/ghi/api.rb:61:incomment'
from /usr/local/lib/ruby19/gems/1.9.1/gems/ghi-0.2.1/lib/ghi/cli.rb:531:in comment' from /usr/local/lib/ruby19/gems/1.9.1/gems/ghi-0.2.1/lib/ghi/cli.rb:250:inrun!'
from /usr/local/lib/ruby19/gems/1.9.1/gems/ghi-0.2.1/lib/ghi/cli.rb:235:in parse!' from /usr/local/lib/ruby19/gems/1.9.1/gems/ghi-0.2.1/bin/ghi:6:in<top (required)>'
from /usr/local/bin/ghi:19:in load' from /usr/local/bin/ghi:19:in

'

Issue, NoMethod []

/usr/local/bin/ghi:3664:in `execute`: undefined method `[]` for nil:NilClass (NoMethodError)
      from /usr/local/bin/ghi:2483:in `execute`
      from /usr/local/bin/ghi:70:in `execute`
      from /usr/local/bin/ghi:3725

when trying to do ghi open

I think it was due to me not being un-authed when I re-downloaded it?

Doesn't work on Windows?

Hey, sorry if I got that wrong, but the command line client doesn't seem to work under Windows (XP).
When i enter "ghi" it just responds with "The filename, directory name, or volume label syntax is incorrect."

I guess it's a different way you include executables within your gem?

Anyways, great gem otherwise! Cheers, Dennis

Add ability to see who claimed an issue when viewing one through "ghi <#>"

Example:

      number:  185
       state:  open
       title:  Add a Service Opportunities View to Upcoming Events on Community                Home               
        user:  csiegfried
       votes:  0
  created at:  Thu Oct 13 17:59:06 -0500 2011
  updated at:  Mon Oct 17 09:48:37 -0500 2011

Perhaps:

      number:  185
       state:  open
       title:  Add a Service Opportunities View to Upcoming Events on Community                Home               
        user:  csiegfried
  claimed by:  clifton
       votes:  0
  created at:  Thu Oct 13 17:59:06 -0500 2011
  updated at:  Mon Oct 17 09:48:37 -0500 2011

Interactive mode

An interactive mode would be valuable. While commands are relatively short for local directories that are repositories, browsing remote repositories can be cumbersome with the -r flag requirement

Save issue/comment/milestone bodies in .git if in repo dir

As long as we're in a repository, we should save GHI_ISSUE, GHI_COMMENT, and GHI_MILESTONE just in case validation fails so we don't lose our work.

In lieu of a .git directory, we could still save in tmp without using a Tempfile.

Should consume all arguments

I would like to write

ghi -o Should consume all arguments

Right now the line throws away everything after "Should".

Obviously this is not a bug. I can always write

ghi -o "Should consume all arguments"

but eating all remaining args and treating them as one would be nice (and many other tools do this).

"ghi assign <issue>" doesn't work

When trying to assign a bug to a user no query gets executed.

I've fixed this by moving the end in the execute method of the Edit class up 5 lines. This way the patch query gets executed whether or not the title of the issue was modified.

Add ability to list in reverse order

Not sure if others feel the same way, but I'd like an argument to be able to view the issues from most recent to least recent (now they are from least recent to most recent).

Thoughts?

Accept commands (in addition to flags)

As the API expands, flags may become more and more cumbersome. Splitting functionality into commands would help us prepare for this, and provide an additional syntax to those who prefer it. E.g.,

% ghi list

Commands can be split into the higher level API actions.

Do not cache messages with the -r flag

If you access a repository using the -r flag, and the request fails, the message is still cached if a .git directory is within scope. We should fall back to Tempfile in these cases, alternatively spitting the message back to stdout, or prompting for a path where the tempfile could be permanently saved. We could also provide a URL where the user could try again (if there are API issues).

Probs with new command parser?

 $  ghi -l 
more: unknown option "-E"
usage: more [-dflpcsu] [+linenum | +/pattern] name1 name2 ...
 /usr/lib/ruby/gems/1.8/gems/stephencelis-ghi-0.1.2/lib/ghi/cli.rb:164:in `write': Broken pipe (Errno::EPIPE)
from /usr/lib/ruby/gems/1.8/gems/stephencelis-ghi-0.1.2/lib/ghi/cli.rb:164:in `puts'
from /usr/lib/ruby/gems/1.8/gems/stephencelis-ghi-0.1.2/lib/ghi/cli.rb:164:in `puts'
from /usr/lib/ruby/gems/1.8/gems/stephencelis-ghi-0.1.2/lib/ghi/cli.rb:429:in `list'
from /usr/lib/ruby/gems/1.8/gems/stephencelis-ghi-0.1.2/lib/ghi/cli.rb:226:in `run!'
from /usr/lib/ruby/gems/1.8/gems/stephencelis-ghi-0.1.2/lib/ghi/cli.rb:217:in `parse!'
from /usr/lib/ruby/gems/1.8/gems/stephencelis-ghi-0.1.2/bin/ghi:5
from /usr/bin/ghi:19:in `load'
from /usr/bin/ghi:19

ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]

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.