cli/docs/installation_options.md

6.9 KiB

stage: Create group: Code Review info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments

Other options to install the GitLab CLI

These installation instructions are either not officially supported by GitLab, or are maintained by the community.

Table of contents

macOS

  • Homebrew (officially supported)

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

    • Install with: sudo port install glab
    • Update with: sudo port selfupdate && sudo port upgrade glab
  • ASDF tool version manager:

    • Install with: asdf plugin add glab; asdf install glab latest; asdf global glab latest
  • Install into usr/bin with a shell script: curl -s "https://gitlab.com/gitlab-org/cli/-/raw/main/scripts/install.sh" | sudo sh

    Before running any install script, review its contents.

Windows

Linux

Homebrew

Installing from Homebrew is the officially supported installation method for Linux.

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

ASDF

To install with the ASDF tool version manager, run these commands:

asdf plugin add glab; asdf install glab latest; asdf global glab latest

Snapcraft

This method is out of date. See issue 1127 for more information.

To install glab from the Snap Store:

  1. Make sure you have snap installed on your Linux distribution.
  2. Install the package: sudo snap install --edge glab
  3. Grant glab access to SSH keys: sudo snap connect glab:ssh-keys

Download from the Snap Store

Arch Linux

For Arch Linux, glab is available:

Alpine Linux

glab is available on the Alpine Community Repository as glab.

When installing, use --no-cache so no apk update is required:

apk add --no-cache glab

Install a pinned version from edge

To ensure that by default edge is used to get the latest updates. We need the edge repository in /etc/apk/repositories.

Afterwards you can install it with apk add --no-cache glab@edge

We use --no-cache so an apk update is not required.

echo "@edge http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
apk add --no-cache glab@edge

Alpine Linux Docker-way

Use edge directly

FROM alpine:3.13
RUN apk add --no-cache glab

Fetching latest glab version from edge

FROM alpine:3.13
RUN echo "@edge http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk add --no-cache glab@edge

Fedora

Fedora users can find glab as glab in the official repositories.

Install it with the command dnf install glab.

Nix/NixOS

Nix (NixOS) users can install from nixpkgs with the command nix-env -iA nixos.glab.

MPR (Debian/Ubuntu)

glab is available inside the makedeb package repository. To install, run the following:

git clone 'https://mpr.makedeb.org/glab'
cd glab/
makedeb -si

WakeMeOps (Debian/Ubuntu)

glab also exists in the WakeMeOps repository:

# Add WakeMeOps repository
curl -sSL "https://raw.githubusercontent.com/upciti/wakemeops/main/assets/install_repository" | sudo bash

# Install glab
sudo apt install glab

Prebuilt-MPR

The above method downloads glab from source and builds it before packaging it into a .deb package. If you don't want to compile or just want a prebuilt package, you can also install glab from the Prebuilt-MPR:

  1. Set up the Prebuilt-MPR on your system.
  2. Install with the command sudo apt install glab.

Spack

  • To install: spack install glab.
  • To update: spack uninstall glab && spack install glab

Docker

A Docker image for glab is available at gitlab/glab:

docker pull gitlab/glab

GitLab CI/CD

To use glab in a CI/CD pipeline, you must set the entrypoint of the image to the glab executable itself. For more information, see the GitLab documentation for Override the entrypoint of an image. An example .gitlab-ci.yml:

Example .gitlab-ci.yml:

example:
  stage: test
  image:
    name: "gitlab/glab"
    entrypoint: [""]
  script:
    - glab --version