glab-clilisted
Install: claude install-skill chenwei791129/agent-skills
# GitLab CLI (glab) Integration
Manage GitLab repositories, merge requests, CI/CD, variables, and runners with glab CLI.
## Prerequisites
```bash
glab auth status
```
If authentication fails, see [Authentication Setup](#authentication-setup).
---
## General Rules
1. **Prefer native `glab` commands over `glab api`** — native commands handle URL encoding via `-R <repo>`.
2. **Strip ANSI codes** when analyzing job logs: `| sed 's/\x1b\[[0-9;]*m//g'`
3. **Avoid TUI commands** (`glab ci view`) — crashes in non-interactive environments.
4. **URL encoding**: When using `glab api`, encode `/` as `%2F` in project paths.
5. **JSON output**: Use `--output=json` or `-F json` with `jq` for scripting and automation.
6. **API pagination**: Use `glab api --paginate "endpoint?per_page=100"` to auto-fetch all pages.
7. **Repo context**: glab auto-detects repo from git remote; use `-R owner/repo` when outside a repo directory.
---
## Quick Reference
| Task | Command |
|------|---------|
| Auth status | `glab auth status` |
| Check token expiry | `glab api personal_access_tokens/self \| jq '{name, expires_at}'` |
| Rotate token | `~/.claude/skills/glab-cli/scripts/rotate-gitlab-token --yes` |
| Create repo | `glab repo create <name> --group <group>` |
| Clone repo | `glab repo clone <owner/repo>` |
| Create MR | `glab mr create` |
| List MRs | `glab mr list` |
| View MR | `glab mr view <id>` |
| Add MR comment | `glab mr note <id> -m "comment"` |
| List pipelines | `glab ci list -R <re