glab
Official gitlab cli client
Install
sudo pacman -S glab
Configuration
Authentication:
Get a GitLab personal access token with
apiandwrite_repositoryscopes
export GITLAB_HOST=https://0xacab.org/
export GITLAB_TOKEN=$(gopass show --password token/0xacab.org/glab)
Usage
Merge requests
List all open MRs in group:
glab mr list --group 123..
CI
glab ci trace
Access tokens
Personal access token
List active PATs:
glab token list --user @me -a
List all PATs (including inactive ones):
glab token list --user @me
Rotate PAT:
glab token rotate --user @me --duration 365d TOKEN
Project access token
List active project token:
glab token list -a
Create project token:
glab token create --scope "api" --
Rotate project token with maximaum duration (365 days):
glab token rotate -D 365d flux-imagePull