GLab is an open source Gitlab Cli tool written in Go (golang) to help work seamlessly with Gitlab from the command line. Work with issues, merge requests, watch running pipelines directly from your CLI among other features.
gh, the official GitHub CLI tool.
glab <command> <subcommand> [flags]
auth: Manage glab's authentication state issue: Work with GitLab issues label: Manage labels on remote mr: Create, view and manage merge requests pipeline: Manage pipelines release: Manage GitLab releases repo: Work with GitLab repositories and projects
alias: Create, list and delete aliases check-update: Check for latest glab releases completion: Generate shell completion scripts config: Set and get glab settings help: Help about any command version: show glab version information
$ glab issue create --title="This is an issue title" --description="This is a really long description" $ glab issue list --closed $ glab pipeline ci view -b master # to watch the latest pipeline on master $ glab pipeline status # classic ci view
Read the documentation for more information on this tool.
Download a binary suitable for your OS at the releases page.
Quick Install (Bash)
You can install or update
curl -sL https://j.mp/glab-i | sudo bash
curl -s https://raw.githubusercontent.com/profclems/glab/trunk/scripts/quick_install.sh | sudo bash
NOTE: Please take care when running scripts in this fashion. Consider peaking at the install script itself and verify that it works as intended.
scoop bucket add profclems-bucket https://github.com/profclems/scoop-bucket.git scoop install glab
scoop update glab
Prebuilt binaries available at the releases page.
brew install glab
brew upgrade glab
Make sure you have snap installed on your Linux Distro (https://snapcraft.io/docs/installing-snapd).
sudo snap install --edge glab
sudo snap connect glab:ssh-keysto grant ssh access
pacman -Sy gitlab-glab-bin
glab is available on the KISS Linux Community Repo as
If you already have the community repo configured in your
KISS_PATH you can install
glab through your terminal.
kiss b gitlab-glab && kiss i gitlab-glab
If you do not have the community repo configured in your
KISS_PATH, follow the guide on the official guide Here to learn how to setup it up.
glab is available via Homebrew
brew install glab
brew 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 are:
- Go 1.13+
Verify that you have Go 1.13+ installed
$ go version go version go1.14
gois not installed, follow instructions on the Go website.
Clone this repository
$ 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.
Build the project
Move the resulting
bin/glabexecutable to somewhere in your PATH
$ sudo mv ./bin/glab /usr/local/bin/
glab versionto check if it worked and
glab config initto set up
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
$ glab auth login
- authenticate against gitlab.com by reading the token from a file
$ glab auth login --stdin < myaccesstoken.txt
- authenticate against a self-hosted GitLab instance by reading from a file
$ glab auth login --hostname salsa.debian.org --stdin < myaccesstoken.txt
- authenticate with token and hostname (Not recommended for shared environments)
$ glab auth login --hostname gitlab.example.org --token xxxxx
glab follows the XDG Base Directory Spec: global configuration file is saved at
~/.config/glab-cli. Local configuration file is saved at the root of the working git directory and automatically added to
To set configuration globally
$ glab config set --global editor vim
To set configuration for current directory (must be a git repository)
$ glab config set editor vim
To set configuration for a specific host
--host flag to set configuration for a specific host. This is always stored in the global config file with or without the
$ glab config set editor vim --host gitlab.example.org
GITLAB_TOKEN: an authentication token for API requests. Setting this avoids being prompted to authenticate and overrides any previously stored credentials. Can be set in the config with 'glab config set token xxxxxx' GITLAB_URI or GITLAB_HOST: specify the url of the gitlab server if self hosted (eg: https://gitlab.example.com). Default is https://gitlab.com. REMOTE_ALIAS or GIT_REMOTE_URL_VAR: git remote variable or alias that contains the gitlab url. Can be set in the config with 'glab config set remote_alias origin' VISUAL, EDITOR (in order of precedence): the editor tool to use for authoring text. Can be set in the config with 'glab config set editor vim' BROWSER: the web browser to use for opening links. Can be set in the config with 'glab config set browser mybrowser' GLAMOUR_STYLE: environment variable to set your desired markdown renderer style Available options are (dark|light|notty) or set a custom style https://github.com/charmbracelet/glamour#styles NO_COLOR: set to any value to avoid printing ANSI escape sequences for color output.
If you have an issue: report it on the issue tracker
By donating $5 or more you can support the ongoing development of this project. We'll appreciate some support. Thank you to all our supporters!
This project exists thanks to all the people who contribute. [Contribute].
Thank you to all our backers!
Copyright © Clement Sam
glab is open-sourced software licensed under the MIT license.