Getting Started
Get from zero to compliant license headers in 3 minutes.
1. Install
Pick the binary for your platform:
- macOS (Apple Silicon)
- macOS (Intel)
- Linux (x64)
- Linux (ARM)
curl -sSL https://github.com/licenseops/licenseops/releases/latest/download/licenseops_darwin_arm64.tar.gz | tar xz
sudo mv lops /usr/local/bin/
curl -sSL https://github.com/licenseops/licenseops/releases/latest/download/licenseops_darwin_amd64.tar.gz | tar xz
sudo mv lops /usr/local/bin/
curl -sSL https://github.com/licenseops/licenseops/releases/latest/download/licenseops_linux_amd64.tar.gz | tar xz
sudo mv lops /usr/local/bin/
curl -sSL https://github.com/licenseops/licenseops/releases/latest/download/licenseops_linux_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
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" .
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 compliance | reuse |
| Full Apache boilerplate in every file | apache-long |
| Full GPL/LGPL/AGPL boilerplate | gpl-long |
| Organization-specific custom headers | custom |
See Header Format Comparison for side-by-side examples.
Next Steps
- Configuration Guide — full config file reference, CLI flags, exclude patterns
- Use Cases — 12 real-world scenarios (Go, Python, Rust, JS/TS, multi-language, and more)
- Supported Languages — all 50+ file types
- Custom Templates — define your own header format