Skip to content
Go to file

Latest commit


Failed to load latest commit information.

git + = gitlab Build Status Go Report Card codecov Join the chat at CC0 License Donate

Lab wraps Git or Hub, making it simple to clone, fork, and interact with repositories on GitLab, including seamless workflows for creating merge requests, issues and snippets.

$ lab clone gitlab-com/infrastructure

# expands to:
$ git clone

hub + = hublab??

lab will look for hub and uses that as your git binary when available so you don't have to give up hub to use lab

$ lab version
git version 2.11.0
hub version 2.3.0-pre9
lab version 0.17.2


The hub tool made my life significantly easier and still does! lab is heavily inspired by hub and attempts to provide a similar feel.



  • git or hub


brew install zaquestion/tap/lab


nix-env -f '<nixpkgs>' -iA gitAndTools.lab


scoop bucket add zaquestion
scoop install lab


apk add lab


Installs lab into /usr/local/bin/

curl -s | sudo bash

NOTE: Please take care when executing scripts in this fashion. Make sure you trust the developer providing the script and consider peaking at the install script itself (ours is pretty simply ;)

PreBuilt Binaries

Head to the releases page and download your preferred release



git clone
cd lab
go install -ldflags "-X \"main.version=$(git  rev-parse --short=10 HEAD)\"" .


make install


See the contribution guide.


lab needs your GitLab information in order to interact with to your GitLab instance. There are several ways to provide this information to lab:

  1. environment variables: LAB_CORE_HOST, LAB_CORE_TOKEN;
    • If these variables are set, the config files will not be updated.
  2. environment variables: CI_PROJECT_URL, CI_JOB_TOKEN;
    • Note: these are meant for when lab is running within a GitLab CI pipeline
    • If these variables are set, the config files will not be updated.
  3. local configuration file in Tom's Obvious, Minimal Language (TOML): ./lab.toml;
    • No other config files will be used as overrides if a local configuration file is specified
  4. user-specific configuration file in TOML: ~/.config/lab/lab.toml.
  5. work-tree configuration file in TOML: .git/lab/lab.toml. The values in this file will override any values set in the user-specific configuration file.

If no suitable config values are found, lab will prompt for your GitLab information and save it into ~/.config/lab/lab.toml. For example:

$ lab
Enter default GitLab host (default:
Enter default GitLab token:

Command-specific flags can be set in the config files.

  comments = true # sets --comments on 'mr show' commands


lab provides completions for bash, elvish, fish, powershell and zsh.


lab completion bash will generate a bash completion script. Save this script and source it in your .bashrc:

source "/path/to/lab-completions.bash"


lab completion elvish will generate an elvish completion script. Save this script to ~/.elvish/lib/lab.elv and add use lab to your startup script at ~/.elvish/rc.elv


lab completion fish will generate a fish completion script. Save this script to ~/.config/fish/completions/


lab completion powershell will generate a powershell completion script. Save this script to ~/.config/powershell/lab-completions.ps1 and add Get-Content ~/.config/powershell/lab-completions.ps1 | Out-String | Invoke-Expression to your profile script at ~/.config/powershell/Microsoft.PowerShell_profile.ps1 (you might want to enable menu completion as well with Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete).


lab completion zsh will generate a zsh completion script. zsh completions are denoted with the syntax _command-name, so save the output of lab completion to a file name _lab. Place the file in your $FPATH, or create an new directory and add it to your $FPATH.

fpath=(/path/to/script_directory $fpath)


Like hub, lab feels best when aliased as git. In your .bashrc or .bash_profile:

alias git=lab

NOTE: before aliasing, if you use git in your shell prompt command, be sure lab works by it's own first:

$ lab
Enter GitLab host (default:

To the extent possible under law, Zaq? Wiedmann has waived all copyright and related or neighboring rights to Lab. This work is published from: United States.

You can’t perform that action at this time.