Expert guidance for using the GitLab CLI (glab) to manage GitLab issues, merge requests, CI/CD pipelines, repositories, and other GitLab operations from the command line.

Apache-2.0Auto-check passedDevOps & Cloud

Install Glab

skills CLI
$ npx skills add NikiforovAll/claude-code-rules --skill glab -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install NikiforovAll/claude-code-rules glab --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/NikiforovAll/claude-code-rules.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/handbook-glab/skills/glab .claude/skills/glab && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
glab
GitHub stars
141
Used in
1 other repo
Token cost
~2.2k tokens
SKILL.md length
628 words
Files
4 (incl. references)
Skills in repo
26
Repo updated
First seen
Licence
Apache-2.0

At a glance

Expert guidance for using the GitLab CLI (glab) to manage GitLab issues, merge requests, CI/CD pipelines, repositories, and other GitLab operations from the command line.

  • Works in 5 steps: Verify authentication before executing… → Use --help to explore command options:… → Link MRs to issues using "Closes #123"… → …
  • The user needs to interact with GitLab resources
  • SKILL.md covers When to Use This Skill, Prerequisites, Authentication Quick Start and Core Workflows, plus 6 more sections
  • Calls glab, git and jq; needs GITLAB_TOKEN

What it does

Glab is an agent skill from NikiforovAll/claude-code-rules. Expert guidance for using the GitLab CLI (glab) to manage GitLab issues, merge requests, CI/CD pipelines, repositories, and other GitLab operations from the command line. Use this skill when the user needs to interact with GitLab resources or perform GitLab workflows.

Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/commands-detailed.md`, `references/quick-reference.md` and `references/troubleshooting.md`).

It sits in DevOps & Cloud, covering CI/CD. It works with GitLab and Git. The repository describes itself as: Learn practical techniques to enhance your AI-assisted development workflow with Claude Code. The licence is Apache-2.0.

When your agent uses it

  • The user needs to interact with GitLab resources
  • Perform GitLab workflows

Example prompts

  • “/glab”

Requirements

  • A credential in GITLAB_TOKEN

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Verify authentication before executing commands: glab auth status
  2. Use --help to explore command options: glab --help
  3. Link MRs to issues using "Closes #123" in MR description
  4. Lint CI config before pushing: glab ci lint
  5. Check repository context when commands fail: git remote -v

What it can do on your machine

Read from SKILL.md and the folder at commit 281c063. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • glab
    • git
    • jq

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use glab and git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • GITLAB_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Glab loads about 2.2k tokens when it runs, and up to ~9.1k if it reads all its reference files. Until then it costs about 68 tokens; SKILL.md has 628 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~68
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~9.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from NikiforovAll/claude-code-rules at commit 281c063, republished under its Apache-2.0 licence (© NikiforovAll). 628 words, ~2,173 tokens.

Download SKILL.mdSave it as .claude/skills/glab/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
glab
description
Expert guidance for using the GitLab CLI (glab) to manage GitLab issues, merge requests, CI/CD pipelines, repositories, and other GitLab operations from the command line. Use this skill when the user needs to interact with GitLab resources or perform GitLab workflows.

GitLab CLI (glab) Skill

Provides guidance for using glab, the official GitLab CLI, to perform GitLab operations from the terminal.

When to Use This Skill

Invoke when the user needs to:

  • Create, review, or manage merge requests
  • Work with GitLab issues
  • Monitor or trigger CI/CD pipelines
  • Clone or manage repositories
  • Perform any GitLab operation from the command line

Prerequisites

Verify glab installation before executing commands:

bash
glab --version

If not installed, inform the user and provide platform-specific installation guidance.

Authentication Quick Start

Most glab operations require authentication:

bash
# Interactive authentication
glab auth login

# Check authentication status
glab auth status

# For self-hosted GitLab
glab auth login --hostname gitlab.example.org

# Using environment variables
export GITLAB_TOKEN=your-token
export GITLAB_HOST=gitlab.example.org  # for self-hosted

Core Workflows

Creating a Merge Request
bash
# 1. Ensure branch is pushed
git push -u origin feature-branch

# 2. Create MR
glab mr create --title "Add feature" --description "Implements X"

# With reviewers and labels
glab mr create --title "Fix bug" --reviewer=alice,bob --label="bug,urgent"
Reviewing Merge Requests
bash
# 1. List MRs awaiting your review
glab mr list --reviewer=@me

# 2. Checkout MR locally to test
glab mr checkout <mr-number>

# 3. After testing, approve
glab mr approve <mr-number>

# 4. Add a general comment
glab mr note <mr-number> -m "Please update tests"
Posting Inline DiffNote Comments

To anchor a comment to a specific line in the diff (a DiffNote), you must use a JSON body with the Content-Type: application/json header. Using -F form fields will create an unanchored DiscussionNote.

bash
# Get SHA values from the MR
glab mr view <id> --output=json | grep -oP '"(base_sha|head_sha|start_sha)":\s*"\K[0-9a-f]{40}'

# Post a DiffNote on a new line
glab api --method POST "projects/:id/merge_requests/:iid/discussions" \
  -H "Content-Type: application/json" \
  --input - <<'JSONEOF'
{
  "body": "Your review comment here",
  "position": {
    "base_sha": "<base_sha>",
    "start_sha": "<start_sha>",
    "head_sha": "<head_sha>",
    "position_type": "text",
    "new_path": "path/to/file.js",
    "new_line": 42
  }
}
JSONEOF

Key rules for DiffNotes:

  • Always use --input - with a heredoc and -H "Content-Type: application/json". Never use -F for the position object — it will silently create a DiscussionNote instead.
  • Line numbers are new file line numbers calculated from the diff hunk headers (@@ -old,count +new,count @@), not the diff output line numbers. Count only context lines and + lines from the hunk start.
  • Verify findings on the MR source branch (git fetch origin <branch> then git grep), not the current working branch.
  • To update an existing note: glab api --method PUT "projects/:id/merge_requests/:iid/notes/:note_id" -H "Content-Type: application/json" --input - <<< '{"body":"updated text"}'
  • GitLab has no batch "Submit Review" API like GitHub. Post DiffNotes individually.
  • To find a discussion or note ID: glab api "projects/:id/merge_requests/:iid/discussions" --paginate
Managing Issues
bash
# Create issue with labels
glab issue create --title "Bug in login" --label=bug

# Link MR to issue
glab mr create --title "Fix login" --description "Closes #<issue-number>"

# List your assigned issues
glab issue list --assignee=@me
Monitoring CI/CD
bash
# Watch pipeline in progress
glab pipeline ci view

# Check pipeline status
glab ci status

# View logs if failed
glab ci trace

# Retry failed pipeline
glab ci retry

# Lint CI config before pushing
glab ci lint

Common Patterns

Working Outside Repository Context

When not in a Git repository, specify the repository:

bash
glab mr list -R owner/repo
glab issue list -R owner/repo
Self-Hosted GitLab

Set hostname for all commands:

bash
export GITLAB_HOST=gitlab.example.org
# or per-command
glab repo clone gitlab.example.org/owner/repo
Listing Unresolved MR Comments
bash
glab api "projects/:id/merge_requests/{mr}/discussions?per_page=100" | jq '[.[] | select(.notes[0].resolvable == true and .notes[0].resolved == false) | {id: .notes[0].id, body: .notes[0].body[0:100], path: .notes[0].position.new_path, line: .notes[0].position.new_line}]'
Automation and Scripting

Use JSON output for parsing:

bash
glab mr list --output=json | jq '.[] | .title'
Replying to MR Notes/Threads

glab mr note creates standalone comments. To reply within a discussion thread, use the API:

bash
# 1. Find the discussion_id containing the note
glab api "projects/:id/merge_requests/{mr}/discussions" | jq '.[] | select(.notes[].id == {note_id}) | .id'

# 2. Post reply to the discussion thread
glab api --method POST "projects/:id/merge_requests/{mr}/discussions/{discussion_id}/notes" --field body="Your reply"

Example:

bash
# Get discussion_id for note 13698970
glab api "projects/:id/merge_requests/1013/discussions" | jq '.[] | select(.notes[].id == 13698970) | {id}'
# Returns: {"id": "5356c3552e72e7b4c49276eb4dacfe3efe5c2c5c"}

# Reply to that thread
glab api --method POST "projects/:id/merge_requests/1013/discussions/5356c3552e72e7b4c49276eb4dacfe3efe5c2c5c/notes" --field body="Thanks for the review!"
Using the API Command

The glab api command provides direct GitLab API access:

bash
# Basic API call
glab api projects/:id/merge_requests

# IMPORTANT: Pagination uses query parameters in URL, NOT flags
# ❌ WRONG: glab api --per-page=100 projects/:id/jobs
# ✓ CORRECT: glab api "projects/:id/jobs?per_page=100"

# Auto-fetch all pages
glab api --paginate "projects/:id/pipelines/123/jobs?per_page=100"

# POST with data
glab api --method POST projects/:id/issues --field title="Bug" --field description="Details"

Best Practices

  1. Verify authentication before executing commands: glab auth status
  2. Use --help to explore command options: glab <command> --help
  3. Link MRs to issues using "Closes #123" in MR description
  4. Lint CI config before pushing: glab ci lint
  5. Check repository context when commands fail: git remote -v
Show full SKILL.md (259 more words)Show less

Common Commands Quick Reference

Merge Requests:

  • glab mr list --assignee=@me - Your assigned MRs
  • glab mr list --reviewer=@me - MRs for you to review
  • glab mr create - Create new MR
  • glab mr checkout <number> - Test MR locally
  • glab mr approve <number> - Approve MR
  • glab mr merge <number> - Merge approved MR

Issues:

  • glab issue list - List all issues
  • glab issue create - Create new issue
  • glab issue close <number> - Close issue

CI/CD:

  • glab pipeline ci view - Watch pipeline
  • glab ci status - Check status
  • glab ci lint - Validate .gitlab-ci.yml
  • glab ci retry - Retry failed pipeline

Repository:

  • glab repo clone owner/repo - Clone repository
  • glab repo view - View repo details
  • glab repo fork - Fork repository

Progressive Disclosure

For detailed command documentation, refer to:

  • references/commands-detailed.md - Comprehensive command reference with all flags and options
  • references/quick-reference.md - Condensed command cheat sheet
  • references/troubleshooting.md - Detailed error scenarios and solutions

Load these references when:

  • User needs specific flag or option details
  • Troubleshooting authentication or connection issues
  • Working with advanced features (API, schedules, variables, etc.)

Common Issues Quick Fixes

"command not found: glab" - Install glab or verify PATH

"401 Unauthorized" - Run glab auth login

"404 Project Not Found" - Verify repository name and access permissions

"not a git repository" - Navigate to repo or use -R owner/repo flag

"source branch already has a merge request" - Use glab mr list to find existing MR

For detailed troubleshooting, load references/troubleshooting.md.

Notes

  • glab auto-detects repository context from Git remote
  • Most commands have --web flag to open in browser
  • Use --output=json for scripting and automation
  • Multiple GitLab accounts can be authenticated simultaneously
  • Commands respect Git configuration and current repository context

© NikiforovAll, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in plugins/handbook-glab/skills/glab of NikiforovAll/claude-code-rules.

  • SKILL.md
  • references/commands-detailed.md
  • references/quick-reference.md
  • references/troubleshooting.md

Open the folder on GitHubat commit 281c063

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in NikiforovAll/claude-code-rules, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Glab next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Glab compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Glab this skillNikiforovAll/claude-code-rules1411 repos~2.2kAutomated safety check: PassApache-2.0
GitLab ExplorerWide-Moat/open-computer-use126—~891Automated safety check: PassCustom licence
Authoring GitHub Workflowsdotnet/skills5.6k1 repos~2.3kAutomated safety check: PassMIT
CI Failure Triage and RepairChachamaru127/claude-code-harness3.2k1 repos~1.1kAutomated safety check: NotesMIT
Megatron-LM CI/CD GuideNVIDIA/Megatron-LM18k—~1.8kAutomated safety check: PassApache-2.0
Reviewwerf/werf4.7k—~2kAutomated safety check: PassApache-2.0

Similar skills

  • GitLab Explorer

    Wide-Moat/open-computer-use

    Explore GitLab repositories using glab CLI and git commands.

    126 GitHub stars~891 tokensUpdated 3 days ago
    DevOps & CloudAuto-check passed
  • Official

    Author and review GitHub Actions workflow YAML safely so syntactically-valid YAML can't ship a workflow that GitHub Actions refuses to run.

    5.6k GitHub starsUsed in 1 repo~2.3k tokens
    DevOps & CloudAuto-check passed
  • CI Failure Triage and Repair

    Chachamaru127/claude-code-harness

    Diagnoses failing CI pipelines and tests, deciding first whether the test or the implementation is at fault, and hands hard cases to a dedicated fixer subagent.

    3.2k GitHub starsUsed in 1 repo~1.1k tokens
    DevOps & CloudAuto-check: notes
  • Megatron-LM CI/CD Guide

    NVIDIA/Megatron-LM

    Official

    Explains Megatron-LM's CI pipeline, PR scope labels, triggering the internal GitLab CI with a dry run first, and investigating CI failures.

    18k GitHub stars~1.8k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Review

    werf/werf

    Code review of a pull request, branch, or diff. An agent skill from werf/werf.

    4.7k GitHub stars~2k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Megalinter Check

    nvuillam/npm-groovy-lint

    Collect MegaLinter lint errors for the current repository. An agent skill from nvuillam/npm-groovy-lint.

    248 GitHub starsUsed in 1 repo~3.9k tokens
    DevOps & CloudAuto-check: notes

More from NikiforovAll/claude-code-rules

All 26 skills in this repo
  • Reflect Solution

    NikiforovAll/claude-code-rules

    Summarize WHAT WAS SHIPPED in a Claude Code session as a self-contained HTML slide deck — the elevator pitch (problem, solution, decisions, artifacts, verification, gaps), not a play-by-play of tool…

    141 GitHub stars~3.8k tokensUpdated 7 days ago
    Auto-check passed
  • Dotnet Analyzers

    NikiforovAll/claude-code-rules

    Run dotnet format to fix code style and analyzer diagnostics (IDE0005, CA, SA).

    141 GitHub stars~1.9k tokensUpdated 7 days ago
    Auto-check passed
  • Ilspy Decompile

    NikiforovAll/claude-code-rules

    Understand implementation details of .NET code by decompiling assemblies.

    141 GitHub starsUsed in 2 repos~760 tokens
    Auto-check passed
  • Reflect Tree

    NikiforovAll/claude-code-rules

    Visualize a Claude Code session as a quest/skill tree — a navigable SVG graph where nodes are turns and edges show flow, with distinct visual encoding for normal flow, dead-ends, corrections…

    141 GitHub stars~2.8k tokensUpdated 7 days ago
    Auto-check passed
  • Structured Plan Mode

    NikiforovAll/claude-code-rules

    This skill should be used when planning and tracking complex feature implementations that require systematic task decomposition.

    141 GitHub stars~4.2k tokensUpdated 7 days ago
    Auto-check passed
  • Version Bump

    NikiforovAll/claude-code-rules

    This skill automates version bumping during the release process for the Claude Code Handbook monorepo.

    141 GitHub stars~858 tokensUpdated 7 days ago
    Auto-check passed

Works with

Categories

Questions about Glab

What does Glab do?

Expert guidance for using the GitLab CLI (glab) to manage GitLab issues, merge requests, CI/CD pipelines, repositories, and other GitLab operations from the command line. Glab is an agent skill from NikiforovAll/claude-code-rules. Expert guidance for using the GitLab CLI (glab) to manage GitLab issues, merge requests, CI/CD pipelines, repositories, and other GitLab operations from the command line.

When should I use Glab?

Glab fits situations like: the user needs to interact with GitLab resources; perform GitLab workflows.

How do I install Glab in Claude Code?

Run `npx skills add NikiforovAll/claude-code-rules --skill glab -a claude-code`. Or copy the skill folder (plugins/handbook-glab/skills/glab in NikiforovAll/claude-code-rules) into .claude/skills/glab in your project. Claude Code loads it when a task matches its description.

How do I install Glab in Codex?

Run `npx skills add NikiforovAll/claude-code-rules --skill glab -a codex`. Or copy the skill folder (plugins/handbook-glab/skills/glab in NikiforovAll/claude-code-rules) into .agents/skills/glab in your project. Codex loads it when a task matches its description.

Can I use Glab in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add NikiforovAll/claude-code-rules --skill glab -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/glab, .gemini/skills/glab, .github/skills/glab and .opencode/skills/glab in your project.

What does Glab need to run?

Going by SKILL.md and its folder, Glab needs the command-line tools its instructions call (glab, git and jq) and credentials named GITLAB_TOKEN. Our summary lists: A credential in GITLAB_TOKEN.

Does Glab access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Glab safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Glab use?

Glab is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Glab use?

About 2.2k tokens (SKILL.md is roughly 8.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 6.9k tokens, read only when the agent opens those files.

What are the alternatives to Glab?

Skills that share tags, products or a category with Glab: GitLab Explorer (Wide-Moat/open-computer-use, 126 stars), Authoring GitHub Workflows (dotnet/skills, 5.6k stars), CI Failure Triage and Repair (Chachamaru127/claude-code-harness, 3.2k stars) and Megatron-LM CI/CD Guide (NVIDIA/Megatron-LM, 18k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Glab?

NikiforovAll (a GitHub user) maintains it in NikiforovAll/claude-code-rules, which has 141 GitHub stars. The repository holds 26 skills in this directory. The repository was last updated on October 2, 2026.

Source: NikiforovAll/claude-code-rules on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.