← ClaudeAtlas

gitlabapilisted

GitLab REST and GraphQL API access via glab. Use when making API requests, running GraphQL queries or mutations, querying project data, automating GitLab operations, or looking up GitLab feature, API, or CI/CD documentation.
bendrucker/claude · ★ 15 · API & Backend · score 73
Install: claude install-skill bendrucker/claude
# GitLab API REST and GraphQL API access via `glab api`. ## Placeholders Auto-resolve to current project values: - `:fullpath` - Full project path (e.g., `group/project`) - `:id` - Project ID - `:branch` - Current branch - `:user` / `:username` - Current user ```bash glab api projects/:fullpath/merge_requests ``` ## REST ```bash glab api projects/:id/issues # GET glab api projects/:id/issues -X POST -f title="..." # POST with field glab api projects/:id/issues --paginate # All pages ``` #### No `--jq`/`-q` Output filtering flags belong to `gh api`. Pipe to `jq` instead: `glab api <endpoint> | jq '<filter>'`. There is also no `--json` flag anywhere in `glab`. Use `--output json`. #### Error Bodies Land on Stdout A 404/4xx response is a JSON error body (`{"message":"404 Not found"}`), so `glab api ... | jq '.field'` turns the real HTTP error into misleading `null` output or a jq type error (`Cannot index string`, `Cannot iterate over object`). When a pipeline misbehaves, rerun the `glab api` call bare and read the body before touching the jq filter. #### Pagination Pitfall `--paginate` concatenates JSON arrays across pages as `][`, producing invalid JSON (e.g., `[{...}][{...}]`). Fix by replacing `][` with `,` before parsing: `.replace(/\]\s*\[/g, ",")`. #### Nested Fields `-f` and `--raw-field` silently drop bracket-nested keys like `position[base_sha]=...`. For nested objects, write JSON to a file and use `--input`: ```