Agent skill
glab
GitLab CLI (glab) for merge requests, issues, and CI/CD pipelines. Use when working with GitLab repositories for MR creation/review, issue management, pipeline debugging, or any GitLab API operations. Triggers on GitLab URLs, mentions of "merge request" or "MR" (not "PR"), gitlab.com, or glab commands.
Install this agent skill to your Project
npx add-skill https://github.com/ianphil/my-skills/tree/main/glab
SKILL.md
glab - GitLab CLI
Quick Reference
# Authentication
glab auth login # Interactive login
glab auth status # Check auth status
# Merge Requests
glab mr create # Create MR interactively
glab mr list # List open MRs
glab mr view <id> # View MR details
glab mr merge <id> # Merge an MR
glab mr checkout <id> # Checkout MR branch locally
# Issues
glab issue create # Create issue interactively
glab issue list # List open issues
glab issue view <id> # View issue details
glab issue close <id> # Close an issue
# Pipelines
glab ci status # Current branch pipeline status
glab ci view # View pipeline in browser
glab ci list # List recent pipelines
glab ci trace # Stream job logs live
MR Creation Flow
# Create MR with options
glab mr create \
--title "feat: add user authentication" \
--description "Implements OAuth2 login flow" \
--assignee @me \
--reviewer @teammate \
--label "feature,needs-review" \
--milestone "v1.0"
# Create draft MR
glab mr create --draft --title "WIP: refactoring auth"
# Create MR targeting specific branch
glab mr create --target-branch develop
# Push and create MR in one step
glab mr create --push
MR Review Workflow
# List MRs needing review
glab mr list --reviewer=@me
# Checkout MR for local testing
glab mr checkout 42
# ... test locally ...
# Approve MR
glab mr approve 42
# Merge when ready
glab mr merge 42 --squash --remove-source-branch
Issue Management
Creating Issues with Descriptions
Simple inline description:
glab issue create --title "Fix login bug" --description "Users cannot log in"
Multiline descriptions - use $'...' syntax for newlines:
glab issue create \
--title "Bug: login fails on mobile" \
--description $'## Summary\nLogin fails on iOS devices.\n\n## Steps to Reproduce\n1. Open app\n2. Tap login\n3. Enter credentials\n\n## Expected\nUser logs in successfully'
Complex descriptions - use a temp file (most reliable):
cat << 'EOF' > /tmp/issue-body.md
## Summary
Login fails on iOS devices when using OAuth.
## Steps to Reproduce
1. Open the app on iOS 17+
2. Tap "Login with Google"
3. Complete OAuth flow
4. App crashes on redirect
## Expected Behavior
User should be logged in and see dashboard.
## Environment
- iOS 17.2
- App version 2.3.1
EOF
glab issue create \
--title "Bug: OAuth login crashes on iOS" \
--label "bug,priority::high" \
--assignee @me \
< /tmp/issue-body.md
Interactive mode (opens editor):
glab issue create # Opens $EDITOR for description
Updating Issues
# Update description (use -d flag)
glab issue update 123 -d "New description here"
# Multiline description update
glab issue update 123 -d $'## Updated\n\nNew multiline description'
# Open editor for description (-d "-" opens $EDITOR)
glab issue update 123 -d -
# Update from file
glab issue update 123 -d "$(cat /tmp/new-description.md)"
# Other updates
glab issue update 123 --title "New title"
glab issue update 123 -l "in-progress"
glab issue update 123 --unlabel "needs-triage"
glab issue update 123 --assignee @teammate
glab issue update 123 --milestone "v1.0"
Note: For very complex updates, the API gives more control:
glab api --method PUT projects/:fullpath/issues/123 \
-f description="$(cat /tmp/description.md)"
Issue Search and Filtering
glab issue list --search "authentication"
glab issue list --label "bug"
glab issue list --label "bug" --label "priority::high" # AND logic
glab issue list --assignee @me
glab issue list --author @me
glab issue list --closed
glab issue list --milestone "v1.0"
Linking Issues to MRs
In MR descriptions, use keywords to auto-close issues on merge:
Closes #123Fixes #123Resolves #123
glab issue close 123
glab issue reopen 123
Pipeline Debugging
# Check current pipeline status
glab ci status
# List recent pipelines
glab ci list
glab ci list --status=failed
# View pipeline interactively (shows jobs, allows actions)
glab ci view
# View specific branch pipeline
glab ci view main
Job Operations
# Stream live logs (interactive job selection)
glab ci trace
# Stream logs from specific job (by name or ID)
glab ci trace build
glab ci trace 224356863
# Retry a failed job
glab ci retry deploy
glab ci retry 224356863
# Trigger a manual job
glab ci trigger deploy-production
# Cancel running pipeline or job
glab ci cancel pipeline
glab ci cancel job 224356863
Artifacts
# Download artifacts (use glab job artifact)
glab job artifact main build
glab job artifact main build --path="./artifacts/"
Project Operations
# Clone with glab
glab repo clone owner/repo
# Fork a project
glab repo fork owner/repo
# View project in browser
glab repo view --web
# List project members
glab api projects/:id/members
Tips
- Use
--webor-wflag to open result in browser - Use
glab alias setto create shortcuts - Environment variable
GITLAB_TOKENfor CI/CD auth - Use
glab apifor any GitLab API endpoint not covered by commands
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
commit
This skill should be used when the user asks to "commit changes", "push my code", "commit and push", "save my work", or wants to stage all changes and push to remote.
prime-feat
This skill should be used when the user asks to "load feature context", "resume feature work", "prime feature N", "continue feature N", or wants to load all planning artifacts for a specific feature number.
implement-agents
This skill should be used when the user asks to "implement in parallel", "run phases concurrently", "parallel implement", "implement-agents phase X phase Y", or wants to orchestrate multiple agents running /implement simultaneously.
code-walkthrough
Generate structured, hallucination-proof code walkthroughs using Showboat. Use when the user asks to "walk me through this code", "explain this codebase", "create a walkthrough", "document how this works", "give me a tour of this repo", or wants a readable narrative document that explains code with real verified snippets. Also triggers on "showboat", "linear walkthrough", or "code documentation". Not for quick code questions — this produces a full markdown document.
ainotes
This skill should be used when the user asks to "consolidate notes", "summarize ainotes", "clean up notes", "ainotes", or wants to consolidate accumulated agent observations into a compact summary.
implement
This skill should be used when the user asks to "implement phase N", "implement task T001", "do TDD for phase", "implement T001-T009", or wants to execute tasks following strict TDD red-green-refactor workflow.
Didn't find tool you were looking for?