Skip to content
/ glab Public
forked from profclems/glab

An open-source GitLab command line tool

License

Notifications You must be signed in to change notification settings

unjuli/glab

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GLab

All Contributors

Go Report Card GitHub Workflow Status .github/workflows/build_docs.yml Gitter License Twitter

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. Inspired by gh, the official GitHub CLI tool.

image

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 release
  • glab repo
  • glab label
  • glab alias

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 view

Learn More

Read the documentation for more information on this tool.

Support glab πŸ’–

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! πŸ™ [Contribute]

Individuals

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

Backers

Thank you to all our backers! πŸ™ [Become a backer]

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 bash

or

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

Installs into usr/local/bin

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

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 glab

Linux

Downloads available via linuxbrew (homebrew) and tar balls

Linuxbrew (Homebrew)

brew install profclems/tap/glab

Updating:

brew upgrade glab

Arch Linux

glab is available through the gitlab-glab-bin package on the AUR.

Manual Installation

Download the tar ball, untar and install:

  1. Download the .tar.gz file from the releases page
  2. unzip glab-*-linux-amd64.tar.gz to unzip the downloaded file
  3. sudo mv glab-*-linux-amd64/glab /usr/bin

MacOS

glab is available via Homebrew or you can manually install

Homebrew

brew install profclems/tap/glab

Updating:

brew upgrade glab

Installing manually

  1. Download the .tar.gz or .zip file from the releases page and unzip or untar
  2. ls /usr/local/bin/ || sudo mkdir /usr/local/bin/; to make sure the bin folder exists
  3. 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:

  1. Verify that you have Go 1.13.8+ installed

    $ go version
    go version go1.14

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

  2. Clone this repository

    $ git clone https://github.com/profclems/glab.git glab-cli
    $ cd glab-cli

    or

    $ git clone https://gitlab.com/profclems/glab.git
    $ cd glab-cli
  3. Build the project

    $ make build
    
  4. Move the resulting bin/glab executable to somewhere in your PATH

    $ sudo mv ./bin/glab /usr/local/bin/

    or

    $ sudo mv ./bin/glab /usr/bin/
  5. Run glab version to check if it worked and glab config -g to set up

Configuration

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.

To set configuration globally

glab config init -g # Will be prompted for details

or

glab config set -g token xxxxxx --host=gitlab.com

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

glab config init  # Will be prompted for basic details

or

glab config set -g token xxxxxx --host=gitlab.com

Example

glab config 

NB: Change gitlab.com to company or group's gitlab url (eg. gitlab.example.com) 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 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

ToDo

Aside adding more features, the biggest thing this tool still needs is tests 😞

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 ✨

Thanks goes to these wonderful people (emoji key):


Bradley Garrod

πŸ’» πŸ“¦ πŸ“–

Matheus Lugon

🎨

Opoku-Dapaah

πŸ“– 🎨

Prasanna Kumar Gollangi

πŸ’» 🚧

Sune Keller

πŸ’΅ πŸ’»

sattellite

πŸ’» πŸ›

Abdelhak Akermi

πŸ’»

Patrick McMichael

πŸ“–

Christian Wolff

πŸ“–

Amith Mihiranga

πŸ“–

Clement Sam

πŸ’» 🚧 πŸ“¦

John McAvoy

πŸ’»

wiwi

πŸ’»

Benjamin Graf

πŸ’»

andhe

πŸ’» πŸ›‘οΈ

Zachary Springer

πŸ’΅

zemzale

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

License

Copyright Β© Clement Sam

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

About

An open-source GitLab command line tool

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 99.2%
  • Other 0.8%