بنقرة واحدة
glab-cli
Use glab for GitLab MRs, issues, discussions, pipelines, notes, labels, and raw API tasks.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use glab for GitLab MRs, issues, discussions, pipelines, notes, labels, and raw API tasks.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Shell out to claude CLI.
Run a multi-agent debate to compare options and converge on a decision.
Run the same task with multiple agents for reviews, critiques, or model comparison.
Autonomous large-task delivery agent. Use for long-running coding work that should go from objective or plan to implemented code, review fixes, PR/MR, and green CI with minimal human-in-the-loop gates.
Manage ClickUp tasks.
Generate a project template for Coolify
| name | glab-cli |
| description | Use glab for GitLab MRs, issues, discussions, pipelines, notes, labels, and raw API tasks. |
Use this skill for GitLab-hosted work. Prefer glab over browser workflows or generic web fetching when the task is about repository state.
git remote get-url origingit branch --show-currentglab commandsUse high-level commands first when they cover the task cleanly:
glab mr view, glab mr list, glab mr diff, glab mr note, glab mr create, glab mr updateglab ci list, glab ci status, glab ci trace, glab ci viewPrefer machine-readable output:
--output json when supportedjq and keep only the fields needed for the current taskglab api for gapsUse glab api when a high-level command does not expose the needed operation or fields.
glab api for discussions, MR versions, compare results, detailed diffs, and other unsupported mutationsglab api supports :fullpath as a placeholder for the current repo's URL-encoded path--input - with Content-Type: application/jsonWarning: GitLab discussion and note APIs are paginated. Missing a page means missing review comments. This has caused unresolved MR comments to be falsely reported as resolved.
When inspecting MR/issue comments, discussions, or notes, do not rely on a single default glab api response. Always do one of the following:
per_page value, usually ?per_page=100, when the result set is known to fit in one pageSafe patterns:
glab api 'projects/:fullpath/merge_requests/19/discussions?per_page=100&page=1'
glab api 'projects/:fullpath/merge_requests/19/notes?per_page=100&page=1'
glab api 'projects/:fullpath/merge_requests/19/notes/160554'
Before declaring "no unresolved comments", explicitly filter the complete paged result set for unresolved resolvable discussions:
glab api 'projects/:fullpath/merge_requests/19/discussions?per_page=100&page=1' \
| jq '.[] | select(.resolvable == true and .resolved == false)'
If there may be more than one page, repeat for subsequent pages or use a helper/script that follows X-Next-Page. Never state that all comments are resolved until pagination has been accounted for.
glab api cannot send multipart form data — -F "file=@artifact.zip" does not upload the file (it fails confusingly, e.g. 404 Project Not Found). To attach an image, archive, or other artifact to an MR description or note, use curl against the project uploads endpoint with the token from glab:
# Extract the token into a shell variable WITHOUT printing it.
# Careful: -h means --help in glab; use --hostname. `glab config get token` may return a non-usable blob — use auth status.
TOKEN=$(glab auth status --hostname gitlab.example.com --show-token 2>&1 \
| sed -n 's/.*Token[^:]*: //p' | grep -v '^\*' | head -1 | tr -d '[:space:]')
curl -s -X POST -H "PRIVATE-TOKEN: $TOKEN" --form "file=@artifact.zip" \
"https://gitlab.example.com/api/v4/projects/<group>%2F<repo>/uploads"
The response's markdown field is a ready-to-use project-relative snippet. Images render inline; archives and other files render as attachment links. Add the returned Markdown to the description with glab mr update <iid> --description "$(cat description.md)". Never echo the token into command output.
Always pass explicit flags instead of relying on prompts.
--title, --description, --yes, --output json, --labelmr-context.ts — fetch all MR context in one callWhen a workflow needs the full picture of an MR (metadata + notes + discussions + versions + diff), this bundled wrapper consolidates the five glab calls into one parallel fetch. Use it for reviews, audits, and any flow that would otherwise issue four or more sequential glab calls just to gather context.
bun "${CLAUDE_SKILL_DIR}/mr-context.ts" \
--project shipstream/server \
--mr 2514 \
--out-dir .tmp/mr-2514-context
Writes mr.json, notes.json, discussions.json, versions.json, and diff.patch under --out-dir. If any individual fetch fails, the helper still writes the rest and emits a per-endpoint <name>.stderr file for diagnosis.
For temporary output directories, do not hardcode /tmp/...; Claude Code may run with /tmp mounted read-only. Prefer a project-local .tmp/... path when downstream tools need repo-relative access, or use $TMPDIR/... when the artifact is only for the current shell/session.
stdout is a single JSON summary suitable for jq:
{
"project": "shipstream/server",
"mr": 2514,
"dir": ".tmp/mr-2514-context",
"mr_state": "opened",
"mr_title": "…",
"source_branch": "…",
"target_branch": "main",
"head_sha": "…", "base_sha": "…", "start_sha": "…",
"files": { "mr.json": 1234, "notes.json": 567, "diff.patch": 123456, … },
"errors": { "notes": "Unauthenticated.", … }
}
Exit code is 0 only if every fetch succeeded. The diff is written as raw text, not embedded in the summary, so callers can route on metadata without pulling the full diff into context.
For GitLab CI triage, prefer branch-scoped pipeline inspection first.
glab ci list --per-page 3 --output jsonglab ci status --branch <branch> --liveglab ci trace <job-id> --branch <branch>glab ci view <pipeline-id> when you need pipeline-level context beyond a single job traceDetailed command patterns live in reference.md.
When posting GitLab inline diff comments:
glab apibase, start, and head SHAs from the MR versions API firstposition payload for single-line notesline_range for multi-line notes when needed"type": "DiffNote" in the response```suggestion block, follow the Committable Suggestion Blocks rules — multi-line replacements on a single-line anchor REQUIRE the explicit :-N+M range modifier on the fence, otherwise GitLab applies a broken patchglab reports authentication or repo access errors, surface that clearly instead of guessingglab api projects/:fullpath/... for repo-scoped API calls whenever possible