Skip to content

rasata/license

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wercker status

Create licenses for your open-source projects from the command-line. Hello, productivity!

What is license?

license is a command-line utility to make licenses from the comfort of your terminal.

Features

  • Supports all the licenses available on GitHub
  • Does not need network access (except on first run)
  • Updates itself to the latest licenses in GitHub's API when possible
  • Easy to customize the name, year, and output filename when needed

Demo

Install

Homebrew:

brew update
brew tap nishanths/tap
brew install nishanths/tap/license

Using go: go get -u github.com/nishanths/license (more info)

Binary: get the binary for your platform here.

Usage

Generate a license

To generate a license, simply run license followed by the license name. The following command generates the MIT license:

license mit

Create a license file

Use the -o option to save the license to a file. For example, 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 on the generated license. To determine the name, license uses the following algorithm:

  • First, it looks for 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
  • As a last resort, it falls back to an empty string

The default ouput is suitable in most cases, but you can also explicitly specify the name and year:

license --name Alice --year 2013 mit

List available licenses

View the list of locally avaialable licenses by running:

license ls

The equivalent command to list remote licenses is:

license ls-remote

Current list of licenses:

    agpl-3.0      (GNU Affero General Public License v3.0)
    apache-2.0    (Apache License 2.0)
    artistic-2.0  (Artistic License 2.0)
    bsd-2-clause  (BSD 2-clause "Simplified" License)
    bsd-3-clause  (BSD 3-clause "New" or "Revised" License)
    cc0-1.0       (Creative Commons Zero v1.0 Universal)
    epl-1.0       (Eclipse Public License 1.0)
    gpl-2.0       (GNU General Public License v2.0)
    gpl-3.0       (GNU General Public License v3.0)
    isc           (ISC License)
    lgpl-2.1      (GNU Lesser General Public License v2.1)
    lgpl-3.0      (GNU Lesser General Public License v3.0)
    mit           (MIT License)
    mpl-2.0       (Mozilla Public License 2.0)
    unlicense     (The Unlicense)

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 :).

About

Command-line license generator written in Go

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%