Create licenses for your open-source projects from the command-line. Hello, productivity!
- Works without network access (except for first-run)
- Automatically stays up-to-date with licenses in GitHub's API
- Makes it easy to customize the name, year, and output filename when needed
Demo
Install
Using go
$ go get github.com/nishanths/license
Make sure it works:
$ license --version # should print version number
Check out additional instructions or create an issue if you run into trouble.
Binary
Alternatively, grab the binary for your platform from the wiki page.
Usage
Generating a license
To generate a license, simply run license followed by the license name. The following command, for example, generates the MIT license:
$ license mit
Creating a license file
Use the -o option to save the license to a file. The following command creates the file LICENSE.txt with the contents of the ISC license:
$ license -o LICENSE.txt isc
More options and commands are described below.
Options
Customize name and year on the license
By default, license uses the current year for the year on the generated license. To determine the name, license uses the following algorithm:
- First, it looks at provided command-line arguments
- If command-line args are absent, it looks at the environment variable
LICENSE_FULL_NAME
- Finally, it uses the name from git config and mercurial config.
You can explicitly specify the name and year to use:
$ license --name Alice --year 2013 mit
List available licenses
View the list of locally avaialable licenses by running:
$ license ls
The remote counterpart is:
$ license ls-remote
Currently available list of licenses
Help
Help text is available by running license --help. View help command output
Contributing
Pull requests for new features, bug fixes, and suggestions are welcome!
License
Licensed under the MIT License.
The license file in this repo was generated by this program :).