Get the FREE Ultimate OpenClaw Setup Guide →

gitlab-ci

npx machina-cli add skill grandcamel/GitLab-Assistant-Skills/gitlab-ci --openclaw
Files (1)
SKILL.md
7.5 KB

CI/CD Pipeline Skill

CI/CD pipeline operations for GitLab using the glab CLI.

Quick Reference

OperationCommandRisk
View statusglab ci status-
View pipelineglab ci view-
List pipelinesglab ci list-
Run pipelineglab ci run⚠️
Get pipeline JSONglab ci get-
Retry jobglab ci retry <job-id>⚠️
Trace jobglab ci trace <job-id>-
Download artifactsglab ci artifact-
Lint CI configglab ci lint-
Delete pipelineglab ci delete <id>⚠️⚠️

Risk Legend: - Safe | ⚠️ Caution | ⚠️⚠️ Warning | ⚠️⚠️⚠️ Danger

When to Use This Skill

ALWAYS use when:

  • User wants to check pipeline/build status
  • User mentions "CI", "CD", "pipeline", "build", "job", "deploy"
  • User wants to trigger or retry builds
  • User wants to view job logs

NEVER use when:

  • User wants to manage CI/CD variables (use gitlab-variable instead)
  • User wants to manage schedules (use gitlab-schedule skill)

Available Commands

View Pipeline Status

glab ci status [options]

Options:

FlagDescription
-b, --branch=<branch>Check status for specific branch
-l, --liveShow status in real-time (updates automatically)
-c, --compactShow compact view

Examples:

# View current branch pipeline status
glab ci status

# View status for specific branch
glab ci status --branch=main

# Watch status live (updates in real-time)
glab ci status --live

# Compact view
glab ci status --compact

Interactive Pipeline View

glab ci view [options]

Options:

FlagDescription
-b, --branch=<branch>View pipeline for specific branch/tag
-p, --pipeline-id=<id>View specific pipeline by ID
-w, --webOpen pipeline in browser

Keyboard shortcuts in view mode:

KeyAction
Esc or qClose logs or return to pipeline
Ctrl+R or Ctrl+PRun, retry, or play a job
Tab / Arrow keysNavigate
EnterConfirm selection
Ctrl+DCancel job / Quit view

Examples:

# Interactive view for current branch
glab ci view

# View specific branch pipeline
glab ci view --branch=feature/new

# View specific pipeline ID
glab ci view --pipeline-id=12345

# Open in browser
glab ci view --web

List Pipelines

glab ci list [options]

Options:

FlagDescription
-b, --branch=<branch>Filter by branch
--status=<status>Filter by status: running, pending, success, failed, canceled, skipped
--allList all pipelines (not just default page)
-P, --per-page=<n>Items per page

Examples:

# List recent pipelines
glab ci list

# List pipelines for branch
glab ci list --branch=main

# List failed pipelines
glab ci list --status=failed

# List all running pipelines
glab ci list --status=running --all

Run/Trigger Pipeline

glab ci run [options]

Options:

FlagDescription
-b, --branch=<ref>Branch or tag to run pipeline on
--variables=<vars>CI variables as key=value pairs (comma-separated)

Examples:

# Run pipeline for current branch
glab ci run

# Run pipeline for specific branch
glab ci run --branch=main

# Run with CI variables
glab ci run --variables="DEPLOY_ENV=staging,DEBUG=true"

# Run for a tag
glab ci run --branch=v1.2.3

Get Pipeline JSON

glab ci get [options]

Get JSON representation of a pipeline.

Options:

FlagDescription
-b, --branch=<branch>Get pipeline for specific branch
-p, --pipeline-id=<id>Get specific pipeline by ID

Examples:

# Get current branch pipeline
glab ci get

# Get specific pipeline
glab ci get --pipeline-id=12345

# Pipe to jq for processing
glab ci get | jq '.status'

Retry Job

glab ci retry <job-id>

Retry a failed CI job.

Examples:

# Retry specific job
glab ci retry 456789

Trace Job Logs

glab ci trace <job-id> [options]

View job logs in real-time.

Examples:

# Trace job output
glab ci trace 456789

Download Artifacts

glab ci artifact [options]

Download artifacts from the last pipeline.

Options:

FlagDescription
-b, --branch=<branch>Download from specific branch
-j, --job=<job-name>Download from specific job
-p, --path=<path>Download to specific path

Examples:

# Download all artifacts from last pipeline
glab ci artifact

# Download from specific job
glab ci artifact --job=build

# Download to specific directory
glab ci artifact --path=./artifacts/

Lint CI Configuration

glab ci lint [file]

Validate .gitlab-ci.yml file.

Examples:

# Lint default .gitlab-ci.yml
glab ci lint

# Lint specific file
glab ci lint path/to/.gitlab-ci.yml

Delete Pipeline

glab ci delete <pipeline-id>

Warning: This permanently deletes the pipeline and its jobs.

Common Workflows

Workflow 1: Check and Fix Failed Pipeline

# 1. Check current status
glab ci status

# 2. View failed pipeline interactively
glab ci view

# 3. Find failed job and view logs (in interactive view)
# Press arrow keys to select job, Enter to view logs

# 4. Retry the failed job
glab ci retry <job-id>

# 5. Watch the retry
glab ci status --live

Workflow 2: Trigger Deployment

# 1. Ensure tests pass
glab ci status --branch=main

# 2. Trigger deployment pipeline with variables
glab ci run --branch=main --variables="DEPLOY_ENV=production"

# 3. Monitor deployment
glab ci status --live

Workflow 3: Debug CI Configuration

# 1. Lint your CI config
glab ci lint

# 2. If valid, run a test pipeline
glab ci run

# 3. Watch the results
glab ci view

Workflow 4: Download Build Artifacts

# 1. Check pipeline succeeded
glab ci status --branch=release

# 2. Download artifacts from build job
glab ci artifact --branch=release --job=build --path=./dist/

Pipeline Status Reference

StatusMeaning
runningPipeline is currently executing
pendingPipeline is waiting to run
successAll jobs passed
failedOne or more jobs failed
canceledPipeline was manually canceled
skippedPipeline was skipped
manualWaiting for manual trigger
scheduledScheduled to run later

Troubleshooting

IssueCauseSolution
Authentication failedInvalid/expired tokenRun glab auth login
Pipeline not foundNo pipeline for branchCheck branch name or run glab ci run
Job stuck pendingNo runners availableCheck runner configuration
Lint failsInvalid YAML syntaxFix syntax errors in .gitlab-ci.yml
Cannot retryJob not in retryable stateWait for current run or cancel first

Related Documentation

Source

git clone https://github.com/grandcamel/GitLab-Assistant-Skills/blob/main/skills/gitlab-ci/SKILL.mdView on GitHub

Overview

Manage GitLab CI/CD pipelines with the glab CLI. This skill covers viewing pipeline status and pipelines, triggering runs, retrying jobs, tracing logs, downloading artifacts, and linting CI configs. It enables fast, scriptable CI control from chat to keep pipelines running smoothly.

How This Skill Works

The skill maps user intent to glab ci commands (status, view, list, run, get, retry, trace, artifact, lint). It uses common flags like --branch, --pipeline-id, --web, and --variables to tailor actions. Results are summarized for quick decision making and can be opened in a browser when --web is used.

When to Use It

  • When you want to check the current pipeline or build status for a branch or project
  • When you need to trigger a new pipeline or re-run an existing one
  • When you want to view or retry specific jobs by ID and inspect logs
  • When you need to trace job logs or download artifacts from a completed pipeline
  • When you want to lint/validate the CI configuration before or after changes

Quick Start

  1. Step 1: Identify the action you need (status, view, list, run, retry, lint)
  2. Step 2: Run the corresponding glab ci command (e.g., glab ci status, glab ci run --branch=main)
  3. Step 3: Refine with flags (--branch, --pipeline-id, --web, --variables) and review output

Best Practices

  • Use glab ci status --live for real-time updates during active deployments
  • Filter views with --branch or --pipeline-id to target the exact pipeline
  • Run with --variables to inject environment-specific values safely
  • Retry only after addressing root causes and use glab ci lint to pre-check CI config
  • Validate CI config with glab ci lint before committing to avoid broken pipelines

Example Use Cases

  • View the current branch pipeline status: glab ci status --branch=main
  • Trigger a pipeline on the main branch: glab ci run --branch=main
  • Retry a failed job by ID: glab ci retry 6789
  • Open a specific pipeline in the browser: glab ci view --pipeline-id=12345 --web
  • Lint the CI configuration before pushing: glab ci lint

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers