Support for Gitlab.com and other Gitlab instances is implemented in
the library glab.el
. This library is build on top of ghub.el
and is
maintained in the same repository, but it is distributed as a separate
package.
When accessing Gitlab.com or another Gitlab instance, use glab-request
instead of ghub-request
, glab-get
instead of ghub-get
, etc. Likewise
use the Git variables in the gitlab
group instead of those in the
github
group, i.e. gitlab.user
, gitlab.HOST.user
and gitlab.host
.
The Gitlab API cannot be used to create tokens, so Glab cannot provide a setup wizard like Ghub does. As a consequence if the user makes a request and the necessary token cannot be found, then that results in an error.
You have to manually create and store the necessary tokens. Tokens can be created at https://gitlab.com/profile/personal_access_tokens, or the equivalent URL for another Gitlab instance. To store the token locally, follow the instructions in Manually Creating and Storing a Token and How Ghub uses Auth-Source.
Packages that use Glab, can define PACKAGE-gitlab-token-scopes
for
documentation purposes. But unlike PACKAGE-github-token-scopes
, which
is used by the setup wizard this is optional.
And a random hint: where you would use user/repo
when accessing Github,
you have to use user%2Frepo
when accessing Gitlab, e.g.:
(glab-get "/projects/python-mode-devs%2Fpython-mode")