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-skills-23description: Comprehensive GitLab CLI (glab) command reference and workflows for all GitLab operations via terminal. Use when user mentions GitLab CLI, glab commands, GitLab automation, MR/issue management via CLI, CI/CD pipeline commands, repo operations, authentication setup, or any GitLab terminal operations. Routes to specialized sub-skills for auth, CI, MRs, issues, releases, repos, and 30+ other glab commands. Triggers on glab, GitLab CLI, GitLab commands, GitLab terminal, GitLab automation.4requirements:5 binaries:6 - glab7 binaries_optional:8 - cosign9 notes: |10 Requires GitLab authentication via 'glab auth login' (stores token in ~/.config/glab-cli/config.yml).11 Some features may access sensitive files: SSH keys (~/.ssh/id_rsa for DPoP), Docker config (~/.docker/config.json for registry auth).12 Review auth workflows and script contents before autonomous use.13openclaw:14 requires:15 credentials:16 - name: GITLAB_TOKEN17 description: >18 GitLab personal access token with 'api' scope. Used by automation19 scripts (e.g. post-inline-comment.py) to post MR comments via the20 REST API. If not set, scripts fall back to reading the token from21 glab CLI config (~/.config/glab-cli/config.yml).22 required: false23 fallback: glab config (set via glab auth login)24 network:25 - description: Outbound HTTPS to your GitLab instance (default https://gitlab.com)26 scope: authenticated API calls only; HTTPS enforced; token never sent over HTTP27 write_access:28 - description: >29 Scripts in this skill can post comments, resolve threads, and approve30 merge requests on your behalf. Review scripts/post-inline-comment.py31 before use in automated or agentic contexts.32metadata:33 source: https://skillmd.com/skills/modbender/gitlab-cli-skills-234---3536# GitLab CLI Skills3738Comprehensive GitLab CLI (glab) command reference and workflows.3940## Quick start4142```bash43# First time setup44glab auth login4546# Common operations47glab mr create --fill # Create MR from current branch48glab issue create # Create issue49glab ci view # View pipeline status50glab repo view --web # Open repo in browser51```5253## Skill organization5455This skill routes to specialized sub-skills by GitLab domain:5657**Core Workflows:**58- `glab-mr` - Merge requests: create, review, approve, merge59- `glab-issue` - Issues: create, list, update, close, comment60- `glab-ci` - CI/CD: pipelines, jobs, logs, artifacts61- `glab-repo` - Repositories: clone, create, fork, manage6263**Project Management:**64- `glab-milestone` - Release planning and milestone tracking65- `glab-iteration` - Sprint/iteration management66- `glab-label` - Label management and organization67- `glab-release` - Software releases and versioning6869**Authentication & Config:**70- `glab-auth` - Login, logout, Docker registry auth71- `glab-config` - CLI configuration and defaults72- `glab-ssh-key` - SSH key management73- `glab-gpg-key` - GPG keys for commit signing74- `glab-token` - Personal and project access tokens7576**CI/CD Management:**77- `glab-job` - Individual job operations78- `glab-schedule` - Scheduled pipelines and cron jobs79- `glab-variable` - CI/CD variables and secrets80- `glab-securefile` - Secure files for pipelines81- `glab-runner` - Runner management: list, pause, delete (added v1.87.0)82- `glab-runner-controller` - Runner controller and token management (EXPERIMENTAL, admin-only)8384**Collaboration:**85- `glab-user` - User profiles and information86- `glab-snippet` - Code snippets (GitLab gists)87- `glab-incident` - Incident management88- `glab-workitems` - Work items: tasks, OKRs, key results, next-gen epics (added v1.87.0)8990**Advanced:**91- `glab-api` - Direct REST API calls92- `glab-cluster` - Kubernetes cluster integration93- `glab-deploy-key` - Deploy keys for automation94- `glab-stack` - Stacked/dependent merge requests95- `glab-opentofu` - Terraform/OpenTofu state management9697**Utilities:**98- `glab-alias` - Custom command aliases99- `glab-completion` - Shell autocompletion100- `glab-help` - Command help and documentation101- `glab-version` - Version information102- `glab-check-update` - Update checker103- `glab-changelog` - Changelog generation104- `glab-attestation` - Software supply chain security105- `glab-duo` - GitLab Duo AI assistant106- `glab-mcp` - Model Context Protocol server for AI assistant integration (EXPERIMENTAL)107108## When to use glab vs web UI109110**Use glab when:**111- Automating GitLab operations in scripts112- Working in terminal-centric workflows113- Batch operations (multiple MRs/issues)114- Integration with other CLI tools115- CI/CD pipeline workflows116- Faster navigation without browser context switching117118**Use web UI when:**119- Complex diff review with inline comments120- Visual merge conflict resolution121- Configuring repo settings and permissions122- Advanced search/filtering across projects123- Reviewing security scanning results124- Managing group/instance-level settings125126## Common workflows127128### Daily development129130```bash131# Start work on issue132glab issue view 123133git checkout -b 123-feature-name134135# Create MR when ready136glab mr create --fill --draft137138# Mark ready for review139glab mr update --ready140141# Merge after approval142glab mr merge --when-pipeline-succeeds --remove-source-branch143```144145### Code review146147```bash148# List your review queue149glab mr list --reviewer=@me --state=opened150151# Review an MR152glab mr checkout 456153glab mr diff154npm test155156# Approve157glab mr approve 456158glab mr note 456 -m "LGTM! Nice work on the error handling."159```160161### CI/CD debugging162163```bash164# Check pipeline status165glab ci status166167# View failed jobs168glab ci view169170# Get job logs171glab ci trace <job-id>172173# Retry failed job174glab ci retry <job-id>175```176177## Decision Trees178179### "Should I create an MR or work on an issue first?"180181```182Need to track work?183├─ Yes → Create issue first (glab issue create)184│ Then: glab mr for <issue-id>185└─ No → Direct MR (glab mr create --fill)186```187188**Use `glab issue create` + `glab mr for` when:**189- Work needs discussion/approval before coding190- Tracking feature requests or bugs191- Sprint planning and assignment192- Want issue to auto-close when MR merges193194**Use `glab mr create` directly when:**195- Quick fixes or typos196- Working from existing issue197- Hotfixes or urgent changes198199### "Which CI command should I use?"200201```202What do you need?203├─ Overall pipeline status → glab ci status204├─ Visual pipeline view → glab ci view205├─ Specific job logs → glab ci trace <job-id>206├─ Download build artifacts → glab ci artifact <ref> <job-name>207├─ Validate config file → glab ci lint208├─ Trigger new run → glab ci run209└─ List all pipelines → glab ci list210```211212**Quick reference:**213- Pipeline-level: `glab ci status`, `glab ci view`, `glab ci run`214- Job-level: `glab ci trace`, `glab job retry`, `glab job view`215- Artifacts: `glab ci artifact` (by pipeline) or job artifacts via `glab job`216217### "Clone or fork?"218219```220What's your relationship to the repo?221├─ You have write access → glab repo clone group/project222├─ Contributing to someone else's project:223│ ├─ One-time contribution → glab repo fork + work + MR224│ └─ Ongoing contributions → glab repo fork, then sync regularly225└─ Just reading/exploring → glab repo clone (or view --web)226```227228**Fork when:**229- You don't have write access to the original repo230- Contributing to open source projects231- Experimenting without affecting the original232- Need your own copy for long-term work233234**Clone when:**235- You're a project member with write access236- Working on organization/team repositories237- No need for a personal copy238239### "Project vs group labels?"240241```242Where should the label live?243├─ Used across multiple projects → glab label create --group <group>244└─ Specific to one project → glab label create (in project directory)245```246247**Group-level labels:**248- Consistent labeling across organization249- Examples: priority::high, type::bug, status::blocked250- Managed centrally, inherited by projects251252**Project-level labels:**253- Project-specific workflows254- Examples: needs-ux-review, deploy-to-staging255- Managed by project maintainers256257## Related Skills258259**MR and Issue workflows:**260- Start with `glab-issue` to create/track work261- Use `glab-mr` to create MR that closes issue262- Script: `scripts/create-mr-from-issue.sh` automates this263264**CI/CD debugging:**265- Use `glab-ci` for pipeline-level operations266- Use `glab-job` for individual job operations267- Script: `scripts/ci-debug.sh` for quick failure diagnosis268269**Repository operations:**270- Use `glab-repo` for repository management271- Use `glab-auth` for authentication setup272- Script: `scripts/sync-fork.sh` for fork synchronization273274**Configuration:**275- Use `glab-auth` for initial authentication276- Use `glab-config` to set defaults and preferences277- Use `glab-alias` for custom shortcuts278