glab-api
Installation
SKILL.md
glab-api cookbook
Decision table + worked-around quirks for driving GitLab via the glab CLI and its REST API. Reach for this whenever you need to query or mutate GitLab (gitlab.blue.example / gitlab.red.example or any instance in ~/.config/glab-cli/config.yml) — instead of re-deriving commands or hand-writing request code each run.
Decision ladder
Climb only as high as needed:
glabsubcommand — MR create/close/ready/list, issue, repo. Try first.glab api— single GET/POST/PUT/DELETE. Add-H "Content-Type: application/json"whenever a body is sent.- Raw
curl— whenglab apiPUT/POST persistently 500/400s on the same call. Not limited to the discussion-resolve case: any endpoint that keeps failing gets the curl fallback (-oto file, then parse — rtk eats stdout). Token:$(glab config get token --host <host>); always-oto a file (rtk intercepts stdout curl). - Python + urllib — only for: retry loops, multi-step orchestration, JSON transformation, concurrency. Use the helper at the bottom.
Instance selection
Two hosts are configured (~/.config/glab-cli/config.yml). Outside a repo clone, always pass the host explicitly: