Next: , Previous: , Up: Getting Started   [Contents]


2.2 Interactively Creating and Storing a Token

Ghub uses a different token for every package as well as for every machine from which you access the Github API (and obviously also for every Github instance and user). This allows packages to only request the scopes that they actually need and also gives users the opportunity to refuse access to certain scopes if they expect to not use the features that need them.

Usually you don’t have to worry about creating and storing a token yourself and can just make a request. Note however that you don’t have to use the setup wizard described below. Alternatively you can perform the setup manually as described in the next section.

If you make a request and the required token is not available yet, then the setup wizard will first ask you something like this:

Such a Github API token is not available:

  Host:    api.github.com
  User:    USERNAME
  Package: PACKAGE

  Scopes requested in `PACKAGE-github-token-scopes':
    repo
  Store on Github as:
    "Emacs package PACKAGE @ LOCAL-MACHINE"
  Store locally according to option `auth-sources':
    ("~/.authinfo" "~/.authinfo.gpg" "~/.netrc")

If in doubt, then abort and first view the section of
the Ghub documentation called "Interactively Creating
and Storing a Token".

Create and store such a token? (yes or no)

If you don’t have any doubts, then answer "yes". Lets address some of the doubts that you might have:

After the above prompt you are also asked for your username and password. If you have enabled two-factor authentication, then you also have to provide the authentication code at least twice. If you make sure the code is still good for a while when asked for it first, then you can just press RET at the later prompt(s).


Next: , Previous: , Up: Getting Started   [Contents]