~zethra/license

A cli tool to easily add a license to your project
Added more description to readme
Update Cargo.lock

clone

read-only
https://git.sr.ht/~zethra/license
read/write
git@git.sr.ht:~zethra/license

You can also use your local clone with git send-email.

#License

A cli tool to easily add a license to your project.

Usage

license prints out the text of the selected license. All of the license texts and baked into the binary, so it has no external dependencies, nor does it have to fetch them over the network. This has the downside that the user cannot add licenses without recompiling the program. license can also print the headers for licenses the have them.

license with also insert various fields into the license text, such as the project and author's names. It will attempt to derive these from various sources. Failing that the user will be prompted for the missing fields.

Demo

I've also written some scripts that use fzf with license. This is way I use it. Both scripts will pipe the license list into fzf then put the chosen license name is given back license. set-license pipes the text of the selected license into a file called LICENSE in the current directory. copy-header copies the selected license header into the clipboard using xclip. It take the comment string as the first argument.

#Usage

license 1.0.0
A cli tool to easily add a license to your project

USAGE:
    license [FLAGS] <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information
    -v, --verbose    Print addition debugging information

SUBCOMMANDS:
    header    Print the header text for a license
    help      Prints this message or the help of the given subcommand(s)
    list      List available license names
    text      Print the text of a license

#Available Licenses

0BSD
AGPL-3.0-only
AGPL-3.0-or-later
Apache-2.0
Artistic-2.0
BSD-1-Clause
BSD-2-Clause
BSD-3-Clause
CC-BY-1.0
CC-BY-2.0
CC-BY-2.5
CC-BY-3.0
CC-BY-4.0
CC-BY-NC-4.0
CC-BY-NC-ND-4.0
CC-BY-NC-SA-4.0
CC-BY-ND-4.0
CC-BY-SA-4.0
CC-PDDC
CC0-1.0
EUPL-1.2
GPL-2.0-only
GPL-2.0-or-later
GPL-3.0-only
GPL-3.0-or-later
ISC
LGPL-2.0-only
LGPL-2.0-or-later
LGPL-2.1-only
LGPL-3.0-only
LGPL-3.0-or-later
MIT
MPL-1.0
MPL-1.1
MPL-2.0
MPL-2.0-no-copyleft-exception
Unlicense
WTFPL
X11

#Contributing

If you'd like to add I license please add a file named the license's name containing the content of the license. If the license has a header that goes with it also add a file called <license name>-header containing the content of the header.

If the license has fields in it please add template strings for them. The template strings are in the format {{field_name}}. The currently support template items are:

  • copyright_year
  • author
  • project_name
  • description