
Glab
- 941 installs
- 72 repo stars
- Updated November 7, 2025
- henricook/claude-glab-skill
glab is an agent skill that provides expert terminal guidance for the official GitLab CLI so developers can manage merge requests, issues, CI/CD pipelines, and repositories from the command line.
About
glab is a GitLab CLI agent skill that teaches correct glab command usage for issues, merge requests, CI/CD pipelines, repository management, and other GitLab operations from the terminal. The skill is invoked when a developer or coding agent needs context-aware GitLab workflows instead of guessing flags or switching to the web UI. It covers review flows, pipeline triggers, cloning, and general glab subcommands with allowed tools limited to Bash, Read, Grep, and Glob for safe terminal execution. glab fits teams standardized on GitLab who want MR and pipeline automation inside Claude Code or similar agents. Use it whenever GitLab resources must be created, inspected, or updated without leaving the shell.
- Guides creation, review, and management of GitLab merge requests
- Handles GitLab issues, CI/CD pipelines, repository operations, and cloning
- Verifies glab installation and provides platform-specific setup instructions
- Supports both interactive auth login and environment variable token usage
- Works with self-hosted GitLab instances via custom hostname configuration
Glab by the numbers
- 941 all-time installs (skills.sh)
- +18 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #70 of 733 Git & Pull Requests skills by installs in the Skillselion catalog
- Security screen: MEDIUM risk (skills.sh audit)
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/henricook/claude-glab-skill --skill glabAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 941 |
|---|---|
| repo stars | ★ 72 |
| Security audit | 3 / 3 scanners passed |
| Last updated | November 7, 2025 |
| Repository | henricook/claude-glab-skill ↗ |
How do you manage GitLab merge requests from the CLI?
Get expert, context-aware guidance on using the official GitLab CLI (glab) directly from the terminal inside their coding agent.
Who is it for?
Developers on GitLab who want accurate glab CLI commands for MRs, issues, and pipelines inside a coding agent session.
Skip if: Teams on GitHub or Bitbucket where glab does not apply, or users who only need local git without GitLab API operations.
When should I use this skill?
The user mentions glab, GitLab merge requests, GitLab CI/CD, GitLab issues, or GitLab repository operations from the terminal.
What you get
Executed glab commands, updated merge requests and issues, and triggered or monitored GitLab CI/CD pipeline runs.
- Executed glab commands
- Updated MR or issue state
- Pipeline status or trigger results
Files
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:
glab --versionIf not installed, inform the user and provide platform-specific installation guidance.
Authentication Quick Start
Most glab operations require authentication:
# 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-hostedCore Workflows
Creating a Merge Request
# 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
# 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 review comments
glab mr note <mr-number> -m "Please update tests"Managing Issues
# 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=@meMonitoring CI/CD
# 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 lintCommon Patterns
Working Outside Repository Context
When not in a Git repository, specify the repository:
glab mr list -R owner/repo
glab issue list -R owner/repoSelf-Hosted GitLab
Set hostname for all commands:
export GITLAB_HOST=gitlab.example.org
# or per-command
glab repo clone gitlab.example.org/owner/repoAutomation and Scripting
Use JSON output for parsing:
glab mr list --output=json | jq '.[] | .title'Using the API Command
The glab api command provides direct GitLab API access:
# 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
Common Commands Quick Reference
Merge Requests:
glab mr list --assignee=@me- Your assigned MRsglab mr list --reviewer=@me- MRs for you to reviewglab mr create- Create new MRglab mr checkout <number>- Test MR locallyglab mr approve <number>- Approve MRglab mr merge <number>- Merge approved MR
Issues:
glab issue list- List all issuesglab issue create- Create new issueglab issue close <number>- Close issue
CI/CD:
glab pipeline ci view- Watch pipelineglab ci status- Check statusglab ci lint- Validate .gitlab-ci.ymlglab ci retry- Retry failed pipeline
Repository:
glab repo clone owner/repo- Clone repositoryglab repo view- View repo detailsglab 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
--webflag to open in browser - Use
--output=jsonfor scripting and automation - Multiple GitLab accounts can be authenticated simultaneously
- Commands respect Git configuration and current repository context
# Editor files
.vscode/
.idea/
*.swp
*.swo
*~
# OS files
.DS_Store
Thumbs.db
# Temporary files
*.tmp
*.log
# Node modules (if any scripts use Node.js)
node_modules/
# Python cache (if any scripts use Python)
__pycache__/
*.pyc
*.pyo
*.pyd
# Testing artifacts
test-output/
Changelog
All notable changes to the glab skill for Claude Code will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[1.0.0] - 2025-11-05
Added
- Initial release of the glab skill for Claude Code
- Comprehensive SKILL.md with detailed command documentation
- Coverage of core glab commands:
- Authentication (
glab auth) - Merge Requests (
glab mr) - Issues (
glab issue) - CI/CD (
glab ci,glab pipeline) - Repository operations (
glab repo) - API access (
glab api) - Labels, Releases, Snippets, Users
- Common workflow patterns:
- Feature branch and MR workflow
- Code review process
- CI/CD pipeline monitoring
- Issue tracking and linking
- Best practices and troubleshooting guidance
- Quick reference guide in
references/quick-reference.md - Comprehensive README.md with installation and usage instructions
- CONTRIBUTING.md with contribution guidelines
- MIT License
- .gitignore for common development artifacts
Features
- Tool restrictions (
allowed-tools: Bash, Read, Grep, Glob) - Support for both GitLab.com and self-hosted instances
- Environment variable configuration (GITLAB_TOKEN, GITLAB_HOST)
- Multi-instance authentication support
- 30+ documented glab commands
- Real-world usage examples throughout
Documentation
- Complete command reference with examples
- Common flags and options explained
- Project context detection guidance
- Configuration management instructions
- Error messages and solutions
[1.1.0] - 2025-11-06
Changed - Progressive Disclosure Refactoring
Major restructuring following Claude Code Skills best practices:
- SKILL.md reduced from 471 to 203 lines - Now focused on core workflows and patterns
- Implemented three-level context loading:
1. SKILL.md frontmatter for discovery 2. SKILL.md body for core workflows (loaded when invoked) 3. references/ folder for detailed docs (loaded only as needed)
Added
- references/commands-detailed.md (610 lines) - Comprehensive command reference with all flags and options
- references/troubleshooting.md (669 lines) - Detailed error scenarios, causes, and solutions
Improved
- SKILL.md now workflow-first, teaching WHEN and HOW to use glab
- README now explains progressive disclosure architecture
- references/quick-reference.md remains as condensed cheat sheet (145 lines)
Why This Matters
- Faster skill invocation - Smaller initial context load
- Better performance - Claude loads detailed docs only when needed
- Clearer guidance - Workflows over command memorization
- Scalable architecture - Easy to add more detailed references
Migration Notes
Users should re-pull or re-clone the skill to get the new structure:
cd ~/.claude/skills/glab && git pull
# or
rm -rf ~/.claude/skills/glab && git clone <repo> ~/.claude/skills/glab[Unreleased]
Planned
- Additional examples for advanced workflows
- More coverage of
glab duoAI features - Enterprise GitLab feature documentation
- Integration patterns with CI/CD tools
- Scripts for common operations
Notes
- This skill is based on glab v1.40.0+ command structure
- Tested with Claude Code Skills specification
- Designed following progressive disclosure principles
- Written in imperative/infinitive style as per Claude Code best practices
---
For the complete list of changes, see the commit history.
Contributing to the glab Skill
Thank you for your interest in improving the GitLab CLI skill for Claude Code! This document provides guidelines for contributing.
How to Contribute
Reporting Issues
If you find errors, missing commands, or unclear instructions:
1. Check if the issue already exists in the issue tracker 2. Provide specific details about the problem 3. Include the glab version you're using (glab --version) 4. Include examples of commands that don't work as documented
Suggesting Improvements
We welcome suggestions for:
- Additional glab commands to document
- New workflow patterns
- Better examples
- Clearer explanations
- Additional troubleshooting scenarios
Making Changes
1. Test First: Always test commands with actual glab CLI before documenting 2. Follow the Style: Match the existing writing style (imperative/infinitive form) 3. Include Examples: Provide practical, working examples 4. Update References: If adding major sections, update the quick-reference guide
Style Guidelines
Writing Style
Follow the established imperative/infinitive form:
- ✅ "To create a merge request, use:
glab mr create" - ❌ "You can create a merge request by using
glab mr create"
Code Examples
- Always use proper markdown code fencing with bash syntax highlighting
- Include comments for complex commands
- Show expected output when relevant
- Test all examples before committing
Organization
The SKILL.md is organized as: 1. YAML frontmatter - Metadata (name, description, allowed-tools) 2. Introduction - What the skill provides 3. When to Use - Invocation scenarios 4. Prerequisites - Setup requirements 5. Core Commands - Organized by feature area 6. Workflows - Complete usage patterns 7. Best Practices - Guidance and recommendations 8. Troubleshooting - Common issues and solutions
When adding content, place it in the appropriate section.
Testing Changes
Before submitting changes:
1. Verify YAML frontmatter is valid:
nameis lowercase with hyphens onlydescriptionis clear and under 1024 charactersallowed-toolslist is appropriate
2. Test commands with actual glab CLI:
# Verify glab is installed
glab --version
# Test commands you've documented
glab <command> --help3. Check markdown formatting:
- Code blocks are properly fenced
- Lists are consistently formatted
- Links work correctly
4. Verify skill loads in Claude Code:
- Place skill in
.claude/skills/glab/ - Restart Claude Code
- Test skill invocation
What to Update
When making changes, consider updating:
- SKILL.md - Main skill instructions
- quick-reference.md - If adding major commands
- README.md - If changing installation or usage
- CHANGELOG.md - Document your changes
Commit Guidelines
Write clear commit messages:
- ✅ "Add glab duo commands documentation"
- ✅ "Fix incorrect flag for glab mr create"
- ✅ "Update authentication examples"
- ❌ "Update stuff"
- ❌ "Fix"
Command Coverage
Currently Documented
The skill currently covers:
- Authentication (
glab auth) - Merge Requests (
glab mr) - Issues (
glab issue) - CI/CD (
glab ci,glab pipeline) - Repositories (
glab repo) - API (
glab api) - Labels, Releases, Snippets, Users
Could Use More Coverage
Areas that could be expanded:
glab duo- GitLab Duo AI featuresglab cluster- Kubernetes cluster managementglab iteration- Iteration managementglab stack- Stack managementglab opentofu- OpenTofu integration- Advanced API usage patterns
- Enterprise GitLab features
Documentation Standards
Command Documentation Template
When documenting a new command, use this structure:
### Command Category
#### Basic UsageSimple command
glab command subcommand
With common flags
glab command subcommand --flag=value
#### Common Options
- `--flag1` - Description
- `--flag2` - Description
#### ExamplesExample 1: Description
glab command subcommand --example
Example 2: Description
glab command subcommand --another-example
Getting Help
If you have questions: 1. Check the glab official documentation 2. Use glab <command> --help 3. Review existing skill documentation patterns 4. Open an issue for discussion
Review Process
Changes will be reviewed for:
- Accuracy of commands and flags
- Clarity of explanations
- Consistency with existing style
- Practical value to users
- Proper testing
License
By contributing, you agree that your contributions will be licensed under the MIT License.
Resources
- glab Official Repository
- GitLab CLI Documentation
- Claude Code Skills Documentation
- Agent Skills Specification
Thank you for helping make this skill better! 🚀
MIT License
Copyright (c) 2025 Claude Code Skills Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
GitLab CLI (glab) Skill for Claude Code
A comprehensive Claude Code skill that provides expert guidance for using the GitLab CLI (glab) to manage GitLab resources directly from the command line.
Overview
This skill enables Claude Code to effectively assist with GitLab workflows using the official glab CLI tool. It provides detailed knowledge about GitLab operations including merge requests, issues, CI/CD pipelines, repository management, and more.
What This Skill Provides
- Core workflows: Common GitLab operations (MRs, issues, CI/CD, repos)
- Authentication guidance: Quick setup for GitLab.com and self-hosted instances
- Best practices: When and how to use glab effectively
- Progressive disclosure: Concise core instructions with detailed references loaded as needed
- Comprehensive references: Detailed command docs, troubleshooting, and quick reference guides
Installation
Installing the Skill
This skill should be placed in your Claude Code skills directory:
# For project-specific installation
mkdir -p .claude/skills
git clone https://github.com/henricook/claude-glab-skill .claude/skills/glab
# For personal/global installation
mkdir -p ~/.claude/skills
git clone https://github.com/henricook/claude-glab-skill ~/.claude/skills/glabAfter installation, your directory structure will be:
.claude/skills/glab/
├── SKILL.md # Core skill (~200 lines, loaded when skill invoked)
├── references/ # Detailed docs (loaded only as needed)
│ ├── commands-detailed.md # Comprehensive command reference
│ ├── quick-reference.md # Command cheat sheet
│ └── troubleshooting.md # Detailed error scenarios
├── README.md
├── CONTRIBUTING.md
├── CHANGELOG.md
└── LICENSEInstalling glab CLI
Before using this skill, ensure glab is installed on your system:
macOS:
brew install glabLinux:
# Debian/Ubuntu
sudo apt install glab
# Fedora/RHEL
sudo dnf install glab
# Arch Linux
sudo pacman -S glabWindows:
# Using Chocolatey
choco install glab
# Using Scoop
scoop install glabFrom source:
go install gitlab.com/gitlab-org/cli/cmd/glab@latestFor more installation options, visit: https://gitlab.com/gitlab-org/cli
Usage
Once installed, Claude Code will automatically detect when you need GitLab CLI assistance and can invoke this skill. You can also explicitly invoke it:
@claude using the glab skill, help me create a merge requestOr simply ask Claude Code to perform GitLab operations:
Can you list my open merge requests?
Create an issue for the bug we just found
Show me the status of the CI pipelineSkill Architecture
This skill follows the progressive disclosure design principle for optimal performance:
Three-Level Context Loading
1. SKILL.md frontmatter (~50 chars) - Loaded first for skill discovery and invocation 2. SKILL.md body (~200 lines) - Core workflows and patterns loaded when skill is invoked 3. references/ folder - Detailed documentation loaded into context only as needed
SKILL.md (Core Instructions)
The main skill file is concise and focused on:
- When to use glab for different tasks
- Essential authentication setup
- Common workflow patterns (not exhaustive command lists)
- Best practices and quick fixes
- References to detailed documentation
Why it's concise: Loads quickly when invoked, providing immediate guidance without overwhelming context.
references/ (Detailed Documentation)
commands-detailed.md - Load when:
- User needs specific flag or option details
- Working with advanced commands (API, variables, schedules)
- Need comprehensive command examples
troubleshooting.md - Load when:
- Encountering authentication or connection errors
- Debugging CI/CD pipeline issues
- Need detailed error scenarios and solutions
quick-reference.md - Load when:
- User wants a command cheat sheet
- Quick lookup of common flags and patterns
Tool Restrictions
The skill is configured with allowed-tools: Bash, Read, Grep, Glob to ensure Claude Code can:
- Execute glab commands via Bash
- Read configuration and reference files as needed
- Search for relevant files and patterns
- Work within the repository context
Skill Features
Workflow-First Approach
Rather than memorizing commands, the skill teaches:
- Creating merge requests with reviewers and labels
- Reviewing code by checking out MRs locally
- Managing issues and linking them to MRs
- Monitoring CI/CD pipelines and handling failures
Comprehensive Command Coverage
30+ glab commands documented across:
- Merge Requests, Issues, CI/CD Pipelines
- Repositories, API access, Labels, Releases
- Snippets, Users, Variables, SSH Keys
- And more (see references/commands-detailed.md)
Context-Aware Assistance
The skill helps Claude Code:
- Detect when authentication is needed
- Identify repository context issues
- Suggest appropriate flags and options
- Load detailed docs only when necessary
Self-Hosted GitLab Support
Full support for GitLab.com and self-hosted instances with environment variable configuration and multi-instance authentication.
Examples
After installation, Claude Code can help with tasks like:
Creating a merge request:
Create a merge request for my current branch with the title "Fix login bug" and assign it to reviewers alice and bobReviewing merge requests:
Show me all merge requests where I'm assigned as a reviewerManaging CI/CD:
Watch the current pipeline and let me know if it passesWorking with issues:
Create a bug issue titled "API timeout" with high priority labelConfiguration
The skill automatically adapts to:
- Current repository context
- Authenticated GitLab instances
- Self-hosted GitLab via GITLAB_HOST environment variable
- Multiple authentication profiles
Contributing
This skill is designed to be comprehensive and up-to-date. If you find commands or workflows that should be added, please contribute:
1. Test your additions with actual glab usage 2. Follow the imperative/infinitive writing style established in SKILL.md 3. Include practical examples 4. Update this README if adding major new sections
Requirements
- Claude Code with Skills support
- glab CLI tool installed and in PATH
- Authenticated GitLab account (via
glab auth login) - Git repository context for repository-specific operations
Troubleshooting
If Claude Code doesn't recognize the skill: 1. Verify the skill is in .claude/skills/glab/ or ~/.claude/skills/glab/ 2. Ensure SKILL.md exists and has valid YAML frontmatter 3. Restart Claude Code if necessary
If glab commands fail: 1. Verify installation: glab --version 2. Check authentication: glab auth status 3. Ensure you're in a Git repository or use -R owner/repo flag
Resources
- glab Official Repository: https://gitlab.com/gitlab-org/cli
- GitLab CLI Documentation: https://docs.gitlab.com/editor_extensions/gitlab_cli/
- Claude Code Skills: https://docs.claude.com/en/docs/claude-code/skills
License
This skill is provided as a community resource for Claude Code users working with GitLab.
Version
Version: 1.0.0 Last Updated: November 2025 Compatible with: glab v1.40.0+
glab Commands - Detailed Reference
This is a comprehensive reference for all glab commands. This file is loaded when detailed command information is needed.
Merge Requests (MR)
Listing Merge Requests
# List MRs assigned to you
glab mr list --assignee=@me
# List MRs where you're a reviewer
glab mr list --reviewer=@me
# List all open MRs
glab mr list
# Filter by state
glab mr list --state=merged
glab mr list --state=closed
glab mr list --state=allCreating Merge Requests
# Create MR from current branch (interactive)
glab mr create
# Create MR with title and description
glab mr create --title "Fix bug" --description "Fixes issue #123"
# Create MR for specific issue
glab mr create 123
# Create draft MR
glab mr create --draft
# Create MR and assign reviewers
glab mr create --reviewer=username1,username2
# Create MR with labels
glab mr create --label="bug,priority:high"
# Create MR with assignee
glab mr create --assignee=username
# Create MR to a specific target branch
glab mr create --target-branch=develop
# Create MR and remove source branch after merge
glab mr create --remove-source-branchViewing and Interacting with MRs
# View MR details (opens in browser by default)
glab mr view 123
# View MR in terminal
glab mr view 123 --web=false
# View MR with comments
glab mr view 123 --comments
# Checkout MR branch locally
glab mr checkout 243
# Approve MR
glab mr approve 123
# Unapprove MR
glab mr unapprove 123
# Merge MR
glab mr merge 123
# Merge and delete source branch
glab mr merge 123 --remove-source-branch
# Close MR without merging
glab mr close 123
# Reopen closed MR
glab mr reopen 123
# Add note/comment to MR
glab mr note 123 -m "Looks good to me"
# Update MR title
glab mr update 123 --title "New title"
# Update MR description
glab mr update 123 --description "New description"
# Mark MR as draft
glab mr update 123 --draft
# Mark MR as ready (remove draft status)
glab mr update 123 --ready
# Subscribe to MR notifications
glab mr subscribe 123
# Unsubscribe from MR notifications
glab mr unsubscribe 123Issues
Listing Issues
# List all issues
glab issue list
# List issues assigned to you
glab issue list --assignee=@me
# List issues with specific label
glab issue list --label=bug
# List issues with multiple labels
glab issue list --label="bug,priority:high"
# List closed issues
glab issue list --state=closed
# List all issues (open and closed)
glab issue list --state=all
# Search issues
glab issue list --search="login error"
# List issues assigned to specific user
glab issue list --assignee=usernameCreating and Managing Issues
# Create issue interactively
glab issue create
# Create issue with title and description
glab issue create --title "Bug in login" --description "Users cannot log in"
# Create issue with labels
glab issue create --title "Feature request" --label="enhancement,feature"
# Create issue with assignee
glab issue create --title "Fix bug" --assignee=username
# Create confidential issue
glab issue create --title "Security issue" --confidential
# View issue details
glab issue view 456
# View issue in browser
glab issue view 456 --web
# Close issue
glab issue close 456
# Close with a comment
glab issue close 456 -m "Fixed in MR !123"
# Reopen issue
glab issue reopen 456
# Update issue title
glab issue update 456 --title "New title"
# Update issue description
glab issue update 456 --description "New description"
# Add labels to issue
glab issue update 456 --label="bug,confirmed"
# Assign issue
glab issue update 456 --assignee=username
# Subscribe to issue
glab issue subscribe 456
# Unsubscribe from issue
glab issue unsubscribe 456CI/CD Pipelines
Viewing Pipelines
# Watch pipeline in progress (interactive)
glab pipeline ci view
# List recent pipelines
glab ci list
# List pipelines with specific status
glab ci list --status=failed
glab ci list --status=success
glab ci list --status=running
# View specific pipeline status
glab ci status
# View pipeline for specific branch
glab ci status --branch=main
# Get pipeline trace/logs
glab ci trace
# Get trace for specific job
glab ci trace <job-id>
# View pipeline details
glab ci view <pipeline-id>
# Delete a pipeline
glab ci delete <pipeline-id>Triggering and Managing Pipelines
# Run/trigger pipeline
glab ci run
# Run pipeline for specific branch
glab ci run --branch=develop
# Run pipeline with variables
glab ci run --variables-file /tmp/variables.json
# Run pipeline with inline variables
glab ci run -V KEY1=value1 -V KEY2=value2
# Retry failed pipeline
glab ci retry
# Retry specific pipeline
glab ci retry <pipeline-id>
# Cancel running pipeline
glab ci cancel
# Cancel specific pipeline
glab ci cancel <pipeline-id>CI Configuration
# Lint .gitlab-ci.yml file in current directory
glab ci lint
# Lint specific file
glab ci lint --path=.gitlab-ci.yml
# View CI configuration
glab ci config
# Get CI job artifacts
glab ci artifact <job-id>
# Download artifacts to specific path
glab ci artifact <job-id> -p path/to/downloadRepository Operations
Cloning Repositories
# Clone repository
glab repo clone namespace/project
# Clone to specific directory
glab repo clone namespace/project target-dir
# Clone from self-hosted GitLab
GITLAB_HOST=gitlab.example.org glab repo clone groupname/project
# Clone repository by group (interactive)
glab repo clone -g groupname
# Clone with specific protocol
glab repo clone namespace/project --protocol=ssh
glab repo clone namespace/project --protocol=httpsRepository Information and Management
# View repository details
glab repo view
# View specific repository
glab repo view owner/repo
# View in browser
glab repo view --web
# Fork repository
glab repo fork
# Fork to specific namespace
glab repo fork --clone --namespace=mygroup
# Archive repository
glab repo archive owner/project
# Unarchive repository
glab repo unarchive owner/project
# Delete repository
glab repo delete owner/project
# Create repository
glab repo create project-name
# Create private repository
glab repo create project-name --private
# Create repository with description
glab repo create project-name --description "My project"
# Mirror repository
glab repo mirror source-repo target-repoAPI Access
Making API Calls
# GET request
glab api projects/:id/merge_requests
# GET with specific project ID
glab api projects/12345/merge_requests
# POST request with data
glab api --method POST projects/:id/issues --field title="Bug report"
# POST with multiple fields
glab api --method POST projects/:id/issues \
--field title="Bug" \
--field description="Description here" \
--field labels="bug,priority:high"
# PUT request
glab api --method PUT projects/:id/merge_requests/1 --field title="New Title"
# DELETE request
glab api --method DELETE projects/:id/issues/123
# Paginated API request (auto-fetches all pages)
glab api --paginate projects/:id/issues
# Pagination with query parameters (specify per_page in URL)
glab api "projects/:id/issues?per_page=100"
# Combine pagination flag with query parameters
glab api --paginate "projects/:id/merge_requests?per_page=50&state=opened"
# Manual pagination (specific page)
glab api "projects/:id/issues?page=2&per_page=100"
# Include response headers
glab api --include projects/:id
# Silent mode (no progress)
glab api --silent projects/:id/merge_requestsLabels
# List all labels
glab label list
# Create label
glab label create "bug" --color="#FF0000"
# Create label with description
glab label create "feature" --color="#00FF00" --description "New features"
# Delete label
glab label delete "old-label"Releases
# List releases
glab release list
# Create release
glab release create v1.0.0
# Create release with notes
glab release create v1.0.0 --notes "Release notes here"
# Create release from file
glab release create v1.0.0 --notes-file CHANGELOG.md
# Create release with assets
glab release create v1.0.0 --asset-links='[{"name":"Asset","url":"https://..."}]'
# View specific release
glab release view v1.0.0
# Download release assets
glab release download v1.0.0
# Delete release
glab release delete v1.0.0Snippets
# List snippets
glab snippet list
# List all snippets (including private)
glab snippet list --all
# Create snippet
glab snippet create --title "Config" --filename config.yml
# Create snippet from file
glab snippet create --title "Script" myfile.sh
# Create private snippet
glab snippet create --title "Secret" --private secret.txt
# View snippet
glab snippet view <snippet-id>
# Delete snippet
glab snippet delete <snippet-id>User Operations
# View current user information
glab user view
# View specific user
glab user view username
# List user's events
glab user events
# List specific user's events
glab user events usernameVariables (CI/CD)
# List variables
glab variable list
# Get specific variable
glab variable get VAR_NAME
# Set/create variable
glab variable set VAR_NAME value
# Set protected variable
glab variable set VAR_NAME value --protected
# Set masked variable
glab variable set VAR_NAME value --masked
# Update variable
glab variable update VAR_NAME new-value
# Delete variable
glab variable delete VAR_NAME
# Export variables
glab variable export > variables.json
# Import variables
glab variable import < variables.jsonAdditional Commands
Aliases
# Create alias
glab alias set co "mr checkout"
# List aliases
glab alias list
# Delete alias
glab alias delete coSSH Keys
# List SSH keys
glab ssh-key list
# Add SSH key
glab ssh-key add ~/.ssh/id_rsa.pub
# Add SSH key with title
glab ssh-key add ~/.ssh/id_rsa.pub --title "Work laptop"
# Delete SSH key
glab ssh-key delete <key-id>Deploy Keys
# List deploy keys
glab deploy-key list
# Add deploy key
glab deploy-key add --title "CI/CD" --key "ssh-rsa ..."
# Delete deploy key
glab deploy-key delete <key-id>Schedules (Pipeline Schedules)
# List pipeline schedules
glab schedule list
# Create schedule
glab schedule create --cron "0 2 * * *" --ref main --description "Nightly build"
# Run schedule immediately
glab schedule run <schedule-id>
# Delete schedule
glab schedule delete <schedule-id>Common Flags Across Commands
Most glab commands support these common flags:
--help,-h- Show help for command--repo,-R- Specify repository (format: OWNER/REPO)--web,-w- Open in web browser--output,-o- Output format (json, text, etc.)--verbose- Enable verbose output--page,-p- Page number for paginated results--per-page,-P- Number of items per page
Output Formats
Many commands support different output formats:
# JSON output (useful for scripting)
glab mr list --output=json
# Pipe to jq for processing
glab mr list --output=json | jq '.[] | .title'Configuration Commands
# View all configuration
glab config get
# Get specific config value
glab config get editor
# Set configuration value
glab config set editor vim
# Common config keys:
# - editor: preferred text editor
# - browser: web browser to use
# - glamour_style: style for terminal rendering
# - host: default GitLab hostCompletion
# Generate completion script for bash
glab completion --shell bash
# For zsh
glab completion --shell zsh
# For fish
glab completion --shell fish
# For PowerShell
glab completion --shell powershell
# Install completion (bash example)
glab completion --shell bash > /etc/bash_completion.d/glabVersion and Updates
# Show glab version
glab version
# Check for updates
glab check-update
# View changelog
glab changelogglab Quick Reference Guide
A condensed reference for the most commonly used GitLab CLI commands.
Authentication
glab auth login # Interactive login
glab auth status # Check auth status
echo "token" | glab auth login --stdin # Login with tokenMerge Requests
# Listing
glab mr list # All open MRs
glab mr list --assignee=@me # MRs assigned to me
glab mr list --reviewer=@me # MRs for me to review
# Creating
glab mr create # Interactive creation
glab mr create --title "Fix" --description "Desc"
glab mr create --draft # Create draft MR
glab mr create --reviewer=alice,bob
# Viewing & Managing
glab mr view 123 # View MR #123
glab mr checkout 123 # Checkout MR branch
glab mr approve 123 # Approve MR
glab mr merge 123 # Merge MR
glab mr note 123 -m "Comment" # Add commentIssues
# Listing
glab issue list # All issues
glab issue list --assignee=@me # Assigned to me
glab issue list --label=bug # With label
# Creating & Managing
glab issue create # Interactive
glab issue create --title "Bug" --label=bug
glab issue view 456 # View issue
glab issue close 456 # Close issueCI/CD
# Pipelines
glab pipeline ci view # Watch pipeline
glab ci list # List pipelines
glab ci status # Pipeline status
glab ci trace # View logs
# Running & Managing
glab ci run # Trigger pipeline
glab ci lint # Lint .gitlab-ci.yml
glab ci retry # Retry pipeline
glab ci cancel # Cancel pipelineRepository
glab repo clone org/project # Clone repository
glab repo view # View repo details
glab repo fork # Fork repositoryAPI
glab api projects/:id/merge_requests # GET request
glab api --method POST projects/:id/issues \
--field title="Bug" # POST with dataCommon Flags
--help, -h # Show help
--repo, -R owner/repo # Specify repository
--web, -w # Open in browser
--output, -o json # JSON output
--verbose # Verbose outputEnvironment Variables
GITLAB_TOKEN=xxx # API token
GITLAB_HOST=gitlab.example.org # Self-hosted GitLabConfiguration
glab config get # View configuration
glab config set key value # Set config valueComplete Command List
glab alias- Create command shortcutsglab api- Make API callsglab auth- Authentication managementglab changelog- Generate changelogsglab check-update- Check for updatesglab ci- CI/CD operationsglab cluster- Kubernetes cluster managementglab completion- Shell completionglab config- Configuration managementglab deploy-key- Deploy key managementglab duo- GitLab Duo AI featuresglab incident- Incident managementglab issue- Issue trackingglab iteration- Iteration managementglab job- CI job operationsglab label- Label managementglab mr- Merge request operationsglab opentofu- OpenTofu integrationglab release- Release managementglab repo- Repository operationsglab schedule- Pipeline schedule managementglab securefile- Secure file managementglab snippet- Snippet operationsglab ssh-key- SSH key managementglab stack- Stack managementglab token- Access token managementglab user- User operationsglab variable- CI/CD variable managementglab version- Show version
Tips
1. Use glab <command> --help for detailed help 2. Commands auto-detect repository context from git remote 3. Use -R owner/repo when outside a repository 4. Most commands have --web flag to open in browser 5. Use --output=json for scripting 6. Enable completion: glab completion --shell bash
glab Troubleshooting Guide
Comprehensive troubleshooting guide for common glab CLI issues and errors.
Installation Issues
Command Not Found
Error:
command not found: glabor
glab: command not foundCauses:
- glab is not installed
- glab is not in PATH
Solutions: 1. Verify installation:
which glab2. Install glab if missing (see main README for installation instructions)
3. If installed but not in PATH, add to PATH:
# Find where glab is installed
find / -name glab 2>/dev/null
# Add to PATH in ~/.bashrc or ~/.zshrc
export PATH="$PATH:/path/to/glab"4. For Go installation, ensure $GOPATH/bin is in PATH:
export PATH="$PATH:$(go env GOPATH)/bin"Version Conflicts
Error:
glab: incompatible versionSolution: Update to the latest version:
# macOS
brew upgrade glab
# Linux (depends on package manager)
sudo apt update && sudo apt upgrade glabAuthentication Issues
401 Unauthorized
Error:
failed to get current user: GET https://gitlab.com/api/v4/user: 401 {message: 401 Unauthorized}Causes:
- Not authenticated
- Token expired
- Invalid token
- Wrong GitLab instance
Solutions: 1. Authenticate:
glab auth login2. Check authentication status:
glab auth status3. Re-authenticate with new token:
glab auth login --hostname gitlab.com --token YOUR_TOKEN4. Verify token has correct scopes (api, read_user, write_repository)
5. For self-hosted GitLab, ensure correct hostname:
glab auth login --hostname gitlab.example.orgToken Permissions
Error:
403 Forbiddenor
insufficient permissionsCauses:
- Token lacks required scopes
- User doesn't have project permissions
Solutions: 1. Create new token with required scopes:
- api
- read_api
- read_user
- write_repository
- read_repository
2. Verify project access in GitLab web UI
3. Check if project is private and token has access
Multiple Accounts
Issue: Working with multiple GitLab instances
Solution: glab supports multiple authenticated accounts:
# Authenticate with gitlab.com
glab auth login --hostname gitlab.com
# Authenticate with self-hosted instance
glab auth login --hostname gitlab.example.org
# Check all authenticated accounts
glab auth status
# Use specific host for command
glab mr list -R gitlab.example.org/namespace/projectRepository Context Issues
Not a Git Repository
Error:
fatal: not a git repository (or any of the parent directories): .gitCauses:
- Running glab outside a Git repository
- Git repository not initialized
Solutions: 1. Navigate to a Git repository:
cd /path/to/your/repo2. Or specify repository explicitly:
glab mr list -R owner/repo3. Initialize Git repository if needed:
git init
git remote add origin git@gitlab.com:owner/repo.gitWrong Repository Detected
Issue: glab operating on wrong repository
Solution: 1. Check current repository remote:
git remote -v2. Specify correct repository:
glab mr list -R owner/correct-repo3. Update Git remote if wrong:
git remote set-url origin git@gitlab.com:owner/correct-repo.git404 Project Not Found
Error:
404 Project Not FoundCauses:
- Repository doesn't exist
- Wrong namespace/project name
- No access permissions
- Wrong GitLab instance
Solutions: 1. Verify repository name:
# Check in GitLab web UI
# Correct format: namespace/project2. Check you have access to the project
3. Verify GitLab instance:
glab auth status4. For self-hosted, set correct host:
GITLAB_HOST=gitlab.example.org glab repo viewMerge Request Issues
Source Branch Already Has MR
Error:
failed to create merge request: source branch already has a merge requestCause:
- A merge request already exists for this branch
Solutions: 1. List existing MRs to find it:
glab mr list
glab mr list --source-branch=$(git branch --show-current)2. View the existing MR:
glab mr view <mr-number>3. Update existing MR instead of creating new one:
glab mr update <mr-number> --title "New title"Cannot Merge: Conflicts Exist
Error:
Cannot merge: merge conflicts existSolutions: 1. Checkout MR locally:
glab mr checkout <mr-number>2. Fetch latest target branch:
git fetch origin main3. Merge or rebase:
git merge origin/main
# or
git rebase origin/main4. Resolve conflicts and push:
git add .
git commit
git pushPipeline Must Succeed
Error:
cannot merge: pipeline must succeedCause:
- Project requires successful pipeline before merge
- Pipeline is failing or pending
Solutions: 1. Check pipeline status:
glab ci status2. View pipeline details:
glab pipeline ci view3. Fix pipeline failures and retry:
glab ci retry4. If project settings allow, force merge (not recommended):
# Only if you have maintainer permissions
glab mr merge <mr-number> --when-pipeline-succeedsCannot Push to Source Branch
Error:
You cannot push commits to this source branchCause:
- MR is from a fork
- No write access to source repository
Solution: Ask MR author to make changes, or: 1. Checkout MR:
glab mr checkout <mr-number>2. Make changes on their fork (requires special permissions)
Pipeline/CI Issues
Pipeline Not Found
Error:
pipeline not foundCauses:
- No pipeline exists for current branch
- Pipeline hasn't started yet
Solutions: 1. Trigger a pipeline:
glab ci run2. Check if .gitlab-ci.yml exists:
ls -la .gitlab-ci.yml3. Verify CI/CD is enabled in project settings
CI Lint Errors
Error:
.gitlab-ci.yml is invalidSolutions: 1. Lint locally:
glab ci lint2. Common issues:
- YAML syntax errors (tabs vs spaces)
- Invalid job names
- Missing required fields
- Incorrect indentation
3. Use GitLab CI/CD config validation in web UI
4. Check GitLab CI/CD documentation for syntax
Cannot Download Artifacts
Error:
failed to download artifactsCauses:
- Artifacts expired
- Job didn't produce artifacts
- Permission issues
Solutions: 1. Check if job has artifacts:
glab ci view <pipeline-id>2. Verify artifacts haven't expired (check project settings)
3. Run job again if needed:
glab ci retryNetwork and Connection Issues
Connection Timeout
Error:
dial tcp: i/o timeoutCauses:
- Network connectivity issues
- Firewall blocking connection
- GitLab instance down
Solutions: 1. Check network connection:
ping gitlab.com2. Verify GitLab status:
curl -I https://gitlab.com3. Check firewall/proxy settings
4. For self-hosted, verify hostname:
ping gitlab.example.orgSSL Certificate Issues
Error:
x509: certificate signed by unknown authorityCauses:
- Self-signed certificate
- Corporate proxy
- Invalid SSL certificate
Solutions: 1. For development/testing only (NOT production):
export GIT_SSL_NO_VERIFY=true2. Add certificate to system trust store (preferred)
3. Configure Git to use specific CA bundle:
git config --global http.sslCAInfo /path/to/cert.pemEnvironment Variable Issues
GITLAB_HOST Not Recognized
Issue: Commands still using gitlab.com instead of self-hosted instance
Solutions: 1. Export variable in current shell:
export GITLAB_HOST=gitlab.example.org2. Add to shell profile (~/.bashrc, ~/.zshrc):
echo 'export GITLAB_HOST=gitlab.example.org' >> ~/.bashrc
source ~/.bashrc3. Or use flag for each command:
glab mr list -R gitlab.example.org/owner/repoGITLAB_TOKEN Not Working
Issue: Token set but authentication still failing
Solutions: 1. Verify token is exported:
echo $GITLAB_TOKEN2. Ensure no spaces in token:
export GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx3. Token should not be quoted in export:
# Correct
export GITLAB_TOKEN=glpat-xxx
# Incorrect
export GITLAB_TOKEN="glpat-xxx"4. Verify token is valid in GitLab web UI
Output and Display Issues
Garbled or Missing Output
Issue: Terminal output is corrupted or incomplete
Solutions: 1. Disable glamour styling:
export GLAMOUR_STYLE=notty2. Use plain text output:
glab mr list --output=text3. Update terminal emulator
4. Try different pager:
export PAGER=lessJSON Parsing Errors
Issue: Cannot parse JSON output
Solutions: 1. Ensure command supports JSON:
glab mr list --output=json2. Pipe through jq for validation:
glab mr list --output=json | jq '.'3. Check for error messages mixed with JSON
Performance Issues
Commands Running Slowly
Causes:
- Large repository
- Many results being fetched
- Network latency
Solutions: 1. Limit results:
glab mr list --per-page=10 --page=12. Use specific filters:
glab mr list --assignee=@me --state=opened3. Disable web browser opening:
glab mr view 123 --web=falseConfiguration Issues
Config File Corruption
Error:
failed to load configSolutions: 1. Check config file:
cat ~/.config/glab-cli/config.yml2. Backup and recreate:
mv ~/.config/glab-cli/config.yml ~/.config/glab-cli/config.yml.bak
glab auth login3. Manually edit config:
vim ~/.config/glab-cli/config.ymlGeneral Troubleshooting Steps
When encountering any error:
1. Check version:
glab version2. Update glab:
glab check-update3. Enable verbose output:
glab <command> --verbose4. Check authentication:
glab auth status5. Verify repository context:
git remote -v6. Use --help:
glab <command> --help7. Check GitLab API status: Visit https://status.gitlab.com
8. Review logs:
# Check recent commands
history | grep glabGetting Additional Help
If issues persist:
1. Check glab documentation: https://docs.gitlab.com/editor_extensions/gitlab_cli/ 2. Search glab issues: https://gitlab.com/gitlab-org/cli/-/issues 3. Create a new issue with:
- glab version
- Operating system
- Full error message
- Steps to reproduce
- Output with --verbose flag
Related skills
How it compares
Pick glab over generic git skills when the remote is GitLab and the task needs MR, issue, or pipeline APIs via the official CLI.
FAQ
What GitLab operations does the glab skill cover?
The glab skill guides the official GitLab CLI for merge requests, issues, CI/CD pipelines, repository cloning, and other GitLab resource management directly from the terminal.
Which agent tools can the glab skill use?
The glab skill allows Bash, Read, Grep, and Glob so agents can run glab commands and inspect repository context without unrelated write tooling.
Is Glab safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.