Search for a command to run...
Install GitLab CLI 1.124 on Linux, macOS and Windows, authenticate with OAuth or a token, and manage merge requests, pipelines, runners and releases from your terminal.
GitLab CLI (glab) is the official GitLab command-line tool. It handles merge requests,
issues, pipelines, runners and releases — and it detects the GitLab instance from the
remotes in your working directory.
GitLab CLI 1.124.0 · requires GitLab 16.0 or newer · Homebrew is the officially
supported package manager · glab duo cli for GitLab Duo in the terminal
The GitLab CLI project officially supports Homebrew on macOS, Linux and WSL. Everything
else — the .deb/.rpm packages, the distro packages and the container image — is
maintained by the community and may lag behind.
git on your PATHglab supports OAuth, personal access tokens and CI job tokens.
# Interactive login
glab auth login
# Log in to a self-managed instance
glab auth login --hostname gitlab.example.com
# Non-interactive login with a token
echo "$GITLAB_TOKEN" | glab auth login --stdin
# Check the current state
glab auth status
# Log out
glab auth logout# In CI, the token is simply an environment variable
export GITLAB_TOKEN=glpat-xxxxxxxxxxxx
export CI_SERVER_URL=https://gitlab.com| Variable | Purpose |
|---|---|
GITLAB_TOKEN | Token used for API requests |
GITLAB_HOST | Default instance URL |
GLAB_CONFIG_DIR | Where the configuration is stored |
GLAB_DEBUG | Set to true for verbose logging, including the underlying git commands |
# Create a merge request
glab mr create --title "Add login" --description "Closes #42" --source-branch feature/login
# List, view and check out
glab mr list --assignee=@me
glab mr list --reviewer=@me
glab mr view 235
glab mr checkout 235
# Review and merge
glab mr approve 235
glab mr merge 235 --squash --remove-source-branch# Create and list
glab issue create -m release-2.0.0 -t "My title here" --label important
glab issue list --assignee=@me
# Update and close
glab issue update 42 --label "needs review"
glab issue close 42# List and inspect
glab pipeline list
glab pipeline view 12345
glab pipeline status
# Follow a job log
glab ci list
glab ci view 98765
glab ci trace 98765
# Retry a failed job
glab ci retry 98765# Repository
glab repo clone owner/repo
glab repo fork owner/repo
glab repo view
# Releases and changelogs
glab release create v1.2.0 --notes "Bug fixes"
glab changelog generate# Runners
glab runner list
glab runner create --name my-runner --executor docker
# GitLab Agents for Kubernetes
glab cluster agent list
# Project and group variables
glab variable set LOG_LEVEL --scope project --value debug
glab variable list# Ask GitLab Duo about the codebase
glab duo cli
# Or a one-off question
glab duo chat "explain this module"read_api for read-only automation, api only when you
really need to write.GITLAB_TOKEN in CI instead of running the interactive login.GLAB_DEBUG=true when something behaves strangely — it shows the git
commands and the API calls.glab api for anything the CLI does not wrap.glab runner and glab cluster agent to manage runners and agents instead
of the web UI.