GitLab CLI Skills
Comprehensive GitLab CLI (glab) command reference and workflows.
Quick start
# First time setup
glab auth login
# Common operations
glab mr create --fill # Create MR from current branch
glab issue create # Create issue
glab ci view # View pipeline status
glab repo view --web # Open repo in browser
Skill organization
This skill routes to specialized sub-skills by GitLab domain:
Core Workflows:
glab-mr - Merge requests: create, review, approve, merge
glab-issue - Issues: create, list, update, close, comment
glab-ci - CI/CD: pipelines, jobs, logs, artifacts
glab-repo - Repositories: clone, create, fork, manage
Project Management:
glab-milestone - Release planning and milestone tracking
glab-iteration - Sprint/iteration management
glab-label - Label management and organization
glab-release - Software releases and versioning
Authentication & Config:
glab-auth - Login, logout, Docker registry auth
glab-config - CLI configuration and defaults
glab-ssh-key - SSH key management
glab-gpg-key - GPG keys for commit signing
glab-token - Personal and project access tokens
CI/CD Management:
glab-job - Individual job operations
glab-schedule - Scheduled pipelines and cron jobs
glab-variable - CI/CD variables and secrets
glab-securefile - Secure files for pipelines
glab-runner - Runner management: list, pause, delete (added v1.87.0)
glab-runner-controller - Runner controller and token management (EXPERIMENTAL, admin-only)
Collaboration:
glab-user - User profiles and information
glab-snippet - Code snippets (GitLab gists)
glab-incident - Incident management
glab-workitems - Work items: tasks, OKRs, key results, next-gen epics (added v1.87.0)
Advanced:
glab-api - Direct REST API calls
glab-cluster - Kubernetes cluster integration
glab-deploy-key - Deploy keys for automation
glab-stack - Stacked/dependent merge requests
glab-opentofu - Terraform/OpenTofu state management
Utilities:
glab-alias - Custom command aliases
glab-completion - Shell autocompletion
glab-help - Command help and documentation
glab-version - Version information
glab-check-update - Update checker
glab-changelog - Changelog generation
glab-attestation - Software supply chain security
glab-duo - GitLab Duo AI assistant
glab-mcp - Model Context Protocol server for AI assistant integration (EXPERIMENTAL)
When to use glab vs web UI
Use glab when:
- Automating GitLab operations in scripts
- Working in terminal-centric workflows
- Batch operations (multiple MRs/issues)
- Integration with other CLI tools
- CI/CD pipeline workflows
- Faster navigation without browser context switching
Use web UI when:
- Complex diff review with inline comments
- Visual merge conflict resolution
- Configuring repo settings and permissions
- Advanced search/filtering across projects
- Reviewing security scanning results
- Managing group/instance-level settings
Common workflows
Daily development
# Start work on issue
glab issue view 123
git checkout -b 123-feature-name
# Create MR when ready
glab mr create --fill --draft
# Mark ready for review
glab mr update --ready
# Merge after approval
glab mr merge --when-pipeline-succeeds --remove-source-branch
Code review
# List your review queue
glab mr list --reviewer=@me --state=opened
# Review an MR
glab mr checkout 456
glab mr diff
npm test
# Approve
glab mr approve 456
glab mr note 456 -m "LGTM! Nice work on the error handling."
CI/CD debugging
# Check pipeline status
glab ci status
# View failed jobs
glab ci view
# Get job logs
glab ci trace <job-id>
# Retry failed job
glab ci retry <job-id>
Decision Trees
"Should I create an MR or work on an issue first?"
Need to track work?
├─ Yes → Create issue first (glab issue create)
│ Then: glab mr for <issue-id>
└─ No → Direct MR (glab mr create --fill)
Use glab issue create + glab mr for when:
- Work needs discussion/approval before coding
- Tracking feature requests or bugs
- Sprint planning and assignment
- Want issue to auto-close when MR merges
Use glab mr create directly when:
- Quick fixes or typos
- Working from existing issue
- Hotfixes or urgent changes
"Which CI command should I use?"
What do you need?
├─ Overall pipeline status → glab ci status
├─ Visual pipeline view → glab ci view
├─ Specific job logs → glab ci trace <job-id>
├─ Download build artifacts → glab ci artifact <ref> <job-name>
├─ Validate config file → glab ci lint
├─ Trigger new run → glab ci run
└─ List all pipelines → glab ci list
Quick reference:
- Pipeline-level:
glab ci status, glab ci view, glab ci run
- Job-level:
glab ci trace, glab job retry, glab job view
- Artifacts:
glab ci artifact (by pipeline) or job artifacts via glab job
"Clone or fork?"
What's your relationship to the repo?
├─ You have write access → glab repo clone group/project
├─ Contributing to someone else's project:
│ ├─ One-time contribution → glab repo fork + work + MR
│ └─ Ongoing contributions → glab repo fork, then sync regularly
└─ Just reading/exploring → glab repo clone (or view --web)
Fork when:
- You don't have write access to the original repo
- Contributing to open source projects
- Experimenting without affecting the original
- Need your own copy for long-term work
Clone when:
- You're a project member with write access
- Working on organization/team repositories
- No need for a personal copy
"Project vs group labels?"
Where should the label live?
├─ Used across multiple projects → glab label create --group <group>
└─ Specific to one project → glab label create (in project directory)
Group-level labels:
- Consistent labeling across organization
- Examples: priority::high, type::bug, status::blocked
- Managed centrally, inherited by projects
Project-level labels:
- Project-specific workflows
- Examples: needs-ux-review, deploy-to-staging
- Managed by project maintainers
Related Skills
MR and Issue workflows:
- Start with
glab-issue to create/track work
- Use
glab-mr to create MR that closes issue
- Script:
scripts/create-mr-from-issue.sh automates this
CI/CD debugging:
- Use
glab-ci for pipeline-level operations
- Use
glab-job for individual job operations
- Script:
scripts/ci-debug.sh for quick failure diagnosis
Repository operations:
- Use
glab-repo for repository management
- Use
glab-auth for authentication setup
- Script:
scripts/sync-fork.sh for fork synchronization
Configuration:
- Use
glab-auth for initial authentication
- Use
glab-config to set defaults and preferences
- Use
glab-alias for custom shortcuts
1---2name: gitlab-cli-skills3description: Guide users through GitLab CLI (glab) operations with command references and workflow examples for merge requests, issues, CI/CD pipelines, repositories, authentication, and over 30 other commands. Trigger when users mention GitLab CLI, glab commands, GitLab automation, MR/issue management via CLI, CI/CD pipeline commands, repo operations, authentication setup, or any GitLab terminal operations.4---56# GitLab CLI Skills78Comprehensive GitLab CLI (glab) command reference and workflows.910## Quick start1112```bash13# First time setup14glab auth login1516# Common operations17glab mr create --fill # Create MR from current branch18glab issue create # Create issue19glab ci view # View pipeline status20glab repo view --web # Open repo in browser21```2223## Skill organization2425This skill routes to specialized sub-skills by GitLab domain:2627**Core Workflows:**28- `glab-mr` - Merge requests: create, review, approve, merge29- `glab-issue` - Issues: create, list, update, close, comment30- `glab-ci` - CI/CD: pipelines, jobs, logs, artifacts31- `glab-repo` - Repositories: clone, create, fork, manage3233**Project Management:**34- `glab-milestone` - Release planning and milestone tracking35- `glab-iteration` - Sprint/iteration management36- `glab-label` - Label management and organization37- `glab-release` - Software releases and versioning3839**Authentication & Config:**40- `glab-auth` - Login, logout, Docker registry auth41- `glab-config` - CLI configuration and defaults42- `glab-ssh-key` - SSH key management43- `glab-gpg-key` - GPG keys for commit signing44- `glab-token` - Personal and project access tokens4546**CI/CD Management:**47- `glab-job` - Individual job operations48- `glab-schedule` - Scheduled pipelines and cron jobs49- `glab-variable` - CI/CD variables and secrets50- `glab-securefile` - Secure files for pipelines51- `glab-runner` - Runner management: list, pause, delete (added v1.87.0)52- `glab-runner-controller` - Runner controller and token management (EXPERIMENTAL, admin-only)5354**Collaboration:**55- `glab-user` - User profiles and information56- `glab-snippet` - Code snippets (GitLab gists)57- `glab-incident` - Incident management58- `glab-workitems` - Work items: tasks, OKRs, key results, next-gen epics (added v1.87.0)5960**Advanced:**61- `glab-api` - Direct REST API calls62- `glab-cluster` - Kubernetes cluster integration63- `glab-deploy-key` - Deploy keys for automation64- `glab-stack` - Stacked/dependent merge requests65- `glab-opentofu` - Terraform/OpenTofu state management6667**Utilities:**68- `glab-alias` - Custom command aliases69- `glab-completion` - Shell autocompletion70- `glab-help` - Command help and documentation71- `glab-version` - Version information72- `glab-check-update` - Update checker73- `glab-changelog` - Changelog generation74- `glab-attestation` - Software supply chain security75- `glab-duo` - GitLab Duo AI assistant76- `glab-mcp` - Model Context Protocol server for AI assistant integration (EXPERIMENTAL)7778## When to use glab vs web UI7980**Use glab when:**81- Automating GitLab operations in scripts82- Working in terminal-centric workflows83- Batch operations (multiple MRs/issues)84- Integration with other CLI tools85- CI/CD pipeline workflows86- Faster navigation without browser context switching8788**Use web UI when:**89- Complex diff review with inline comments90- Visual merge conflict resolution91- Configuring repo settings and permissions92- Advanced search/filtering across projects93- Reviewing security scanning results94- Managing group/instance-level settings9596## Common workflows9798### Daily development99100```bash101# Start work on issue102glab issue view 123103git checkout -b 123-feature-name104105# Create MR when ready106glab mr create --fill --draft107108# Mark ready for review109glab mr update --ready110111# Merge after approval112glab mr merge --when-pipeline-succeeds --remove-source-branch113```114115### Code review116117```bash118# List your review queue119glab mr list --reviewer=@me --state=opened120121# Review an MR122glab mr checkout 456123glab mr diff124npm test125126# Approve127glab mr approve 456128glab mr note 456 -m "LGTM! Nice work on the error handling."129```130131### CI/CD debugging132133```bash134# Check pipeline status135glab ci status136137# View failed jobs138glab ci view139140# Get job logs141glab ci trace <job-id>142143# Retry failed job144glab ci retry <job-id>145```146147## Decision Trees148149### "Should I create an MR or work on an issue first?"150151```152Need to track work?153├─ Yes → Create issue first (glab issue create)154│ Then: glab mr for <issue-id>155└─ No → Direct MR (glab mr create --fill)156```157158**Use `glab issue create` + `glab mr for` when:**159- Work needs discussion/approval before coding160- Tracking feature requests or bugs161- Sprint planning and assignment162- Want issue to auto-close when MR merges163164**Use `glab mr create` directly when:**165- Quick fixes or typos166- Working from existing issue167- Hotfixes or urgent changes168169### "Which CI command should I use?"170171```172What do you need?173├─ Overall pipeline status → glab ci status174├─ Visual pipeline view → glab ci view175├─ Specific job logs → glab ci trace <job-id>176├─ Download build artifacts → glab ci artifact <ref> <job-name>177├─ Validate config file → glab ci lint178├─ Trigger new run → glab ci run179└─ List all pipelines → glab ci list180```181182**Quick reference:**183- Pipeline-level: `glab ci status`, `glab ci view`, `glab ci run`184- Job-level: `glab ci trace`, `glab job retry`, `glab job view`185- Artifacts: `glab ci artifact` (by pipeline) or job artifacts via `glab job`186187### "Clone or fork?"188189```190What's your relationship to the repo?191├─ You have write access → glab repo clone group/project192├─ Contributing to someone else's project:193│ ├─ One-time contribution → glab repo fork + work + MR194│ └─ Ongoing contributions → glab repo fork, then sync regularly195└─ Just reading/exploring → glab repo clone (or view --web)196```197198**Fork when:**199- You don't have write access to the original repo200- Contributing to open source projects201- Experimenting without affecting the original202- Need your own copy for long-term work203204**Clone when:**205- You're a project member with write access206- Working on organization/team repositories207- No need for a personal copy208209### "Project vs group labels?"210211```212Where should the label live?213├─ Used across multiple projects → glab label create --group <group>214└─ Specific to one project → glab label create (in project directory)215```216217**Group-level labels:**218- Consistent labeling across organization219- Examples: priority::high, type::bug, status::blocked220- Managed centrally, inherited by projects221222**Project-level labels:**223- Project-specific workflows224- Examples: needs-ux-review, deploy-to-staging225- Managed by project maintainers226227## Related Skills228229**MR and Issue workflows:**230- Start with `glab-issue` to create/track work231- Use `glab-mr` to create MR that closes issue232- Script: `scripts/create-mr-from-issue.sh` automates this233234**CI/CD debugging:**235- Use `glab-ci` for pipeline-level operations236- Use `glab-job` for individual job operations237- Script: `scripts/ci-debug.sh` for quick failure diagnosis238239**Repository operations:**240- Use `glab-repo` for repository management241- Use `glab-auth` for authentication setup242- Script: `scripts/sync-fork.sh` for fork synchronization243244**Configuration:**245- Use `glab-auth` for initial authentication246- Use `glab-config` to set defaults and preferences247- Use `glab-alias` for custom shortcuts248