Skip to content
/ ghub Public
forked from magit/ghub

Minuscule client for the Github API

Notifications You must be signed in to change notification settings

drielsma/ghub

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 

Repository files navigation

Minuscule client for the Github API

This library just provides the HTTP methods. See https://developer.github.com/v3 for valid requests.

Initial configuration

$ git config --global github.user <username>
$ emacs ~/.authinfo.gpg
# -*- epa-file-encrypt-to: ("[email protected]") -*-
machine api.github.com login <login> password <token>

To acquire a token, go to https://github.com/settings/tokens. Note that currently the same token is shared by all Emacs packages that use ghub.el.

Usage examples

  • Getting details about a repository:

    (ghub-get "/repos/tarsius/ghub")
  • Listing names of all repositories of a user:

    (--keep (cdr (assq 'name it))
            (let ((ghub-unpaginate t))
               (ghub-get "/users/tarsius/repos")))
  • Making an unauthenticated request:

    (let ((ghub-authenticate nil))
      (ghub-get "/orgs/magit/repos"))
  • Making a request using basic authentication:

    (let ((ghub-authenticate 'basic))
      (ghub-get "/orgs/magit/repos"))

Github Enterprise support

  • Initial configuration:

    $ git config --global github.gh.example.com.user employee
    $ emacs ~/.authinfo.gpg
    # -*- epa-file-encrypt-to: ("[email protected]") -*-
    machine gh.example.com login employee password <token>
    
  • Making a request:

    (let ((ghub-base-url "https://gh.example.com"))
      (ghub-get "/users/employee/repos"))

Alternatives

  • ghub+ is a wrapper around ghub, which provides functions for accessing specific end-points.

  • gh is a more heavy weight implementation which uses Eieio.

  • glab is to Gitlab what ghub is to Github.

About

Minuscule client for the Github API

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Emacs Lisp 100.0%