Minuscule client libraries for Git forge APIs.



Minuscule client for the Github API

This library just provides the HTTP verbs. Instead of wrapping every resource, I recommend

Initial configuration

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

To acquire a token, go to 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:

    $ cd /path/to/repository
    $ git config eg_example_com.user employee
    $ emacs ~/.authinfo.gpg
    # -*- epa-file-encrypt-to: ("") -*-
    machine login employee password <token>

Note that unlike for, which uses github.user, the Git variable used to store the username for an Enterprise instance is named HOST.user, where HOST is the host part of the URI, with dots replaced with underscores.

  • Making a request:

    (let ((ghub-base-url ""))
      (ghub-get "/users/employee/repos"))


If you like this, then you might never-the-less prefer ghub+.el; a thick GitHub API client built on `ghub.el'. See

If you like this, then you might also like glab.el; a minuscule client for the Gitlab API. See

If you don't like this, then you might instead like gh.el; a big client for the Github API. See