GitLab CLI - glab
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
glab
is an open source GitLab CLI tool. It brings GitLab to your terminal:
next to where you are already working with Git and your code, without
switching between windows and browser tabs.
- Work with issues.
- Work with merge requests.
- Watch running pipelines directly from your CLI.
The GitLab CLI uses commands structured like glab <command> <subcommand> [flags]
to perform many of the actions you usually do from the GitLab user interface:
# Sign in
glab auth login --stdin < token.txt
# View a list of issues
glab issue list
# Create merge request for issue 123
glab mr for 123
# Check out the branch for merge request 243
glab mr checkout 243
# Watch the pipeline in progress
glab pipeline ci view
# View, approve, and merge the merge request
glab mr view
glab mr approve
glab mr merge
Core commands
glab alias
glab api
glab auth
glab changelog
glab check-update
glab ci
glab cluster
glab completion
glab config
glab duo
glab incident
glab issue
glab label
glab mr
glab release
glab repo
glab schedule
glab snippet
glab ssh-key
glab user
glab variable
GitLab Duo for the CLI
- Tier: Ultimate with GitLab Duo Enterprise - Start a trial
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- LLM: Anthropic Claude 3 Haiku
The GitLab CLI includes features powered by GitLab Duo. These include:
To ask questions about git
commands while you work, type:
The glab duo ask
command can help you remember a git
command you forgot,
or provide suggestions on how to run git
commands to perform other tasks.
Install the CLI
Installation instructions are available in the glab
README
.
Authenticate with GitLab
To authenticate with your GitLab account, run glab auth login
.
glab
respects tokens set using GITLAB_TOKEN
.
glab
also integrates with the 1Password shell plugin
for secure authentication.
Report issues
Open an issue in the gitlab-org/cli
repository
to send us feedback.
Related topics
- Install the CLI
- Documentation
- Extension source code in the
cli
project
Troubleshooting
glab completion
commands fail when using the 1Password shell plugin
The 1Password shell plugin
adds the alias glab='op plugin run -- glab'
, which can interfere with the glab completion
command. If your glab completion
commands fail, configure your shell to prevent expanding aliases
before performing completions:
For Zsh, edit your
~/.zshrc
file and add this line:setopt completealiases
For Bash, edit your
~/.bashrc
file and add this line:complete -F _functionname glab
For more information, see issue 122 for the 1Password shell plugin.
Docs
Edit this page to fix an error or add an improvement in a merge request.
Create an issue to suggest an improvement to this page.
Product
Create an issue if there's something you don't like about this feature.
Propose functionality by submitting a feature request.
Feature availability and product trials
View pricing to see all GitLab tiers and features, or to upgrade.
Try GitLab for free with access to all features for 30 days.
Get help
If you didn't find what you were looking for, search the docs.
If you want help with something specific and could use community support, post on the GitLab forum.
For problems setting up or using this feature (depending on your GitLab subscription).
Request support