-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Start
Inky Quill edited this page Feb 1, 2026
·
1 revision
This guide will help you get started with GitLab CI Lint in just a few minutes.
git clone https://github.com/InkyQuill/gitlab-ci-lint.git
cd gitlab-ci-lint
make installDownload the latest binary from the releases page and add it to your PATH.
The easiest way to configure gitlab-ci-lint is using the interactive setup wizard:
gitlab-ci-lint setupThe wizard will guide you through:
- GitLab instance URL (default: https://gitlab.com)
- Personal access token configuration
- Default project (optional)
- Output preferences
The configuration is saved to ~/.tools-config/.gitlab-ci-lint/config.yaml.
Alternatively, you can configure manually or use command-line flags.
Create ~/.tools-config/.gitlab-ci-lint/config.yaml:
gitlab:
instance: "https://gitlab.com"
timeout: 30s
auth:
token: "glpat-your-token-here"
validation:
skip_api: false
strict: true
project: ""
output:
format: "text"
verbose: false
color: "auto"export GCL_TOKEN="glpat-your-token-here"
export GCL_INSTANCE="https://gitlab.com"
export GCL_OUTPUT_FORMAT="json"gitlab-ci-lint --token glpat-your-token --instance https://gitlab.com .gitlab-ci.yml- Go to GitLab → User Settings → Access Tokens
- Create a new token with
read_apiscope - Copy the token (starts with
glpat-)
gitlab-ci-lint .gitlab-ci.ymlgitlab-ci-lint --skip-api .gitlab-ci.yml# Text (default, human-readable)
gitlab-ci-lint .gitlab-ci.yml
# JSON (for scripting)
gitlab-ci-lint --output json .gitlab-ci.yml
# YAML
gitlab-ci-lint --output yaml .gitlab-ci.ymlFor projects with job references or variables:
gitlab-ci-lint --project group/project .gitlab-ci.yml
# or
gitlab-ci-lint --project 123 .gitlab-ci.yml✓ Local validation passed
✓ API validation passed
Configuration .gitlab-ci.yml is valid
✗ Local validation failed
Error: invalid YAML syntax
Line: 15
Column: 3
Content: script: echo "test
Missing closing quote
gitlab-ci-lint --verbose .gitlab-ci.yml✓ Local validation passed
⚠ API validation passed with warnings
Warning: Deprecated image 'ruby:2.5' (line 8)
Warning: Job 'test' has no stage specified (line 12)
-
0: All validations passed -
1: Runtime error (file not found, auth failed, etc.) -
10: CI configuration is invalid
Use in CI/CD:
#!/bin/bash
gitlab-ci-lint .gitlab-ci.yml
case $? in
0) echo "✓ Valid CI config" ;;
1) echo "✗ Runtime error"; exit 1 ;;
10) echo "✗ Invalid CI config"; exit 1 ;;
esacgitlab-ci-lint setup
# When prompted, enter: https://gitlab.example.comOr manually:
export GCL_INSTANCE="https://gitlab.example.com"
export GCL_TOKEN="glpat-your-token"
gitlab-ci-lint .gitlab-ci.yml- Read Troubleshooting Guide for common issues
- See Basic Usage for more features
- Check CI/CD Integration for pipeline usage
- Contribute! See Contributing Guide
gitlab-ci-lint --help
gitlab-ci-lint versionFor more information, visit: