glab-cli
Installation
SKILL.md
GitLab CLI (glab)
Rules
- ALWAYS verify auth before first command:
glab auth status - ALWAYS use
-R owner/repowhen not inside the target git repo - For self-hosted GitLab, set
GITLAB_HOSTin the command environment when this installedglabdoes not support a global--hostnameflag. Checkglab <command> --helpbefore using--hostname; some versions accept--hostnamefor auth but not for MR commands. - Use
--output=jsonwhen parsing output programmatically - NEVER hardcode tokens in commands — use
glab auth loginorGITLAB_TOKENenv var - Pagination params go in URL, not flags:
glab api "projects/:id/jobs?per_page=100"(NOT--per-page) - When creating MRs, ALWAYS add
--remove-source-branch --squash-before-mergeunless the user explicitly says otherwise. - Some
glabversions do not support--hostnameon MR commands. For self-hosted GitLab operations, prefer running inside the target repo with the correct remote, or setGITLAB_HOST=<host>and use-R owner/repo.