glab

Guides GitLab CLI usage for merge requests, issues, pipelines, and API calls.

3|1|Updated Jul 12, 2026
One-click install
npx skills add https://github.com/DuckKota/my-opencode-setup --skill glab-duckkota
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: glab
Source: https://github.com/DuckKota/my-opencode-setup/tree/main/src/skills/glab
Command: npx skills add https://github.com/DuckKota/my-opencode-setup --skill glab-duckkota

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Working with GitLab from the terminal involves tricky setup steps—installation, authentication, repository targeting, and self-hosted hosts—plus recurring failures like 401 errors, wrong project detection, and pipeline gating. This Skill provides a decision guide and troubleshooting references so GitLab CLI tasks succeed on the first attempt. ## Core Features & Use Cases - Preflight Checks: Verify glab installation, authentication status, and repository targeting before running any task commands. - Workflow Patterns: Create and review merge requests, manage issues, monitor and retry CI/CD pipelines, and lint .gitlab-ci.yml files. - Direct API Access: Use glab api with correct pagination patterns and JSON output for scripting and automation. - Use Case: You need to create a merge request from a feature branch on a self-hosted GitLab instance. The Skill walks you through confirming the host, pushing the branch, creating the MR, and handling the 'source branch already has a merge request' case. ## Quick Start Use the glab skill to create a merge request from my current branch and check its pipeline status.

Frequently Asked Questions about glab

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a merge request with the GitLab CLI?▼

Push your branch with git push -u origin feature-branch, then run glab mr create with a title and description. If the branch already has an MR, inspect it with glab mr list before creating another one.

How do I use glab with a self-hosted GitLab instance?▼

Authenticate with glab auth login --hostname gitlab.example.org, or set the GITLAB_HOST environment variable. Confirm the active host with glab auth status and use host-qualified -R owner/repo targets when auto-detection fails.

Why does glab return 401 Unauthorized or 403 Forbidden?▼

A 401 usually means you are not logged in, the token expired, or the wrong host is targeted; run glab auth status and log in again. A 403 indicates missing token scopes such as api, read_api, or write_repository, or insufficient project permissions.

How do I fix glab reporting 404 Project Not Found?▼

Check git remote -v to confirm the repository path, verify the project exists and you have access, then rerun with an explicit -R owner/repo target. Also confirm the correct GitLab host is active via glab auth status.

How do I paginate GitLab API results with glab api?▼

Put pagination parameters like per_page=100 in the request URL and pass --paginate to fetch successive pages, for example glab api --paginate "projects/:id/jobs?per_page=100". Do not pass pagination as standalone glab api flags.

What should I do when a GitLab pipeline must succeed before merging?▼

Inspect the pipeline with glab ci status and glab pipeline ci view, then retry failed jobs with glab ci retry. Validate CI configuration changes beforehand using glab ci lint.