---
name: "GitLab"
description: Work with GitLab projects, issues, merge requests, and CI/CD pipelines through the official `glab` CLI.
version: 1
situations: gitlab, merge requests, issues, ci, pipelines
requires-secrets:
requires-packages:
requires-connector: gitlab
---

# GitLab (`glab`)

Runs through the official GitLab CLI in your **bash** tool. The operator connected the account from
00's skill store, so `glab` is already authenticated.

## First, know who you are

```
glab auth status
```

Not logged in? Tell the operator to open **Skill store → GitLab → Connect**. The login is an
interactive browser flow — you cannot complete it yourself.

## Read

```
glab repo view GROUP/PROJECT
glab issue list --repo GROUP/PROJECT --state opened --per-page 30
glab issue view 42 --repo GROUP/PROJECT --comments
glab mr list --repo GROUP/PROJECT --state opened
glab mr view 17 --repo GROUP/PROJECT
glab mr diff 17 --repo GROUP/PROJECT
glab ci list --repo GROUP/PROJECT
glab ci status --repo GROUP/PROJECT
```

Add `-F json` (or `--output json`) where the subcommand supports it; otherwise `glab api` returns raw
JSON for anything: `glab api projects/GROUP%2FPROJECT/merge_requests?state=opened`.

## Write

Announce it in one line first, and confirm the project if the request was vague.

```
glab issue create --repo GROUP/PROJECT --title "…" --description "…"
glab issue note 42 --repo GROUP/PROJECT --message "…"
glab mr create --repo GROUP/PROJECT --source-branch my-branch --target-branch main --title "…" --description "…"
glab mr note 17 --repo GROUP/PROJECT --message "…"
```

## Never without being asked in this turn

`glab mr merge`, `glab repo delete`, `glab ci cancel`, `glab release delete`, and anything that
rewrites history.

## Self-managed GitLab

The connected login covers gitlab.com. A private instance is a second login the operator runs once:
`glab auth login --hostname your.gitlab.host`. After that, pass `--hostname your.gitlab.host` (or set
`GITLAB_HOST`) on each command.
