Run GitLab CI Pipelines Locally

4.71.0 · active · verified Sun Apr 19

gitlab-ci-local is a Node.js-based command-line interface (CLI) tool designed to execute GitLab CI/CD pipelines directly on a local machine. It aims to eliminate the need for frequent pushes to a remote GitLab server for testing `.gitlab-ci.yml` configurations. The current stable version is 4.71.0, with a rapid release cadence, often seeing multiple patch and minor versions per month addressing fixes and minor features. Its core differentiator is the ability to emulate GitLab's shell and Docker executors, enabling developers to validate their CI logic, environments, and artifacts without committing and pushing, thereby streamlining the development feedback loop and replacing custom dev-specific build scripts.

Common errors

Warnings

Install

Quickstart

Demonstrates global installation, listing available CI jobs, and running a specific job with environment variables.

npm install -g gitlab-ci-local
# Navigate to your GitLab project directory
cd my-gitlab-project
# List all available jobs in your .gitlab-ci.yml
gitlab-ci-local --list

# Run a specific job named 'build-app'
# Ensure Docker is running if using a Docker executor
gitlab-ci-local build-app

# Run with specific environment variables using the new recommended syntax (v4.70.0+)
GCL_VARIABLE_MY_ENV=production gitlab-ci-local deploy

view raw JSON →