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:

  1. glab subcommand — MR create/close/ready/list, issue, repo. Try first.
  2. glab api — single GET/POST/PUT/DELETE. Add -H "Content-Type: application/json" whenever a body is sent.
  3. Raw curl — when glab api PUT/POST persistently 500/400s on the same call. Not limited to the discussion-resolve case: any endpoint that keeps failing gets the curl fallback (-o to file, then parse — rtk eats stdout). Token: $(glab config get token --host <host>); always -o to a file (rtk intercepts stdout curl).
  4. 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:

Installs
2
Repository
peachest/skills
First Seen
9 days ago