lab: The Legacy GitLab Wrapper CLI
lab is a git wrapper for GitLab with commands like lab mr create; it is largely superseded by the official glab CLI.
lab (zaquestion/lab) was the community GitLab CLI before glab became official. Older pipelines still call it. Its verbs resemble glab but the token env vars differ.
What it does
lab wraps git and adds GitLab commands: lab mr create opens a merge request, lab ci status shows the pipeline for the current commit, and lab mr list lists MRs. It reads credentials from LAB_CORE_TOKEN and LAB_CORE_HOST or a config file.
Common usage
# non-interactive auth via env
export LAB_CORE_HOST="https://gitlab.com"
export LAB_CORE_TOKEN="$GLAB_PAT"
# open an MR from the current branch into main
lab mr create origin main -m "Add feature X"
lab ci statusOptions
| Command / Env | What it does |
|---|---|
| lab mr create <remote> <base> | Open an MR into the base branch |
| -m <msg> | Inline title/description (skips the editor) |
| lab ci status | Pipeline status of the current commit |
| LAB_CORE_HOST | Env var: GitLab host |
| LAB_CORE_TOKEN | Env var: access token |
In CI
Set LAB_CORE_HOST and LAB_CORE_TOKEN in the environment for non-interactive auth, and pass -m so no editor opens. For anything new, migrate to glab: glab mr create --fill --yes is the modern equivalent and is actively maintained.
Common errors in CI
"error: 401 Unauthorized" means LAB_CORE_TOKEN is missing or wrong. "GitLab host not set" means LAB_CORE_HOST is empty. An editor opening means -m was omitted. "unknown command" for a newer feature means you should switch to glab.