Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

glab

> DevOps
Open source

The GitLab CLI tool. Archived: now officially adopted by GitLab as the official CLI tool and maintained at https://gitlab.com/gitlab-org/cli. See https://github

2.1K stars0 likes0 views
WebsiteGitHub

About

The GitLab CLI tool. Archived: now officially adopted by GitLab as the official CLI tool and maintained at https://gitlab.com/gitlab-org/cli. See https://github

ANNOUNCEMENT

FOLLOWING THE EARLIER ANNOUNCEMENT ABOUT ITS OFFICIAL ADOPTION BY AND TRANSITION TO GITLAB (SEE https://github.com/profclems/glab/issues/983), THIS PROJECT IS NO LONGER MAINTAINED IN THIS REPOSITORY . THE NEW HOME OF THIS PROJECT IS https://gitlab.com/gitlab-org/cli. ALL NEW CONTRIBUTIONS (INCLUDING FEATURE REQUESTS AND BUG REPORTS) SHOULD BE SENT TO THE OFFICIAL REPOSITORY ON GITLAB.

GLab

GLab is an open source GitLab CLI tool bringing GitLab to your terminal next to where you are already working with git and your code without switching between windows and browser tabs. Work with issues, merge requests, watch running pipelines directly from your CLI among other features. Inspired by gh, the official GitHub CLI tool.

glab is available for repositories hosted on GitLab.com and self-hosted GitLab Instances. glab supports multiple authenticated GitLab instances and automatically detects the authenticated hostname from the remotes available in the working git directory.

Table of Contents

  • Usage
  • Demo
  • Documentation
  • Installation
    • Quick Install
    • Windows
      • WinGet
      • Scoop
      • EXE Installer
    • Linux
      • Linuxbrew (Homebrew)
      • Snapcraft
      • Arch Linux
      • KISS Linux
      • Alpine Linux
        • Install a pinned version from edge
        • Alpine Linux Docker-way
      • Nix/NixOS
    • macOS
      • Homebrew
      • MacPorts
    • Building From Source
      • Prerequisites
  • Authentication
  • Configuration
  • Environment Variables
  • What about lab
  • Issues
  • Contributing
    • Support glab
      • Individuals
      • Backers
  • License

Usage

bash
glab <command> <subcommand> [flags]

Demo

Documentation

Read the documentation for usage instructions.

Installation

Download a binary suitable for your OS at the releases page.

Quick Install

Supported Platforms: Linux and macOS

Homebrew

bash
brew install glab

Updating (Homebrew):

bash
brew upgrade glab

Alternatively, you can install glab by shell script:

bash
curl -sL https://j.mp/glab-cli | sudo sh

or

bash
curl -s https://raw.githubusercontent.com/profclems/glab/trunk/scripts/install.sh | sudo sh

Installs into usr/bin

NOTE: Please take care when running scripts in this fashion. Consider peeking at the install script itself and verify that it works as intended.

Windows

Available for download via WinGet, scoop, or downloadable EXE installer file.

WinGet

bash
winget install glab.glab

Updating (WinGet):

bash
winget install glab.glab

Scoop

bash
scoop install glab

Updating (Scoop):

bash
scoop update glab

EXE Installer

EXE installers are available for download on the releases page.

Linux

Prebuilt binaries available at the releases page.

Linuxbrew (Homebrew)

bash
brew install glab

Updating (Homebrew):

bash
brew upgrade glab

Snapcraft

Make sure you have snap installed on your Linux Distro.

  1. sudo snap install --edge glab
  2. sudo snap connect glab:ssh-keys to grant ssh access

Arch Linux

glab is available through the community/glab package or download and install an archive from the releases page. Arch Linux also supports snap.

bash
pacman -S glab

KISS Linux

WARNING: It seems that KISS Linux may no longer be actively maintained, so links to its web domain have been removed from this README.

glab is available on the KISS Linux Community Repo as gitlab-glab. If you already have the community repo configured in your KISS_PATH you can install glab through your terminal.

bash
kiss b gitlab-glab && kiss i gitlab-glab

Alpine Linux

glab is available on the Alpine Community Repo as glab.

Install

We use --no-cache so we don't need to do an apk update before.

bash
apk add --no-cache glab
Install a pinned version from edge

To ensure that by default edge will be used to get the latest updates. We need the edge repository under /etc/apk/repositories.

Afterwards you can install it with apk add --no-cache glab@edge

We use --no-cache so we don't need to do an apk update before.

bash
echo "@edge http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
apk add --no-cache glab@edge
Alpine Linux Docker-way

Use edge directly

bash
FROM alpine:3.13
RUN apk add --no-cache glab

Fetching latest glab version from edge

bash
FROM alpine:3.13
RUN echo "@edge http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk add --no-cache glab@edge

Nix/NixOS

Nix/NixOS users can install from nixpkgs:

bash
nix-env -iA nixos.glab

macOS

Homebrew

glab is available via Homebrew

bash
brew install glab

Updating:

bash
brew upgrade glab

MacPorts

glabis also available via MacPorts

bash
sudo port install glab

Updating:

bash
sudo port selfupdate && sudo port upgrade glab

Building From Source

If a supported binary for your OS is not found at the releases page, you can build from source:

Prerequisites for building from source

  • make
  • Go 1.13+
  1. Verify that you have Go 1.13+ installed

    bash
    $ go version
    go version go1.14

    If go is not installed, follow instructions on the Go website.

  2. Clone this repository

    bash
    git clone https://github.com/profclems/glab.git
    cd glab

    If you have $GOPATH/bin or $GOBIN in your $PATH, you can just install with make install (install glab in $GOPATH/bin) and skip steps 3 and 4.

  3. Build the project

    bash
    make
  4. Change PATH to find newly compiled glab

    bash
    export PATH=$PWD/bin:$PATH
  5. Run glab version to confirm that it worked

Authentication

Get a GitLab access token at https://gitlab.com/-/profile/personal_access_tokens or https://gitlab.example.com/-/profile/personal_access_tokens if self-hosted

  • start interactive setup

    bash
    glab auth login
  • authenticate against gitlab.com by reading the token from a file

    bash
    glab auth login --stdin < myaccesstoken.txt
  • authenticate against a self-hosted GitLab instance by reading from a file

    bash
    glab auth login --hostname salsa.debian.org --stdin < myaccesstoken.txt
  • authenticate with token and hostname (Not recommended for shared environments)

    bash
    glab auth login --hostname gitlab.example.org --token xxxxx

Configuration

By default, glab follows the XDG Base Directory Spec: global configuration file is saved at ~/.config/glab-cli. Local configuration file is saved at .git/glab-cli in the current working git directory. Advanced workflows may override the location of the global configuration by setting the GLAB_CONFIG_DIR environment variable.

To set configuration globally

bash
glab config set --global editor vim

To set configuration for current directory (must be a git repository)

bash
glab config set editor vim

To set configuration for a specific host

Use the --host flag to set configuration for a specific host. This is always stored in the global config file with or without the global flag.

bash
glab config set editor vim --host gitlab.example.org

Environment Variables

…

What about Lab?

Both glab and lab are open-source tools with the same goal of bringing GitLab to your command line and simplifying the developer workflow. In many ways lab is to hub, while glab is to gh.

If you want a tool that’s more opinionated and intended to help simplify your GitLab workflows from the command line, then glab is for you. However, If you're looking for a tool like hub that feels like using git and allows you to interact with GitLab, you might consider using lab.

Some glab commands such as ci view and ci trace were adopted from lab.

Issues

If you have an issue: report it on the issue tracker

Contributing

Feel like contributing? That's awesome! We have a contributing guide and Code of conduct to help guide you

Contributors

Individuals

This project exists thanks to all the people who contribute. [Contribute].

Organizations

License

Copyright © Clement Sam

glab is open-sourced software licensed under the MIT license.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Goclicommand-linecustom-gitlab-cligit

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理