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.
Usage
glab <command> <subcommand> [flags]Core Commands
glab mr [list, create, close, reopen, delete]glab issue [list, create, close, reopen, delete]glab pipeline [list, delete, ci status, ci view]glab configglab help
Examples
$ 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 viewLearn More
Read the documentation for more information on this tool.
Installation
Download a binary suitable for your OS at the releases page.
Quick Install (Bash)
You can install or update glab with:
curl -sL https://j.mp/glab-i | sudo bashor
curl -s https://raw.githubusercontent.com/profclems/glab/trunk/scripts/quick_install.sh | sudo bashInstalls into usr/local/bin
Windows
Available for download on scoop or manually as an installable executable file or a Portable archived file in tar and zip formats at the releases page. Download and install now at the releases page.
The installable executable file sets the PATH automatically.
Scoop
scoop bucket add profclems-bucket https://github.com/profclems/scoop-bucket.git
scoop install glabLinux
Downloads available via linuxbrew (homebrew) and tar balls
Linuxbrew (Homebrew)
brew install profclems/tap/glabUpdating:
brew upgrade glabArch Linux
glab is available through the gitlab-glab-bin package on the AUR.
Manual Installation
Download the tar ball, untar and install:
- Download the
.tar.gzfile from the releases page unzip glab-*-linux-amd64.tar.gzto unzip the downloaded filesudo mv glab-*-linux-amd64/glab /usr/bin
MacOS
glab is available via Homebrew or you can manually install
Homebrew
brew install profclems/tap/glabUpdating:
brew upgrade glabInstalling manually
- Download the
.tar.gzor.zipfile from the releases page and unzip or untar - ls /usr/local/bin/ || sudo mkdir /usr/local/bin/; to make sure the bin folder exists
sudo mv glab-*-darwin-amd64/glab /usr/bin
Building From Source
If a supported binary for your OS is not found at the releases page, you can build from source:
-
Verify that you have Go 1.13.8+ installed
$ go version go version go1.14
If
gois not installed, follow instructions on the Go website. -
Clone this repository
$ git clone https://github.com/profclems/glab.git glab-cli $ cd glab-clior
$ git clone https://gitlab.com/profclems/glab.git $ cd glab-cli -
Build the project
$ make build -
Move the resulting
bin/glabexecutable to somewhere in your PATH$ sudo mv ./bin/glab /usr/local/bin/
or
$ sudo mv ./bin/glab /usr/bin/
-
Run
glab versionto check if it worked andglab config -gto set up
Configuration
To set configuration for current directory (must be a git repository)
glab config // Will be prompted for details
or
glab config --token=<YOUR-GITLAB-ACCESS-TOKEN> --url=https://gitlab.com --remote-var=originTo set configuration globally
glab config --global // Will be prompted for details
or
glab config --global --token=<YOUR-GITLAB-ACCESS-TOKEN> --url=https://gitlab.com --remote-var=originFor initial releases up to v1.6.1
glab config --token=<YOUR-GITLAB-ACCESS-TOKEN> --url=https://gitlab.com --pid=<YOUR-GITLAB-PROJECT-ID> --repo=OWNER/REPOExample
glab config --token=sometoken --url=https://gitlab.com --pid=someprojectid --repo=profclems/glabNB: Change gitlab.com to company or group's gitlab url if self-hosted
Environment Variables
GITLAB_TOKEN: an authentication token for API requests. Setting this avoids being
prompted to authenticate and overrides any previously stored credentials.
Can be set with `glab config --token=<YOUR-GITLAB-ACCESS-TOKEN>`
GITLAB_REPO: specify the Gitlab repository in "OWNER/REPO" format for commands that
otherwise operate on a local repository. (Depreciated in v1.6.2)
Can be set with `glab config --repo=OWNER/REPO`
GITLAB_URI: specify the url of the gitlab server if self hosted (eg: https://gitlab.example.com).
Default is https://gitlab.com.
Can be set with `glab config --url=gitlab.example.com`
VISUAL, EDITOR (in order of precedence): the editor tool to use for authoring text.
BROWSER: the web browser to use for opening links.
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#stylesContributions
Thanks for considering contributing to this project!
Please read the contributions guide and Code of conduct.
Feel free to open an issue or submit a pull request!
License
Copyright © Clement Sam
glab is open-sourced software licensed under the MIT license.
Author
Built with ❤ by Clement Sam
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!


