コマンドラインからGithubにIssueをOpenできるghiをインストール

ずっとこんなの欲しいなぁ,作ってみようかなぁと思っていてふと検索してみたらすごくいい感じのがあったのでインストールしてみる.

https://github.com/stephencelis/ghi

まぁこれは需要めちゃくちゃあるだろうし既存あるよなー! 作りたい気持ちはあったが,あやかろう!笑

gemでインストール...するもエラー

ということで早速インストール!

$ gem install ghi

「やっぱなんとなくイケてるしgemコマンドっしょ〜gem最高」

とか調子乗ってたらconfigするときにエラーが

▶ ghi config --auth totzYuta
Enter totzYuta's GitHub password (never stored): /Library/Ruby/Gems/2.0.0/gems/ghi-0.9.3/lib/ghi/authorization.rb:23:in `authorize!': uninitialized constant Module::Socket (NameError)
    from /Library/Ruby/Gems/2.0.0/gems/ghi-0.9.3/lib/ghi/commands/config.rb:27:in `execute'
    from /Library/Ruby/Gems/2.0.0/gems/ghi-0.9.3/lib/ghi/commands/command.rb:17:in `execute'
    from /Library/Ruby/Gems/2.0.0/gems/ghi-0.9.3/lib/ghi.rb:80:in `execute'
    from /Library/Ruby/Gems/2.0.0/gems/ghi-0.9.3/bin/ghi:4:in `<top (required)>'
    from /usr/bin/ghi:23:in `load'
    from /usr/bin/ghi:23:in `<main>'

んん...ユーザ名間違えてないよな...

とりあえず他の方法でインストール

brewでインストール

なんかダブったりしたらこわそうなので消しとく

$ sudo gem uninstall ghi

インストール

$ brew install ghi

使ってみる

ということで使って見る.まずはユーザの認証.

こ,こんどはいけた!!!!!!

$ ghi config --auth totzYuta
Enter totzYuta's GitHub password (never stored):     ✔
✔︎ Token saved to keychain.

gemを最近updateしたのでそのせいかもしれない..

なんかまずいこと起きそう.早めに原因調べておこうっと

と思ったけどしっかり認証されたみたいなのでうきういしながら使ってみたら...

▶ ghi list
⠴security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
#
Authorization required.

Please run 'ghi config --auth <username>'

からの

▶ ghi config --auth
Enter totzYuta's GitHub password (never stored):     ⠖security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
                                                     ✔
A ghi token already exists!

Please revoke all previously-generated ghi personal access tokens here:

  https://github.com/settings/applications

ふざけんな!なんなんだよ!

ということで上記のURLアクセスしてtokenを削除.もう一度認証を試みる...

$ ghi config --auth

そしたら以下を実行してみる

$ ghi list
# totzYuta/CoffeeNote open issues
  2: OAuth Login System of Twitter

いけたーーーー!!!!

ということでこれから快適なissueライフを送れそう