LinuxCommandLibrary

gitlab

Interact with GitLab from the command line

TLDR

Create a new project

$ gitlab create_project [project_name]
copy

Get info about a specific commit
$ gitlab commit [project_name] [commit_hash]
copy

Get info about jobs in a CI pipeline
$ gitlab pipeline_jobs [project_name] [pipeline_id]
copy

Start a specific CI job
$ gitlab job_play [project_name] [job_id]
copy

SYNOPSIS

gitlab [global options] command [command options] [arguments…]

PARAMETERS

-h, --help
    Show help for command

-V, --version
    Print version information

--verbose
    Enable verbose logging

--output
    Output format: json, yaml, table (default: table)

--gl-config
    Path to GitLab config file (default: ~/.config/gitlab/gitlab.yml)

--gl-instance
    GitLab instance from config (default: gitlab.com)

--gl-token
    Personal access token for auth

--gl-endpoint
    Custom GitLab API endpoint URL

--no-pager
    Disable paging for list outputs

--page
    Page number for paginated results

--per-page
    Items per page (max 100)

DESCRIPTION

The gitlab command is an unofficial, feature-complete CLI tool for interacting with the GitLab API from the Linux terminal.

It allows users to manage GitLab resources such as projects, issues, merge requests, pipelines, users, and groups without a web browser. Written in Go, it supports authentication via personal access tokens, OAuth, or deploy tokens.

Key features include listing and operating on projects (gitlab project list), creating/editing issues (gitlab issue create), managing merge requests (gitlab mr list), CI/CD pipelines (gitlab pipeline list), and more. Global options handle configuration, output formatting (JSON, YAML), and verbose logging.

Configuration is stored in ~/.config/gitlab/gitlab.yml, specifying API endpoints and tokens for multiple GitLab instances (gitlab.com, self-hosted).

Ideal for automation scripts, CI integration, or power users preferring terminal workflows. Output supports piping to tools like jq for parsing. While powerful, it's third-party software; official alternative is glab.

CAVEATS

Unofficial tool; may lag behind GitLab API changes. Use glab for official support. Requires Go 1.13+ to build from source.

SUBCOMMANDS

Core: project, issue, mr, pipeline, user, group, wiki, snippet. Run gitlab help for full list.

INSTALLATION

Download binaries from GitLab releases or build with go install gitlab.com/profclems/gitlab-cli@latest. Available via Homebrew, Snap.

AUTHENTICATION

Generate token at user settings > access tokens (api scope). Add to config:
instances:
gitlab.com:
token: glpat-xxxx

HISTORY

Originally developed as gitlab-cli by profclems (Clemens V.), first tagged v1.0.0 in 2017 on GitLab.com. Actively used until ~2020, with 50+ releases. Superseded by GitLab's official glab CLI in 2021.

SEE ALSO

glab(1), git(1), hub(1), gh(1), curl(1)

Copied to clipboard