licensectl
A lightweight CLI to fetch, store, and apply open-source license templates.
Features
add— fetch a plain-text license from a URL and store it locally (with TLS via rustls, no native-tls/schannel)- Template conversion on import —
[year]/<fullname>-style brackets in fetched text become{{year}}/{{fullname}}placeholders; bracketed text with spaces is confirmed first, then renamed (default: spaces → underscores) list— show registered licenses and which placeholders each one needsinit— generate aLICENSEfile in the current project, filling in placeholders interactivelydelete— remove a license from the registry- Placeholders — templates using
{{var}}are detected and prompted; empty input uses a sensible default when available - Safe defaults —
{{year}}defaults to the current year; name-like placeholders (name,fullname,author,holder,owner,copyright) default togit config user.name - Overwrite protection —
initandaddprompt before replacing existing files; use--forceto skip - Custom output path — write the license anywhere with
-o; an existing directory target resolves to<dir>/LICENSE
Installation
Usage
Add a license to the registry
Only URLs returning plain text are supported (HTML pages won't work). Bracket placeholders in the fetched text, such as [year] or <fullname>, are automatically converted to {{year}} / {{fullname}} templates. Bracketed text containing spaces (e.g. [name of copyright owner]) is confirmed with Is "[...]" a placeholder? [y/N]; if you accept, you can name it — the default replaces spaces with underscores (name_of_copyright_owner).
List registered licenses
MIT (needs: year, fullname)
Apache-2.0
Initialize a project with a license
Placeholders are prompted interactively. Pressing Enter accepts the suggested default shown in brackets:
Value for "year" [2026]:
Value for "fullname" [Jane Doe]: ACME Corp
Write to a custom location or force-overwrite an existing file:
Delete a license
How it works
Licenses are stored as plain text files under the platform config directory:
| OS | Location |
|---|---|
| Windows | %APPDATA%\licensectl\licenses |
| macOS | ~/Library/Application Support/licensectl/licenses |
| Linux | $XDG_CONFIG_HOME/licensectl/licenses (or ~/.config/licensectl/licenses) |
init reads the template, detects {{var}} placeholders, prompts for values, and writes the rendered result to ./LICENSE (or the -o path). License names must contain only letters, digits, ., _, and -.
Development