Skip to main content
Version: Next

Getting Started

Get from zero to compliant license headers in 3 minutes.

1. Install

Pick the binary for your platform:

curl -sSL https://github.com/licenseops/licenseops/releases/latest/download/licenseops_darwin_arm64.tar.gz | tar xz
sudo mv lops /usr/local/bin/

Or use one of the alternative install methods:

# Go install
go install github.com/licenseops/licenseops/cmd/lops@latest

# Docker (no install needed)
docker run --rm -v "$PWD":/src -w /src ghcr.io/licenseops/licenseops:latest check

Verify it works:

lops --help

2. Check Your Project

Run a one-liner to see which files are missing headers:

lops check -l Apache-2.0 -o "Your Name" .
  • -l — the SPDX license identifier
  • -o — the copyright holder
  • . — scan the current directory
tip

Use -v (verbose) to see every file's status, not just failures.

If all files are compliant, you'll see exit code 0. If any are missing headers, you'll see which ones and exit code 1.

3. Fix Headers Automatically

Add headers to all files that need them:

lops fix -l Apache-2.0 -o "Your Name" .
note

fix preserves shebangs (#!/...), Python encoding declarations, and skips generated files and binaries automatically.

4. Create a Config File

For team-wide consistency, commit a .licenseops.yaml to your repo:

license: Apache-2.0
copyright-holder: 'Your Name or Organization'

exclude:
- 'vendor/**'
- 'node_modules/**'
- '**/dist/**'

Now you can run without flags:

lops check
lops fix

5. Add to CI

Add a license check to your GitHub Actions pipeline:

- name: Install lops
run: |
curl -sSL https://github.com/licenseops/licenseops/releases/latest/download/licenseops_linux_amd64.tar.gz | tar xz
sudo mv lops /usr/local/bin/

- name: Check license headers
run: lops check

See the CI Integration Guide for GitLab CI, pre-commit hooks, Docker, and auto-fix workflows.

Choose Your Format

Not sure which header format to use? Here's a quick decision guide:

If you want...Use format
Short, machine-readable headers (recommended)spdx (default)
FSFE REUSE compliancereuse
Full Apache boilerplate in every fileapache-long
Full GPL/LGPL/AGPL boilerplategpl-long
Organization-specific custom headerscustom

See Header Format Comparison for side-by-side examples.

Next Steps