---
title: "GitLab CLI (glab) Install, Login and Commands in 2026"
description: "GitLab CLI is the command-line tool for interacting with GitLab. You can manage repositories, issues, and merge requests directly from your terminal."
url: https://www.activepieces.com/blog/gitlab-cli-glab-install-login-and-commands-in-2026
updated: 2026-12-05
---

> Every page on www.activepieces.com is available as markdown: add `.md` to the URL, or send `Accept: text/markdown`. Site index: https://www.activepieces.com/llms.txt

# GitLab CLI (glab) Install, Login and Commands in 2026

By Priscilla Nakabuye · December 5, 2026 · 14 min read · Filed under [Automation tutorials](https://www.activepieces.com/blog/category/automation-tutorials)

**Summary**

glab installs via brew or winget, signs in with `glab auth login` and personal tokens, and runs commands like `glab mr list`, `glab issue create` and `glab ci status`.

- 2,000 authenticated API requests allowed per minute on GitLab.com.
- Raw endpoints limited to 300 requests per minute per project.
- Ten essential commands cover merge requests, issues, pipelines and work.

Because glab is GitLab's official open-source command-line client, **a thin layer over the GitLab REST API** (the same API that automation tools such as [Activepieces](https://www.activepieces.com) call when they connect to GitLab), its sign-in, rate limits and error messages are GitLab's own rather than the tool's.

By the end of this article you will have it installed, signed in and making one API call, in about 15 minutes, so the first rollout step costs one sitting. The commands follow GitLab's glab docs as of 2026-12-05.

## How to install the GitLab CLI

### What glab does and what it does not

From one person at a terminal to shared scripts to pipelines, glab serves three stages of adoption. It does merge requests, issues, pipelines and repository work without opening the web UI.

Because **every command resolves to an API call**, a failure is almost always a GitLab permission, token scope or rate-limit problem. Debug the account and the instance before you debug glab.

![New variable dialog in Activepieces showing name and value fields for storing an API key securely.](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/2ed45337-9239-4a0c-b46a-e23f1f5cc9a1/how-to-automate-a-telegram-bot-with-ai-in-2026-s-ce519bf2.webp)

For no-code automation around the same jobs, an open source platform with a GitLab integration among its 751 integrations, all in an MIT-licensed monorepo, can sit alongside it, but the terminal is where to start, which means your existing tools are probably already integrated.

### Install on macOS, Linux and Windows

Pick the package manager your team already standardizes on. Templated setup scripts are the cheapest lever for adoption, because one agreed command per OS removes the "works on my machine" tickets that stall a rollout.

The table lists each route from GitLab's docs with its command and the check to run afterward.

| Package manager | Exact command | Verify |
|---|---|---|
| macOS (Homebrew) | `brew install glab` | `glab --version` |
| Windows (winget) | `winget install --id GLab.GLab` | `glab --version` |
| Windows (Scoop) | `scoop install glab` | `glab --version` |
| Linux (Homebrew) | `brew install glab` | `glab --version` |
| Linux (.deb package) | `sudo dpkg -i glab_*_linux_amd64.deb` (after downloading the .deb from the glab releases page) | `glab --version` |

### Check the install with glab --version

Run `glab --version` in a fresh terminal after installing. A printed version number means the binary is on your path and you can move on to signing in.

If you see "command not found", the install location is not on your path. Open a new terminal window first, because many shells only read the path at startup, and then re-check the package manager's output.

![A person in a corridor holds a new tool, but the corridor's door is a plain wall.](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/7a3aa33c-bab4-483f-9c93-b76eb7f1cc19/gitlab-cli-glab-install-login-and-commands-in-20-57dd87d5.webp)

## Log in to GitLab with glab auth

Once glab is on your path, `glab auth login` is the one command that signs you in, either through the browser or with a personal access token you paste in.

### Create a glab personal access token

In GitLab, open your profile's access token page and create a personal access token. Grant `api` for everyday work, since it covers merge requests, issues and pipelines. Add `write_repository` only if you push over HTTPS with the same credential.

![A workflow execution interface showing a completed two-step Square OAuth token revocation flow with HTTP configuration](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/ab58d76a-e150-4da2-b368-e9390d90658a/how-to-evaluate-telemetry-dev-llm-observability-bc2ee918.webp)

When a write command fails with a 403 on a narrower scope, widen the token deliberately rather than reaching for an admin one. Set an expiry, because a token with no end date is how guardrails start to break.

Run `glab auth login` and choose the browser or token option when prompted. For scripts, pipe the token in with `glab auth login --stdin`, so it never lands in shell history.

Confirm the result with `glab auth status`, which shows the host and whether the stored credential works.

### Self-managed instances and environment variables

Point glab at your own server with `glab auth login --hostname gitlab.example.com`. In pipelines, skip the login step: set `GITLAB_TOKEN` for the credential and `GITLAB_HOST` for the server, and every command picks them up.

### What each GitLab plan covers

**Free and open source, glab itself costs nothing**. What varies is the GitLab plan behind your account: the tiers differ by features, and glab can only call what your plan and role expose.

When a command returns a not-found or forbidden response on a premium feature, it usually means the plan, not a broken install. Check GitLab's pricing page for the current feature split before you promise a team a workflow.

## Ten essential glab commands

Across ten commands, most daily glab use is covered, and each one maps to a GitLab REST call, so what you read in the output is what the API returned.

The table starts with the read-only commands, which is the safest first stage of adoption, and ends with the ones that change state.

| Command | Example | What it does | Expected output |
|---|---|---|---|
| auth status | `glab auth status` | Checks which hosts you are signed in to | Host, account and token validity |
| repo clone | `glab repo clone group/project` | Clones a project by path | A local git clone of the project |
| issue create | `glab issue create --title "Fix login"` | Opens an issue | The new issue's URL |
| issue list | `glab issue list` | Lists open issues in the current repo | A list of issue numbers and titles |
| mr create | `glab mr create --fill` | Opens a merge request from the current branch | The new merge request's URL |
| mr list | `glab mr list` | Lists open merge requests | A list of merge request numbers and titles |
| mr view | `glab mr view 42` | Shows one merge request | Title, state, author and description |
| mr merge | `glab mr merge 42` | Merges an approved merge request | A confirmation that it merged |
| ci status | `glab ci status` | Shows the current branch's pipeline | Pipeline and job states |
| api | `glab api user` | Sends a raw API request | JSON for your user |

Run `auth status` first. If it fails, nothing below it will work.

### Issues and merge requests

Templates pay off most in `issue create` and `mr create`. Description templates kept in the repository make the text of what glab opens consistent, and you can measure that by how often reviewers have to ask for missing detail.

`mr create --fill` takes the title and description from your commits. It is only as good as your commit messages. `mr merge` fails when the project's rules block the merge, which is GitLab refusing, not glab misbehaving.

![Creating a project variable](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/0070bd2b-a8f0-401a-a7a8-18a2da6f6633/self-host-mistral-ai-enterprise-deployment-guide-4dc19d0b.webp)

### A minimal glab api request

`glab api user` returns the account the token belongs to, which makes it a quick test of auth separate from any project. Inside a repository, glab fills in placeholders such as `:id` in the path, so `glab api projects/:id/issues` queries the current project.

If you get a 401, the token is expired or missing, and a 404 on a private project often means the token cannot see it.

glab keeps its settings in `~/.config/glab-cli/config.yml`, and `GLAB_CONFIG_DIR` moves that directory.

`GITLAB_TOKEN` supplies a token without a login step, `GITLAB_HOST` points glab at a self-managed instance, and `NO_PROMPT` stops it asking questions. Those three are what a pipeline job needs, and the next section builds on them.

## glab API rate limits and errors

Every limit glab runs into is a limit GitLab applies to its REST API, so the number to plan around is the one for the API, not for the tool.

### Rate limits on GitLab.com and self-managed

On GitLab.com, an authenticated user may make [2,000 API requests per minute](https://apis.io/rate-limits/gitlab/gitlab-rate-limits/), which is about 33 a second.

![GitLab.com request limits by traffic type](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/fc8e7bf2-5a1d-44c4-93cf-dc6379525ad5/gitlab-cli-glab-install-login-and-commands-in-20-221704a0.svg "Source: apis.io GitLab rate limits (transcribed from do…")

A single job looping over a few hundred merge requests will rarely hit it, while ten parallel jobs sharing one token can, which means **shared tokens will be rate-limited under parallelization**.

![One narrow turnstile with ten identical people queued, each holding the same ticket; one passes while the rest press behind.](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/54a5ea50-951f-4b65-a6f0-ff3fe4e028a9/gitlab-cli-glab-install-login-and-commands-in-20-250bd2cb.webp)

Chart: How many requests GitLab.com allows each user per minute.

At 1,000 requests per minute, GitLab caps authenticated web traffic, so rapid web access will be rate-limited. That matters only if a script scrapes pages instead of calling the API, and the fix is to switch to the API.

### Raw endpoints and self-managed values

GitLab limits raw endpoints, which serve file contents, to **300 requests per minute per project and path**, according to apis.io's GitLab rate limits, meaning bulk file access from a single project will quickly exceed this.

A job that downloads many files from one repository will hit that limit first. Fetch an archive once instead of file by file.

These figures come from a transcription of GitLab's documentation as of 2026-12-05. Self-managed instances set their own values, and administrators can raise, lower or disable them.

Ask your administrator before assuming the GitLab.com numbers apply. Throttled responses carry `RateLimit` headers showing what remains and `Retry-After` showing how long to wait.

### Common glab error codes and fixes

Because glab passes GitLab's responses through, each error below is the server's message, not the tool's.

| Error | Usual cause | Fix |
|---|---|---|
| 401 Unauthorized | Token expired, revoked or mistyped | Run `glab auth status`, then re-authenticate or replace the token |
| 403 Forbidden | Token is valid but lacks the scope or the project role | Add the needed scope, or ask for a higher role |
| 404 Not Found | Wrong path, or a private project your token cannot see | Check the path; GitLab hides private projects behind 404 |
| 429 Too Many Requests | A rate limit was exceeded | Wait for `Retry-After`, then retry |
| Certificate error | Self-managed instance with a self-signed certificate | Trust the certificate on the runner, rather than disabling verification |
| Calls reach the wrong server | glab is pointed at gitlab.com instead of your instance | Set the host with `GITLAB_HOST` or pass `--hostname` |

![Error table card with three doors in different states next to a laptop](https://ap-marketing-media.fra1.cdn.digitaloceanspaces.com/uploads/8b35e624-7d2c-4b7a-9c36-a69e4f0c4812/gitlab-cli-glab-install-login-and-commands-in-20-3537c439.webp)

A 404 on a project you know exists is an authorization problem far more often than a typo, so check access before the path.

When a call returns 429, read `Retry-After`, sleep that many seconds and retry, with a small cap on attempts so a stuck job fails rather than hangs.

## Run glab in CI/CD

Start with the token behind any glab job, because it is the first thing to get right. Store it as a masked CI/CD variable named `GITLAB_TOKEN`, and glab reads it from the environment with no interactive login.

### Glab in a CI job

Start with one team's pipeline, prove it, then roll it out through a shared template. Put the glab install and the token handling in a template that other projects pull in with `include`.

Every project then gets the same guardrails, and a fix to the template reaches all of them at once.

A minimal job looks like this:

```yaml
list-open-mrs:
 script:
 - glab mr list
```

This assumes glab is already available in the job image. Set `GITLAB_HOST` as well if the job targets a self-managed instance rather than gitlab.com.

Mark the variable as masked so its value is redacted from job logs, and as protected if only protected branches should use it.

### Run glab in scheduled pipelines

When chores recur, such as stale-issue triage and weekly merge request reports, put them in a scheduled pipeline. Create the schedule under the project's CI/CD settings, then restrict the glab job to it with `rules`:

```yaml
weekly-report:
 rules:
 - if: $CI_PIPELINE_SOURCE == "schedule"
 script:
 - glab issue list
```

The rule keeps the job from running on every push, so scheduled work does not eat into the request budget that ordinary pipelines need. Scheduled pipelines run as the schedule's owner, so make sure that account still has access to the project.

### The no-code route and MCP with Activepieces

When the work is a script a developer can read, review and version alongside the code, plain glab is the better choice. Two cases fit better elsewhere: people who do not write shell, and AI agents that need GitLab as a tool.

Activepieces has a GitLab integration for the first case, so a no-code flow can use GitLab as one of its connected apps.

That integration is one of 751 in the MIT-licensed open source monorepo, roughly 60% of them community-contributed, so its source is there to read.

Flows can also sync to git and move from a test environment to production through Release Management, so they get the same review trail as the scripts beside them; Activepieces' own documentation covers both Git Sync and Release Management for the same product, self-hosted or on cloud.

For the second case, Activepieces is a per-project MCP server, and every connected integration is available as a tool to MCP-capable clients such as Claude, ChatGPT or Cursor, so an agent can call GitLab without shelling out to glab.

Both routes sit beside glab, not on top of it. They all end up calling the same GitLab API, so the same permissions and rate limits apply.

## Frequently asked questions

Once the split between CI work and agent-driven work is settled, a rollout usually stalls on a few small questions, so here are short answers to them.

Is the GitLab CLI free to use? Yes, glab is open source and costs nothing to install. What you can do with it still depends on your GitLab plan, because glab only calls GitLab's API.

A feature your plan does not include fails in glab the same way it fails in the web interface, so check the plan before blaming the tool.

Is glab the same as the git command? No. Git moves commits between your machine and a remote. glab works with the GitLab objects around those commits: merge requests, issues, pipelines and releases.

Teams that adopt it well keep both: git for the code, glab for the workflow, and a shared CI template so every project calls glab the same way.

### Can glab work with a self-managed GitLab instance?

Yes. Sign in with `glab auth login --hostname` followed by your instance's hostname, and glab talks to that server instead of GitLab.com. Because the client is thin, the instance's own version, permissions and token policies decide what succeeds.

An older server may lack an endpoint a newer glab command expects, and the error you see comes from the server, not from glab.

### How do I update glab to the latest version?

Update it the way you installed it. With Homebrew that is `brew upgrade glab`; with a Windows or Linux package manager, use that manager's own upgrade command. A binary you downloaded by hand has to be replaced by hand.

In CI, pin the version in the job image or install step. An unpinned install lets a new release change behavior in the middle of a pipeline, and that is the first thing to rule out when a stable job suddenly breaks.

### Does glab work with GitLab Duo?

Partly. glab includes a `glab duo ask` command that sends a question about git commands to GitLab Duo from your terminal.

The command is a convenience for the person at the keyboard, and it depends on Duo being available on your account and instance. It is not a route for agents to drive GitLab. For that, use the event-driven and MCP route described above.

## Related reading

- [GitLab Pricing in 2026: What Teams Pay](https://www.activepieces.com/blog/gitlab-pricing-in-2026-what-teams-pay)
- [Codex CLI Setup: ChatGPT Login or API Key (2026)](https://www.activepieces.com/blog/codex-cli-setup-chatgpt-login-or-api-key-2026)
- [Using the GitLab API Without Hand-Written Auth Code](https://www.activepieces.com/blog/using-the-gitlab-api-without-hand-written-auth-code)

## References

- [apis.io GitLab rate limits (transcribed from docs.gitlab.com)](https://apis.io/rate-limits/gitlab/gitlab-rate-limits/)
