Using gitlab with glab cli tool

misc

On MacOS you can install glab with homebrew: brew install glab.

First thing to do, after installing glab is to add your gitlab instances, with the following command:

glab auth login --hostname gitlab.your-domain.com --token glpat-blablabla

This would globally add your gitlab instance with associated token in a global config ~/.config/glab-cli/config.yml


Inside individual projects you need to explicitly set host: glab config set host gitlab.your-domain.com, where * your-domain.com* is the global instance, we've added previously. These settings are stored in current_project/.git/glab-cli/config.yml

Then you can use all available commands, like glab repo search -s "repo-name.