jlic
A LICENSE file generator for open source projects. Seven popular license texts are embedded in the binary; the copyright holder and year are filled in automatically from your git config.
Successor to the srekit license command, split out into a standalone tool.
$ cd ~/projects/new-thing
$ jlic
MIT → LICENSE
Installation
# Homebrew
# Cargo
# From source
&& &&
Quick start
An existing file is never overwritten without --force, so an accidental jlic in someone else's repository cannot clobber the license already chosen there.
Supported licenses
| SPDX | Aliases | Substitution |
|---|---|---|
MIT (default) |
mit |
year, holder |
Apache-2.0 |
apache, apache2, asl2 |
year, holder |
GPL-3.0-or-later |
gpl, gpl3, gplv3, gpl-3.0 |
— |
BSD-3-Clause |
bsd, bsd3 |
year, holder |
MPL-2.0 |
mpl, mpl2 |
— |
ISC |
isc |
year, holder |
WTFPL |
wtfpl, wtf |
year, holder |
The GPL-3.0 and MPL-2.0 texts are immutable: no copyright is written into them, it belongs in source file headers instead. That is what notice is for:
$ jlic notice gpl-3.0-or-later
Copyright (C) 2026 Mikhail Savin <jtprogru@gmail.com>
This program is free software: you can redistribute it and/or modify
...
SPDX-License-Identifier: GPL-3.0-or-later
Passing --name to a license that does not accept one prints a warning to stderr and still generates the file.
Where the name, email and year come from
Each value is looked up along a chain, first non-empty wins:
| Value | Priority |
|---|---|
| Name | --name → JLIC_NAME → git config user.name |
--email → JLIC_EMAIL → git config user.email |
|
| Year | --year → the system's current year |
The email is rendered into the copyright line as Name <email> and can be suppressed with --no-email. The year accepts both a single value (2026) and a range (2020-2026).
If the name cannot be determined and the license requires one, jlic exits with an error and writes no file.
Commands
| Command | What it does |
|---|---|
jlic [LICENSE] |
same as jlic new |
jlic new [LICENSE] |
create a license file |
jlic list [--json] |
list licenses, for humans or for scripts |
jlic show LICENSE |
the raw template with placeholders |
jlic notice [LICENSE] |
copyright block for a source file header |
jlic completions SHELL |
completions for bash, zsh, fish, elvish, powershell |
jlic man |
man page in roff format |
Using it as a library
use ;
let ctx = Context ;
let text = render_license?;
You do not have to build the context by hand either: Context::resolve(None, None, None) pulls the values from the environment and git config.
Development
Templates come from choosealicense.com, the same source GitHub's license picker uses. Reference texts from SPDX live in assets/spdx/ and are used only by the test suite: templates_match_spdx_reference_text compares every template against its reference, normalizing line wrapping and typography. An edit that changes the meaning of a license therefore fails CI.
After make update-templates, always run make test and review git diff assets/.
Releases
Tagging vX.Y.Z triggers .github/workflows/release.yml, which builds four targets (aarch64/x86_64 × macOS/Linux), publishes a GitHub Release with .tar.gz archives and their .sha256 sums, updates Formula/jlic.rb in jtprogru/homebrew-tap, and publishes the crate to crates.io. Tags containing a hyphen (v1.0.0-rc1) are marked as pre-releases and skipped for the tap.
Two repository secrets are required: HOMEBREW_TAP_TOKEN (a PAT with write access to the tap) and CARGO_REGISTRY_TOKEN.
License
MIT — see LICENSE. The file was generated by jlic itself.