Skills glab
GitLab CLI for managing issues, merge requests, CI/CD pipelines, and repositories. Use when: (1) Creating, reviewing, or merging MRs, (2) Managing GitLab issues, (3) Monitoring or triggering CI/CD pipelines, (4) Working with self-hosted GitLab instances, (5) Automating GitLab workflows from the command line. Requires GITLAB_TOKEN (recommend minimal scopes). The `glab api` command enables arbitrary API calls - use read-only tokens when possible.
git clone https://github.com/openclaw/skills
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/bezkom/glab" ~/.claude/skills/openclaw-skills-glab && rm -rf "$T"
T=$(mktemp -d) && git clone --depth=1 https://github.com/openclaw/skills "$T" && mkdir -p ~/.openclaw/skills && cp -r "$T/skills/bezkom/glab" ~/.openclaw/skills/openclaw-skills-glab && rm -rf "$T"
skills/bezkom/glab/SKILL.mdGitLab CLI (glab)
Official CLI for GitLab. Manage issues, merge requests, pipelines, and more from the terminal.
Source: Inspired by NikiforovAll/glab-skill on Smithery.
⚠️ Security Notice
The
command provides unrestricted GitLab API access with your token.glab api
- A compromised or overly-permissive token can delete projects, modify settings, expose secrets
- Recommendation: Use tokens with minimal scopes:
- Read-only operationsread_api
- Full access (only when write operations needed)api
- For automation, consider project-level tokens with limited scope
- Never use tokens with
scope unless requiredsudo
Prerequisites
Required binaries:
- GitLab CLIglab
- JSON processor (for scripts and API parsing)jq
Required credentials:
- GitLab personal access tokenGITLAB_TOKEN
Optional configuration:
- Self-hosted GitLab instance (default: gitlab.com)GITLAB_HOST
# Verify installation glab --version jq --version # Authenticate (interactive) glab auth login # Or via environment export GITLAB_TOKEN="glpat-xxxxxxxxxxxxxxxxxxxx" export GITLAB_HOST="gitlab.example.org" # for self-hosted # Verify auth glab auth status
Quick Reference
Merge Requests:
glab mr create --title "Fix" --description "Closes #123" glab mr list --reviewer=@me # MRs awaiting your review glab mr checkout 123 # Test MR locally glab mr approve 123 && glab mr merge 123
Issues:
glab issue create --title "Bug" --label=bug glab issue list --assignee=@me glab issue close 456
CI/CD:
glab ci status # Current pipeline status glab pipeline ci view # Watch pipeline live glab ci lint # Validate .gitlab-ci.yml glab ci retry # Retry failed pipeline
Working Outside Repo:
glab mr list -R owner/repo # Specify repository
Advanced API Access:
See references/api-advanced.md for
glab api usage. This command enables arbitrary GitLab API calls and should be used with appropriately-scoped tokens.
Core Workflows
Create and Merge MR
# 1. Push branch git push -u origin feature-branch # 2. Create MR glab mr create --title "Add feature" --description "Implements X" --reviewer=alice,bob --label="enhancement" # 3. After approval, merge glab mr approve 123 glab mr merge 123 --remove-source-branch
Review MR
# List MRs for review glab mr list --reviewer=@me # Checkout and test glab mr checkout 123 # Approve or comment glab mr approve 123 glab mr note 123 -m "Looks good, just one suggestion..."
Monitor Pipeline
# Watch current branch pipeline glab pipeline ci view # Check specific pipeline glab ci view 456 # View failed job logs glab ci trace # Retry glab ci retry
Self-Hosted GitLab
# Set default host export GITLAB_HOST=gitlab.example.org # Or per-command glab mr list -R gitlab.example.org/owner/repo
Scripts
| Script | Description |
|---|---|
| Wait for MR approval and successful pipeline |
| Monitor pipeline with exit codes for CI |
# Wait for MR to be approved and merged ./scripts/glab-mr-await.sh 123 --timeout 600 # Watch pipeline, exit 0 on success, 1 on failure ./scripts/glab-pipeline-watch.sh --timeout 300
Script environment variables:
- Max wait time in seconds (default varies by script)TIMEOUT
- Polling interval in seconds (default 5-10s)INTERVAL
Troubleshooting
| Error | Fix |
|---|---|
| Install glab |
| Install jq |
| Set or run |
| Verify repo name and permissions |
| Use flag |
| to find existing |
For detailed troubleshooting, see references/troubleshooting.md.
Progressive Disclosure
- references/api-advanced.md -
usage with security considerationsglab api - references/commands-detailed.md - Full command reference with all flags
- references/troubleshooting.md - Detailed error scenarios and solutions
Load these when you need specific flag details or are debugging issues.
Best Practices
- Always verify auth:
glab auth status - Use minimal-scope tokens for read operations
- Link MRs to issues: "Closes #123" in description
- Lint CI config before pushing:
glab ci lint - Use
for scripting--output=json - Most commands have
to open in browser--web