LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

glab

Official GitLab CLI tool

TLDR

Authenticate with GitLab
$ glab auth login
copy
Create a merge request
$ glab mr create
copy
List merge requests
$ glab mr list
copy
View a merge request
$ glab mr view [number]
copy
Create an issue
$ glab issue create
copy
Clone a repository
$ glab repo clone [owner/repo]
copy
View CI/CD pipelines
$ glab ci list
copy
Make a raw API request
$ glab api [/projects/:id/issues]
copy

SYNOPSIS

glab command [options]

DESCRIPTION

glab is the official GitLab CLI tool. It provides command-line access to GitLab features including merge requests, issues, CI/CD pipelines, and repository management.The tool mirrors the `gh` CLI's approach for GitHub, providing a familiar interface for GitLab users. It supports both GitLab.com and self-hosted instances.

PARAMETERS

mr subcommand

Merge request operations (create, list, view, merge, close, checkout, approve).
issue subcommand
Issue operations (create, list, view, close, reopen, note).
repo subcommand
Repository operations (clone, fork, view, archive).
ci subcommand
CI/CD pipeline operations (list, view, run, trace, retry).
auth subcommand
Authentication (login, status, logout).
release subcommand
Manage releases (create, list, view, delete).
config subcommand
Configuration management.
api endpoint
Make authenticated API requests to GitLab.
snippet subcommand
Create and manage code snippets.
variable subcommand
Manage CI/CD variables.
label subcommand
Manage project labels.
-R repo, --repo repo
Target repository (owner/repo format).

CONFIGURATION

~/.config/glab-cli/config.yml

Configuration file storing authentication tokens, default settings, and host configurations.

CAVEATS

Requires GitLab access token. Some features may require specific permissions. Self-hosted instances need hostname configuration. API rate limits apply.

HISTORY

glab was created by Clement Sam and later became the official GitLab CLI. It was inspired by GitHub's gh CLI and provides similar functionality for GitLab users.

SEE ALSO

gh(1), git(1), gitlab-runner(1)

Copied to clipboard
Kai