licenser

command module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

README

licenser

A CLI for choosing and generating software license files. Uses data from choosealicense.com.

image

Why

My usual flow was tedious:

  1. Open choosealicense.com
  2. Find the license I want
  3. wget it or copy-paste into the repo
  4. Edit placeholders by hand

There's an existing CLI (choosealicense-cli) but it looked unmaintained and was missing features I wanted. So I wrote this.

Demo

asciicast

Install

Requires Go 1.25+

go install github.com/devadathanmb/licenser@latest

Or build from source:

# Clone the repository
git clone https://github.com/devadathanmb/licenser.git

# Navigate and build the project
cd licenser && make build

# Run the binary
./licenser --help

Usage

Running licenser with no arguments in a TTY launches an interactive wizard.

For non-interactive use:

# list all available licenses
licenser list

# show details for a specific license
licenser info mit

# search by rules (permissions, conditions, limitations)
licenser search --permits patent-use --no-requires disclose-source

# compare licenses side by side (2 or 3)
licenser compare mit apache-2.0

# generate a LICENSE file
# author, email, year, and project are auto-detected from git config when available
licenser generate mit --author "Jane Doe" --year 2026

# refresh local license data
licenser update

Commands

Command Description
list List all available licenses
info <license> Show metadata and text for a license
search Filter licenses by permissions / conditions / limitations
compare <l1> <l2> [l3] Side-by-side comparison of 2 or 3 licenses
generate <license> Write a LICENSE file with placeholders filled in
update Refresh cached license data
completion Generate shell completion scripts

list, info, search, and compare support --json for scripting.

generate flags: --author, --email, --year, --project, -o/--output, --stdout, -f/--force

search flags: --permits, --requires, --forbids, --no-requires

Development

make build   # build binary → ./licenser
make test    # run all tests with race detection
make fmt     # check formatting (gofmt -s)
make vet     # run go vet
make lint    # fmt + vet + golangci-lint (if installed)

Credits


Not legal advice. And yes, this repo's own LICENSE was generated using this tool.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
ui

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL