Check & Fix
Validate that all source files have compliant license headers, or auto-add and replace them in-place with a single command.
$ lops check -l Apache-2.0 -o "Acme Corp" .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.
Validate that all source files have compliant license headers, or auto-add and replace them in-place with a single command.
SPDX short (1-line and 2-line), REUSE, Apache 2.0 boilerplate, GPL/LGPL/AGPL boilerplate, and custom Go templates.
Correct comment syntax for Go, Rust, Python, JavaScript/TypeScript, Java, C/C++, Shell, YAML, CSS, HTML, SQL, and many more.
Full SPDX expression support including AND, OR, WITH operators. Dual-license with "Apache-2.0 OR MIT" or add exceptions.
Preserves shebangs and Python encoding declarations. Skips generated files and binaries automatically.
Respects .gitignore patterns automatically. No need to duplicate exclusion rules in your license config.
Switch from one header format to another without manual cleanup. Old headers are fully detected, stripped, and replaced.
Clean exit codes, --dry-run mode, Docker image, and GitHub Actions compatible. Fail fast in your pipeline.
Works with just CLI flags — no config file needed. Or commit .licenseops.yaml for team-wide consistency.
Choose from 5 built-in formats or define your own with custom templates. Migrate between formats automatically.
spdx// Copyright 2026 Acme Corp
// SPDX-License-Identifier: Apache-2.0Default choice. Clean, machine-readable, and widely recognized by compliance tools.
spdx (no owner)// SPDX-License-Identifier: MITMinimal one-line header without per-file copyright. Used by the Linux kernel.
reuse// SPDX-FileCopyrightText: 2026 Acme Corp
// SPDX-License-Identifier: Apache-2.0FSFE REUSE specification compliant. Machine-readable copyright with standard tags.
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-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// Copyright (c) {{.Year}} {{.Holder}}
// Licensed under {{.License}}User-defined Go templates for organization-specific headers.
Install in seconds, configure once, and enforce license compliance everywhere.
Install the lops binary and start checking headers.
Run lops in a container with zero setup.
LicenseOps auto-detects the correct comment syntax for each file type. No configuration needed — it just works.
| Comment Style | Languages |
|---|---|
// | 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 |
Preserves shebangs, Python encoding declarations, and skips generated files automatically.
Binary files, images, fonts, lock files, and minified assets are skipped by default.
Respects your .gitignore patterns — no need to duplicate exclusion rules.
LicenseOps is open-source and Apache-2.0 licensed. We'd love your contributions.
Help shape LicenseOps by submitting features, fixes, or improvements.
Found a bug or have an idea? Open an issue and let us know.
Ask questions, share use cases, and connect with other users.