commit 20a82a663c3a903f5367d8857174796cd3231795 Author: Zhongwei Li Date: Sun Nov 30 08:40:43 2025 +0800 Initial commit diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..99a99a9 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,12 @@ +{ + "name": "gitlab", + "description": "Guidance for using the glab CLI effectively with GitLab", + "version": "1.0.0", + "author": { + "name": "MLL", + "email": "info@mll.com" + }, + "skills": [ + "./skills" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..90cdc1a --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# gitlab + +Guidance for using the glab CLI effectively with GitLab diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..cc232bf --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,45 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:mll-lab/claude-plugin-marketplace:plugins/gitlab", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "3f0661687830d8995d677948f8d75ccd717cece4", + "treeHash": "efc04b63950d8dcc801786ce5d161af429cc5f9d3e34ff01d6742ae0d4e1556c", + "generatedAt": "2025-11-28T10:27:07.668828Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "gitlab", + "description": "Guidance for using the glab CLI effectively with GitLab", + "version": "1.0.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "be53f94523adac73ffde991f08da319a84fbc0708957e30fa7e289df7fa6a8e1" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "9d26c5d161ab281335e2e0401eaf275da5be60b22251336f30656b85e11d8156" + }, + { + "path": "skills/SKILL.md", + "sha256": "7622b9a30f8ce814d6f7c51464296a5ae51660c0f796b3c62d22209a421c16ac" + } + ], + "dirSha256": "efc04b63950d8dcc801786ce5d161af429cc5f9d3e34ff01d6742ae0d4e1556c" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file diff --git a/skills/SKILL.md b/skills/SKILL.md new file mode 100644 index 0000000..c0e3237 --- /dev/null +++ b/skills/SKILL.md @@ -0,0 +1,83 @@ +--- +name: gitlab-ci +description: Use when working with GitLab using the glab CLI tool. Currently provides guidance for CI/CD pipelines including checking pipeline status, viewing job logs, and working with branches and tags. +--- + +# GitLab CI/CD with glab CLI + +## Core Principle + +**Always use `--branch` to specify branches or tags, never use pipeline IDs directly.** + +## Common Workflows + +### 1. Check Pipeline Status + +```bash +# Check current branch +glab ci status + +# Check specific branch or tag +glab ci status --branch= + +# Compact view +glab ci status --compact --branch= +``` + +### 2. Get Pipeline Details + +```bash +# Get pipeline info for a branch/tag +glab ci get --branch= + +# Include job IDs and details +glab ci get --branch= --with-job-details +``` + +### 3. View Job Logs + +```bash +# By job name (recommended when you know the name) +glab ci trace --branch= + +# By job ID (use after getting job IDs from `glab ci get --with-job-details`) +glab ci trace +``` + +**Example workflow:** +```bash +# 1. Check status and see job names +glab ci status --branch=staging + +# 2. Get logs for a specific failed job +glab ci trace check-pending-migrations --branch=staging +``` + +### 4. List Pipelines + +```bash +# List recent pipelines (overview only) +glab ci list + +# Filter by ref (branch/tag) +glab ci list --ref= + +# Filter by status +glab ci list --status=failed +``` + +## Important Notes + +- **NEVER use `glab ci view`** - it only works interactively. Use `glab ci status --live` for monitoring or `glab ci trace` for job logs instead +- Job names and job IDs work with `glab ci trace`, but pipeline IDs do not +- Always specify `--repo` if working with a repository other than the current directory +- Use `--branch` for both branches and tags (the flag name is `--branch` even for tags) + +## Quick Reference + +| Task | Command | +|------|---------| +| Pipeline status | `glab ci status --branch=` | +| Pipeline details | `glab ci get --branch=` | +| Job logs | `glab ci trace [--branch=]` | +| List pipelines | `glab ci list [--ref=]` |