Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

GitLab CLI

$ glab Official Med Risk
GitLab · Code & DevOps · MIT · macos / linux / windows

GitLab's official command-line client for merge requests, issues, CI/CD pipelines, releases, and REST/GraphQL API calls. Structured -F json flags and non-interactive token auth make it highly effective for coding agents on GitLab.

FCRS-1.0 Score
91 /100
Excellent
Medium Confidence
Zero-Friction Install
brew install glab
CLI vs MCP Decision CLI Preferred vs MCP

Prefer glab over generic GitLab MCP wrappers: glab mr, glab ci, and glab api expose concise JSON payloads without bloating tool schemas.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 22 / 25

Supports -F json on key list/get commands, glab api for full API access, NO_COLOR=1, and headless GITLAB_TOKEN auth.

  • Supports -F json / --output json across core resource commands
  • Includes glab api for direct REST and GraphQL queries
Trust & Safety 21 / 25

Supports scoped GITLAB_TOKEN and --draft / --yes explicit flags, though merge and delete commands lack a universal --dry-run.

  • Scoped GITLAB_TOKEN env var isolation
  • Missing universal --dry-run across remote mutation subcommands
Setup & Portability 15 / 15

Single static Go binary distributed via Homebrew, apt, winget, and GitLab Releases across macOS, Linux, and Windows.

  • Zero runtime dependencies and fast binary startup
Utility & Efficiency 14 / 15

Covers MRs, issues, pipelines, releases, and raw API calls in one cohesive CLI.

  • End-to-end GitLab workflow coverage with glab api fallback
Maintenance & Lineage 10 / 10

First-party official CLI maintained by GitLab under MIT license.

  • Official gitlab-org/cli project
Docs & Verifiability 9 / 10

Well-documented CLI manual in GitLab docs and structured --help output.

  • Official GitLab CLI documentation and subcommand help

Security, Auth & Guardrails

Auth Modes
OAuth Browser Env API Key Config File
Credential Storage

Stores host tokens in ~/.config/glab-cli/config.yml and accepts GITLAB_TOKEN / GITLAB_HOST environment variables.

Side Effects
Read-Only Local Write Remote Write Destructive
Cost & Quotas

MIT open-source CLI; subject to GitLab.com or self-managed instance rate limits.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# GitLab CLI (glab) Agent Rules
- Pass `-F json` or use `glab api` for structured reads.
- Always supply `--yes`, `--title`, and `--description` explicitly on `glab mr create` or `glab issue create`.
- Never run `glab mr merge` or `glab repo delete` without explicit user approval.

Agent-Ready Command Recipes

Safe Read-Only Queries

List open merge requests as JSON
glab mr list -F json --per-page 20

Returns structured merge request metadata without terminal table formatting.

Check CI pipeline status
glab ci get -F json

Fetches the current branch pipeline and job statuses in JSON format.

Controlled Writes & Previews

Create a draft merge request non-interactively
glab mr create --draft --yes --title "chore: update pipeline" --description "Automated update"

Passes --draft, --yes, --title, and --description explicitly to avoid interactive prompts and accidental merges.

Strengths for Agents

  • + Structured -F json output and glab api simplify automated MR and pipeline triage.
  • + First-class support for self-hosted instances via GITLAB_HOST and GITLAB_TOKEN.
  • + Single Go binary installs cleanly in local and CI sandboxes.

Caveats & Pitfalls

  • ! Lacks a global --dry-run flag on mutation commands like glab mr merge.
  • ! Not every legacy subcommand supports -F json uniformly, occasionally requiring glab api.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI