Install
$ agentstack add skill-isamisushi-glab-skill-glab ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ● Network access Used
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
glab CLI
Use glab when the task is about GitLab state, not just local Git state. In a Git worktree, glab can infer host and project context from remotes, so run commands from the relevant repository root when possible.
Start from the official English docs and the installed CLI help, not memory. glab changes over time.
Core Workflow
Every glab task should follow this pattern:
- Confirm repo and auth context.
- Check the source-derived command tree or local help before guessing flags.
- Prefer the highest-level
glabsubcommand that already fits the task. - Fall back to
glab apionly when the CLI does not expose the needed operation or data. - Keep commands non-interactive and scriptable when automation matters.
Workflow
- Confirm repository and auth context.
- Run
git rev-parse --show-toplevelandgit remote -vwhen repo targeting matters. - Run
glab auth statuswhen access, host, or token scope may matter.
- Read references before guessing flags.
- Start with [references/docs-command-tree.md](./references/docs-command-tree.md) for the source-derived command and subcommand tree.
- Use the split usage references when exact
Usagelines or documentedOptionsmatter:
[references/usage/core.md](./references/usage/core.md), [references/usage/mr.md](./references/usage/mr.md), [references/usage/issue.md](./references/usage/issue.md), [references/usage/ci.md](./references/usage/ci.md), [references/usage/release.md](./references/usage/release.md), [references/usage/repo.md](./references/usage/repo.md), [references/usage/misc.md](./references/usage/misc.md).
- Use [references/official-command-map.md](./references/official-command-map.md) as a local CLI snapshot for quick verification.
- Prefer the highest-level
glabcommand that already exists.
- Use
glab mr,glab issue,glab ci,glab release, and similar purpose-built groups first. - Use
glab apionly when the high-level CLI does not expose the operation or response shape you need.
- Verify against local help when precision matters.
- Check
glab --helporglab --help. - If the installed binary differs from docs, state that explicitly instead of improvising.
- Do not invent flags. Check the documented
UsageandOptionsfirst.
- Keep output scriptable.
- Prefer non-interactive flags in automation.
- For API-heavy workflows, prefer
glab api ... --output ndjsonand post-process withjqwhen needed.
Common Requests
- "List my open merge requests."
- "Show the merge request for this branch."
- "Approve MR 123."
- "Add a note to MR 123 saying it needs a rebase."
- "List open issues in this project."
- "Create an issue for this bug."
- "Show the latest failed pipeline."
- "Retry job 12345."
- "Lint the current
.gitlab-ci.yml." - "List releases for this project."
- "Create a release for tag
v1.2.3." - "Use
glab apito fetch project variables." - "Run a GraphQL query against GitLab."
When Not To Use
- Do not use this skill for local-only Git operations that
gitalready handles better. - Do not use this skill when the task does not require GitLab state, metadata, or API access.
- Do not jump to
glab apiif a purpose-builtglabsubcommand already exists.
Essential Commands
# Context
git rev-parse --show-toplevel
git remote -v
glab auth status
# Merge requests
glab mr list
glab mr view
glab mr diff
glab mr create --fill
glab mr approve
glab mr note -m "message"
glab mr merge
# Issues
glab issue list
glab issue view
glab issue create
glab issue update
glab issue note -m "message"
# CI/CD
glab ci status
glab ci list
glab ci get
glab ci lint
glab ci trace
glab ci retry
glab ci trigger
# Releases
glab release list
glab release view
glab release create
glab release upload
# API fallback
glab api projects/:fullpath/releases
glab api graphql -f query='query { currentUser { username } }'
glab api issues --paginate --output ndjson
Common Patterns
Outside Repository Context
When not running inside a Git repository, pass -R/--repo explicitly.
glab mr list -R group/project
glab issue list -R group/project
glab ci list -R group/project
Self-Hosted GitLab
If the target is not gitlab.com, verify auth and host selection before running project commands.
glab auth status
glab auth login --hostname gitlab.example.com
glab mr list -R gitlab.example.com/group/project
Automation and JSON Output
For scripts and automation, prefer non-interactive commands and machine-readable output.
NO_PROMPT=true glab mr list --output json
glab mr list --output json | jq '.[].title'
glab api issues --paginate --output ndjson
API Fallback
Use glab api only when a built-in subcommand does not expose the data or operation you need.
glab api projects/:fullpath/variables
glab api "projects/:id/jobs?per_page=100" --paginate
glab api graphql -f query='query { currentUser { username } }'
Command Selection
Merge requests
- Inspect:
glab mr list,glab mr view,glab mr diff - Create:
glab mr create --fill - Update:
glab mr update - Review:
glab mr approve,glab mr note -m "..." - Integrate:
glab mr merge
Issues
- Inspect:
glab issue list,glab issue view - Create:
glab issue create - Update:
glab issue update - Comment:
glab issue note -m "..."
CI/CD
- Current pipeline:
glab ci status,glab ci view - Enumerate pipelines:
glab ci list - Machine-readable pipeline data:
glab ci get - Validate config:
glab ci lint - Logs:
glab ci trace - Retry or trigger:
glab ci retry,glab ci trigger
Releases
- Inspect:
glab release list,glab release view - Create or update:
glab release create - Assets:
glab release upload,glab release download
Generic API access
Use glab api when:
- the high-level command is missing
- you need fields the built-in command does not show
- you need GraphQL
- you need pagination or exact request control
Useful patterns:
- REST:
glab api projects/:fullpath/releases - GraphQL:
glab api graphql -f query='query { currentUser { username } }' - Pagination:
glab api issues --paginate --output ndjson
Repository placeholders such as :fullpath, :repo, and :branch resolve from the current repository context.
Practical Rules
- Prefer running
glabin the target repo root so project and host detection work. - Avoid interactive prompts in scripts; pass flags or environment variables.
- If auth or host selection is unclear, inspect
glab auth statusand consider--hostnameor-R/--repo. - For unsupported workflows, use
glab apiinstead of dropping straight tocurl. - If a command fails, re-check docs and local help before assuming the flag exists.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: isamisushi
- Source: isamisushi/glab-skill
- License: MIT
- Homepage: https://docs.gitlab.com/cli
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.