lacspace-license

Generate, header & audit your project's licence.

● Live · v0.1.0npmSource
terminal
npx lacspace-license init MIT
What it does

Everything, in one command

Most projects get their licensing right once and then let it rot — the year in the header ages, a new file ships with no notice, package.json says MIT while the LICENSE file says something else. lacspace-license makes licence hygiene a one-command, CI-enforceable step. It embeds the full canonical texts of 12 common licences (plus the Lacspace Free Licence), fills your name and year, understands the comment syntax of 60+ file types, and never corrupts a file — headers are idempotent, shebang-safe and preserve your line endings. It runs entirely on local files with no network and no telemetry.

Features

What's inside

LICENSE generator

Filled from any SPDX id, author/year read from package.json.

Per-file headers

Correct //, #, --, /* */, <!-- --> syntax per language.

Idempotent & safe

Re-runs are no-ops; shebang, EOL and final newline preserved.

THIRD-PARTY-NOTICES

Grouped-by-licence md/txt from node_modules, --prod aware.

CI gate

check fails when LICENSE is missing, mismatched, or a header is absent.

Fuzzy detection

Identifies a LICENSE text tolerant of CRLF/whitespace.

Zero deps, offline

Full licence texts embedded; nothing leaves your machine.

How to use

Copy, paste, done

Real commands and snippets — from a one-liner to the typed library.

Create a LICENSE
terminal
npx lacspace-license init MIT --author "Lacspace" --year 2026

Author/year auto-read from package.json when omitted.

Stamp headers
terminal
npx lacspace-license add "src/**/*.{ts,js}" --id MIT --write

Idempotent — running twice changes nothing.

Preview a diff
terminal
npx lacspace-license add "src/**/*.ts" --dry-run

See what would change before writing.

Third-party notices
terminal
npx lacspace-license notices --prod -o THIRD-PARTY-NOTICES.md

Grouped by licence, prod deps only.

CI gate
terminal
npx lacspace-license check --require-headers

Exits non-zero on any violation.

Good for

What people build with it

Ship a correct LICENSE in seconds

Enforce licence headers across a monorepo in CI

Keep copyright years current

Produce attribution/notices for a release

Start now

Run lacspace-license today

Free, open-source, no API keys. It's a CLI and a typed library.

terminal
npx lacspace-license init MIT