Skip to main content
LicenseOps LogoLicenseOps Logo

LicenseOps

License headers, automated across 50+ languages

Check, fix, and migrate license headers in CI, pre-commit hooks, or locally

$ lops check -l Apache-2.0 -o "Acme Corp" .

What is LicenseOps?

LicenseOps (lops) is a fast CLI tool for managing license headers across your entire codebase. Built for automation — CI pipelines, pre-commit hooks, and local development workflows.

Check & Fix

Validate that all source files have compliant license headers, or auto-add and replace them in-place with a single command.

Multiple formats

SPDX short (1-line and 2-line), REUSE, Apache 2.0 boilerplate, GPL/LGPL/AGPL boilerplate, and custom Go templates.

50+ languages

Correct comment syntax for Go, Rust, Python, JavaScript/TypeScript, Java, C/C++, Shell, YAML, CSS, HTML, SQL, and many more.

SPDX expressions

Full SPDX expression support including AND, OR, WITH operators. Dual-license with "Apache-2.0 OR MIT" or add exceptions.

Smart file handling

Preserves shebangs and Python encoding declarations. Skips generated files and binaries automatically.

Gitignore-aware

Respects .gitignore patterns automatically. No need to duplicate exclusion rules in your license config.

Cross-format migration

Switch from one header format to another without manual cleanup. Old headers are fully detected, stripped, and replaced.

CI-ready

Clean exit codes, --dry-run mode, Docker image, and GitHub Actions compatible. Fail fast in your pipeline.

Zero config viable

Works with just CLI flags — no config file needed. Or commit .licenseops.yaml for team-wide consistency.

Supported Header Formats

Choose from 5 built-in formats or define your own with custom templates. Migrate between formats automatically.

SPDX (2-line)

spdx
// Copyright 2026 Acme Corp
// SPDX-License-Identifier: Apache-2.0

Default choice. Clean, machine-readable, and widely recognized by compliance tools.

SPDX (1-line)

spdx (no owner)
// SPDX-License-Identifier: MIT

Minimal one-line header without per-file copyright. Used by the Linux kernel.

REUSE

reuse
// SPDX-FileCopyrightText: 2026 Acme Corp
// SPDX-License-Identifier: Apache-2.0

FSFE REUSE specification compliant. Machine-readable copyright with standard tags.

Apache 2.0 Boilerplate

apache-long
// Copyright 2026 Acme Corp
//
// Licensed under the Apache License, Version 2.0
// ...(full 14-line boilerplate)

Full Apache Foundation boilerplate. Legally self-contained in every file.

GPL/LGPL/AGPL

gpl-long
// Copyright 2026 Acme Corp
//
// This program is free software...
// ...(full GNU boilerplate)

FSF-recommended full boilerplate. Auto-selects GPL, LGPL, or AGPL wording.

Custom Template

custom
// Copyright (c) {{.Year}} {{.Holder}}
// Licensed under {{.License}}

User-defined Go templates for organization-specific headers.

Get Started with LicenseOps

Install in seconds, configure once, and enforce license compliance everywhere.

Binary / Go Install

Install the lops binary and start checking headers.

  • Download from GitHub Releases or go install.
  • Create a .licenseops.yaml config or use CLI flags.
  • Run lops check to validate, lops fix to auto-add headers.
Installation Guide

Docker

Run lops in a container with zero setup.

  • No local installation required.
  • Mount your project and run check or fix.
  • Ideal for CI pipelines and reproducible environments.
CI Integration Guide

50+ Languages Supported

LicenseOps auto-detects the correct comment syntax for each file type. No configuration needed — it just works.

Comment StyleLanguages
//Go, Rust, Java, JavaScript, TypeScript, C/C++, C#, Swift, Kotlin, Scala, Dart, Protobuf, Zig
#Python, Ruby, Shell, Perl, YAML, TOML, Terraform, Dockerfile, Makefile, R, Elixir, Nix
--Haskell, Lua, SQL, Ada, Elm
/* */CSS, SCSS, Less
<!-- -->HTML, XML, SVG, Vue

Smart Handling

Preserves shebangs, Python encoding declarations, and skips generated files automatically.

Auto-Skip

Binary files, images, fonts, lock files, and minified assets are skipped by default.

Gitignore-Aware

Respects your .gitignore patterns — no need to duplicate exclusion rules.

Join the Community

LicenseOps is open-source and Apache-2.0 licensed. We'd love your contributions.

Contribute

Help shape LicenseOps by submitting features, fixes, or improvements.

Report Issues

Found a bug or have an idea? Open an issue and let us know.

Discussions

Ask questions, share use cases, and connect with other users.