I think I tried that a year ago, but api_client is a private method in commands.rb, so couldn't really get to it in a non hacky way.  https://github.com/github/hub/blob/master/lib/hub/commands.rb#L827.  In fact, I think I basically copy pasted from there.  If you wanted that api_client method could be moved into its own object so it was useable in other places that seems reasonable to me.