# Glab

> Use this skill when the user asks to work with GitLab from the terminal, especially with `glab`: merge requests, issues, pipelines, releases, project metadata, or GitLab API calls. Prefer it when a local checkout is already connected to GitLab and `glab` is a better fit than manual browser work or raw `curl`.

- **Type:** Skill
- **Install:** `agentstack add skill-isamisushi-glab-skill-glab`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [isamisushi](https://agentstack.voostack.com/s/isamisushi)
- **Installs:** 0
- **Category:** [Developer Tools](https://agentstack.voostack.com/c/developer-tools)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [isamisushi](https://github.com/isamisushi)
- **Source:** https://github.com/isamisushi/glab-skill/tree/main/skills/glab
- **Website:** https://docs.gitlab.com/cli

## Install

```sh
agentstack add skill-isamisushi-glab-skill-glab
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## 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:

1. Confirm repo and auth context.
2. Check the source-derived command tree or local help before guessing flags.
3. Prefer the highest-level `glab` subcommand that already fits the task.
4. Fall back to `glab api` only when the CLI does not expose the needed operation or data.
5. Keep commands non-interactive and scriptable when automation matters.

## Workflow

1. Confirm repository and auth context.
   - Run `git rev-parse --show-toplevel` and `git remote -v` when repo targeting matters.
   - Run `glab auth status` when access, host, or token scope may matter.

2. 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 `Usage` lines or documented `Options` matter:
     [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.

3. Prefer the highest-level `glab` command that already exists.
   - Use `glab mr`, `glab issue`, `glab ci`, `glab release`, and similar purpose-built groups first.
   - Use `glab api` only when the high-level CLI does not expose the operation or response shape you need.

4. Verify against local help when precision matters.
   - Check `glab  --help` or `glab   --help`.
   - If the installed binary differs from docs, state that explicitly instead of improvising.
   - Do not invent flags. Check the documented `Usage` and `Options` first.

5. Keep output scriptable.
   - Prefer non-interactive flags in automation.
   - For API-heavy workflows, prefer `glab api ... --output ndjson` and post-process with `jq` when 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 api` to fetch project variables."
- "Run a GraphQL query against GitLab."

## When Not To Use

- Do not use this skill for local-only Git operations that `git` already handles better.
- Do not use this skill when the task does not require GitLab state, metadata, or API access.
- Do not jump to `glab api` if a purpose-built `glab` subcommand already exists.

## Essential Commands

```bash
# 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.

```bash
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.

```bash
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.

```bash
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.

```bash
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 `glab` in 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 status` and consider `--hostname` or `-R/--repo`.
- For unsupported workflows, use `glab api` instead of dropping straight to `curl`.
- 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](https://github.com/isamisushi)
- **Source:** [isamisushi/glab-skill](https://github.com/isamisushi/glab-skill)
- **License:** MIT
- **Homepage:** https://docs.gitlab.com/cli

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-isamisushi-glab-skill-glab
- Seller: https://agentstack.voostack.com/s/isamisushi
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
