Create a LICENSE file.
- CLI (bash)
- Support licenses: 12
- Output
LICENSE
file to current directory - Output Standard license headers to
stdout
- Detect license: licensee
Group | License |
---|---|
copyleft | AGPL (+ ), GPL (+), LGPL (+), CC-BY-SA-4.0 |
permissive | Apache-2.0 , MIT , BSD (2,3,3-clear), CC-BY-4.0 |
public-domain | CC0 , Unlicense |
- Not support:
- Source: SPDX v3.7 2019-10-22
Approval
type | FSF | OSI | License |
---|---|---|---|
copyleft | ○ | ○ | AGPL |
copyleft | ○ | ○ | GPL |
copyleft | ○ | ○ | LGPL |
copyleft | ○ | ☓ | CC-BY-SA-4.0 |
permissive | ○ | ○ | Apache-2.0 |
permissive | ○ | ○ | MIT |
permissive | ☓ | ○ | BSD-2-Clause |
permissive | ○ | ○ | BSD-3-Clause |
permissive | ○ | ☓ | BSD-3-Clause-Clear |
permissive | ○ | ☓ | CC-BY-4.0 |
public-domain | ○ | ☓ | CC0-1.0 |
public-domain | ○ | ☓ | Unlicense |
- 2020-01-26
- Raspbierry Pi 4 Model B Rev 1.2
- Raspbian buster 10.0 2019-09-26 setup
- bash 5.0.3(1)-release
$ uname -a
Linux raspberrypi 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux
sudo apt install -y jq
sudo apt install -y ruby bundler cmake pkg-config git libssl-dev
sudo gem install licensee
git clone https://github.com/ytyaru/lish
cd lish/src
ln -s ./lish.sh /usr/bin/lish
lish -h
Licenses can be specified by alias.
lish p # public-domain CC0-1.0
lish l # copyleft AGPL-3.0
lish c # copycenter Apache-2.0
Output LICENSE
file to the current directory.
Add license ID to file name suffix.
lish -i GPL
The output file name will be LICENSE-GPL-3.0-only
.
MIT
and BSD
require author names.
lish -a AuthorName MIT
If there is a ./git/config
file, use the value of git config --local user.name
.
Optionally, you can specify the year of copyright issuance.
lish -a A -y 1999 MIT
If not specified, use the runtime year.
lish select
1) CC0 3) AGPL 5) LGPL 7) CC-BY-SA 9) MIT 11) BSD-3
2) Unlicense 4) GPL 6) CC-BY 8) Apache 10) BSD-2 12) BSD-3-Clear
MIT
and BSD
prompt for the author name.
Author name:
Returns the license type ID from the LICENSE
file using licensee.
lish detect
If there are multiple licenses, change the LICENSE
file name and output it to detect it.
$ lish -i l
$ lish -i c
$ lish detect
Apache-2.0
GPL-3.0
The target is GPL
, AGPL
,CC0
,Apache
. headers. Source is SPDX v3.7 2019-10-22
lish -s GPL
Output to stdout.
lish -s -r 'My Repo' GPL
For example, GPL
is as follows.
{{REPO_NAME}}
Copyright (C) {{YEAR}} {{AUTHOR}}
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
template | value |
---|---|
{{REPO_NAME}} |
-r option value. Or Current directory name |
{{YEAR}} |
-y option value. Or run-time year |
{{AUTHOR}} |
-a option value. Or git config --local user.name |
On Linux, use the fold
command to wrap lines in words other than 80 characters.
cat ./res/headers/gpl-3.0-only.txt | fold -s -w 80
{{REPO_NAME}}
Copyright (C) {{YEAR}} {{AUTHOR}}
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, version 3.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <https://www.gnu.org/licenses/>.
Line wrapping is not required for the standard license header of Apache-2.0. The line had already been wrapped.
cat ./res/headers/gpl-3.0-only.txt | sed -e 's/^/ /g'
- Some template file contents are duplicated
AGPL
,GPL
,LGPL
-only
,-or-later
- Just in case for future changes.
ytyaru
This software is CC0 licensed.