Skip to content

Gitlab CLI clients

glab

Official gitlab cli client

see glab.md

python-gitlab

  • github
  • docs
  • 1.7k ⭐
  • Ubuntu package lacks behind as expected!

    ln -s /usr/bin/python-gitlab ~/bin/gitlab

or:

pipx install 'python-gitlab[autocompletion]'

CLI usage

https://python-gitlab.readthedocs.io/en/stable/cli-objects.html

Config: ~/.python-gitlab.cfg

Show current user:

gitlab -g open.greenhost.net current-user get

Show project:

gitlab -g open.greenhost.net project get --id 6

Download latest artifacts:

gitlab -g open.greenhost.net project artifacts --id 6 --ref-name 555_prom_alerts --job setup-openappstack

List all master pipeline ids:

gitlab -g open.greenhost.net project-pipeline list --project-id 6 --ref master

Snipetts:

gitlab snippet list

e="$(cat bin/nextcloud_deck_export.py)"
gitlab snippet create --title nextcloud_deck_export.py --file-name nextcloud_deck_export.py \
  --visibility public --content "$e"

lab

config at: /home/varac/.config/lab.hcl

Usage

Show all merged MRs: lab mr list -s merged -a Pretty-print MR list: lab mr list -s merged -a | awk '{first = $1; $1=""; print "*" $0, "(" first ")"}'

Other clients

Unmaintained cli clients (as of 2021-03)

Recursively clone all projects in group