SkillAgentSearch skills...

Cli

Read only mirror of https://gitlab.com/gitlab-org/cli

Install / Use

/learn @gitlabhq/Cli
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

GLab

GLab

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. While it's powerful for issues and merge requests, glab does even more:

  • View, manage, and retry CI/CD pipelines directly from your CLI.
  • Create changelogs.
  • Create and manage releases.
  • Ask GitLab Duo Chat (Classic) questions about Git.
  • Manage GitLab agents for Kubernetes.

glab is available for repositories hosted on GitLab.com, GitLab Dedicated, and GitLab Self-Managed. It supports multiple authenticated GitLab instances, and automatically detects the authenticated hostname from the remotes available in your working Git directory.

command example

Table of contents

Requirements

glab officially supports GitLab versions 16.0 and later. Certain commands might require more recent versions. While many commands might work properly in GitLab versions 15.x and earlier, no support is provided for these versions.

Usage

To get started with glab:

  1. Follow the installation instructions appropriate for your operating system.
  2. Authenticate into your instance of GitLab.
  3. Optional. Configure glab further to meet your needs:

You're ready!

Core commands

Run glab --help to view a list of core commands in your terminal.

Commands follow this pattern:

glab <command> <subcommand> [flags]

Many core commands also have sub-commands. Some examples:

  • List merge requests assigned to you: glab mr list --assignee=@me
  • List review requests for you: glab mr list --reviewer=@me
  • Approve a merge request: glab mr approve 235
  • Create an issue, and add milestone, title, and label: glab issue create -m release-2.0.0 -t "My title here" --label important

GitLab Duo for the CLI

The GitLab CLI also provides support for GitLab Duo AI/ML powered features. These include:

Use glab duo ask to ask GitLab Duo (Classic) questions about git commands. It can help you remember a command you forgot, or provide suggestions on how to run commands to perform other tasks.

To interact with the GitLab Duo Agent Platform, use the GitLab Duo CLI.

A unified experience is proposed in issue 585937.

Demo

asciicast

Documentation

Read the documentation for usage instructions or check out glab help.

Installation

Download a binary suitable for your OS at the releases page. Other installation methods depend on your operating system.

Homebrew

Homebrew is the officially supported package manager for macOS, Linux, and Windows (through Windows Subsystem for Linux)

  • Homebrew
    • Install with: brew install glab
    • Update with: brew upgrade glab

Other installation methods

Other options to install the GitLab CLI that may not be officially supported or are maintained by the community are also available.

Building from source

If a supported binary for your OS is not found at the releases page, you can build from source:

Prerequisites for building from source

To build from source:

  1. Run go version to verify that you have the minimum required Go version. If Go is not installed, see Download and install.
  2. Clone the repository: git clone https://gitlab.com/gitlab-org/cli.git
  3. Build the binary: make build
  4. Install glab in $GOPATH/bin: make install
  5. Optional. If $GOPATH/bin or $GOBIN is not in your $PATH, run export PATH=$PWD/bin:$PATH.
  6. Confirm the installation: glab version

Authentication

When running glab auth login interactively inside a Git repository, glab automatically detects GitLab instances from your Git remotes and presents them as options. This saves you from having to manually type the hostname.

OAuth (GitLab.com)

To authenticate your installation of glab with an OAuth application connected to GitLab.com:

  1. Start interactive setup with glab auth login.
  2. For the GitLab instance you want to sign in to, select GitLab.com.
  3. For the login method, select Web. This selection launches your web browser to request authorization for the GitLab CLI to use your GitLab.com account.
  4. Select Authorize.
  5. Complete the authentication process in your terminal, selecting the appropriate options for your needs.

OAuth (GitLab Self-Managed, GitLab Dedicated)

Prerequisites:

  • You've created an OAuth application at the user, group, or instance level, and you have its application ID. For instructions, see how to configure GitLab as an OAuth 2.0 authentication identity provider in the GitLab documentation.
  • Your OAuth application is configured with these parameters:
    • Redirect URI is http://localhost:7171/auth/redirect.
    • *Confidential
View on GitHub
GitHub Stars22
CategoryDevelopment
Updated8h ago
Forks7

Languages

Go

Security Score

95/100

Audited on Mar 31, 2026

No findings