odyssey4me

gitlab

0
0
# Install this skill:
npx skills add odyssey4me/agent-skills --skill "gitlab"

Install specific skill from multi-skill repository

# Description

Work with GitLab issues, merge requests, pipelines, and repositories using the glab CLI. Use when managing GitLab projects.

# SKILL.md


name: gitlab
description: Work with GitLab issues, merge requests, pipelines, and repositories using the glab CLI. Use when managing GitLab projects.
metadata:
author: odyssey4me
version: "0.1.0"
license: MIT


GitLab Skill

This skill provides guidance for working with GitLab using the official glab CLI tool. All GitLab operations (issues, merge requests, pipelines, repositories) are performed using glab commands.

Prerequisites

Install glab CLI: https://gitlab.com/gitlab-org/cli#installation

Quick install:

# macOS
brew install glab

# Linux (Debian/Ubuntu)
sudo apt install glab

# Fedora/RHEL/CentOS
sudo dnf install glab

# Windows
winget install GLab.GLab

Authentication

# Authenticate with GitLab
glab auth login

# Verify authentication
glab auth status

Supports GitLab.com, GitLab Dedicated, and GitLab Self-Managed instances.
See GitLab CLI Authentication for details.

Commands

Issues

glab issue list                    # List issues
glab issue view 123                # View issue details
glab issue create                  # Create new issue
glab issue note 123                # Add comment
glab issue close 123               # Close issue
glab issue update 123 --label bug  # Edit issue

Full reference: glab issue

Merge Requests

glab mr list                       # List merge requests
glab mr view 456                   # View MR details
glab mr create                     # Create new MR
glab mr approve 456                # Approve MR
glab mr merge 456                  # Merge MR
glab mr checkout 456               # Checkout MR branch
glab mr diff 456                   # View MR diff
glab mr note 456                   # Add comment to MR

Full reference: glab mr

Pipelines & CI/CD

glab ci list                       # List pipelines
glab ci view 123456                # View pipeline details
glab ci run                        # Trigger pipeline
glab ci trace                      # Watch pipeline logs
glab ci retry 123456               # Retry failed pipeline
glab ci status                     # Show pipeline status

Full references:
- glab ci
- glab pipeline

Repositories

glab repo list                     # List repositories
glab repo view GROUP/REPO          # View repository
glab repo create                   # Create repository
glab repo clone GROUP/REPO         # Clone repository
glab repo fork GROUP/REPO          # Fork repository

Full reference: glab repo

Releases

glab release list                  # List releases
glab release view v1.0.0           # View release details
glab release create v1.0.0         # Create release
glab release delete v1.0.0         # Delete release

Full reference: glab release

Examples

Daily MR Review

# List MRs assigned to you
glab mr list --assignee=@me

# Review a specific MR
glab mr view 456
glab mr diff 456
glab mr approve 456
# Create issue
glab issue create --title "Bug: Login fails" --description "Description" --label bug

# Create MR that closes it
glab mr create --title "Fix login bug" --description "Closes #123"

Monitor CI Pipeline

# Check current pipeline status
glab ci status

# Watch pipeline logs in real-time
glab ci trace

# Retry failed jobs
glab ci retry

See common-workflows.md for more examples.

Advanced Usage

JSON Output for Scripting

# Get JSON output
glab issue list --output json

# Process with jq
glab mr list --output json | jq '.[] | "\(.iid): \(.title)"'

GitLab API Access

For operations not covered by glab commands:

# Make authenticated API request
glab api projects/:id/issues

# POST request
glab api projects/:id/issues -X POST -f title="Issue" -f description="Text"

# Process response
glab api projects/:id | jq '.star_count'

Full reference: glab api

Aliases for Frequent Operations

# Create shortcuts
glab alias set mrs 'mr list --assignee=@me'
glab alias set issues 'issue list --assignee=@me'
glab alias set pipelines 'ci list'

# Use them
glab mrs
glab issues
glab pipelines

Configuration

# View configuration
glab config get

# Set default editor
glab config set editor vim

# Set default Git protocol
glab config set git_protocol ssh

Configuration stored in ~/.config/glab-cli/config.yml

Troubleshooting

# Check authentication
glab auth status

# Re-authenticate
glab auth login

# Enable debug logging
DEBUG=1 glab issue list

# Check glab version
glab version

Official Documentation

Summary

The GitLab skill uses the official glab CLI exclusively. No custom scripts are needed - glab provides comprehensive functionality for all GitLab operations.

Quick start:
1. Install: brew install glab (or equivalent for your OS)
2. Authenticate: glab auth login
3. Verify: glab auth status
4. Use: glab issue list, glab mr create, etc.

For detailed command reference, use glab <command> --help or visit https://docs.gitlab.com/cli/.

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.