Skip to content

kszongic/license-maker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

license-maker 📜

Generate LICENSE files from the command line. MIT, Apache, GPL, BSD, ISC, MPL, Unlicense — one command.

npm version npm downloads License: MIT zero dependencies Node.js

Why?

Every open-source project needs a LICENSE file, but nobody wants to manually copy-paste legal text and fill in the year and author name. license-maker generates a correct, complete LICENSE file in one command — with zero dependencies.

Install

npm install -g license-maker

Or use directly without installing:

npx license-maker mit

Quick Start

# Generate MIT license (auto-detects name from git config)
license-maker mit

# Specify author name
license-maker apache-2.0 --name "Jane Doe"

# Output to custom file
license-maker gpl-3.0 --output LICENSE.md

# Print to stdout (pipe to clipboard)
license-maker mit --stdout | pbcopy    # macOS
license-maker mit --stdout | xclip     # Linux

# List all available licenses
license-maker --list

Supported Licenses

License Command Permissive? Patent Grant?
MIT license-maker mit
Apache 2.0 license-maker apache-2.0
GPL 3.0 license-maker gpl-3.0 ❌ (copyleft)
BSD 2-Clause license-maker bsd-2
BSD 3-Clause license-maker bsd-3
ISC license-maker isc
MPL 2.0 license-maker mpl-2.0 Partial
Unlicense license-maker unlicense ✅ (public domain) N/A

Which license should I choose?

  • MIT — Maximum freedom, minimal restrictions. Most popular on npm.
  • Apache 2.0 — Like MIT but includes patent protection. Good for corporate use.
  • GPL 3.0 — Requires derivative works to also be open source.
  • ISC — Functionally identical to MIT, slightly shorter text.
  • Unlicense — Public domain dedication. No restrictions at all.

Features

  • 📦 Zero dependencies — just Node.js built-ins
  • 🔍 Auto-detects author from git config user.name
  • 📅 Auto-fills year — always current
  • 🖨️ Pipe to stdout with --stdout
  • 🎨 Colorful terminal output — clear success/error messages
  • Instant — no network requests, no config files

Use Cases

New project setup

mkdir my-project && cd my-project
npm init -y
license-maker mit
# LICENSE file created with your name and current year ✓

CI/CD pipeline

# GitHub Actions: ensure LICENSE exists
- name: Generate license if missing
  run: |
    if [ ! -f LICENSE ]; then
      npx license-maker mit --name "${{ github.repository_owner }}"
    fi

Monorepo — license every package

for dir in packages/*/; do
  (cd "$dir" && npx license-maker mit)
done

Scaffolding script

#!/bin/bash
mkdir "$1" && cd "$1"
npm init -y
npx license-maker mit
git init
echo "node_modules" > .gitignore
echo "# $1" > README.md

Options

Flag Description
--name <name> Author name (default: git config user.name)
--output <file> Output file path (default: LICENSE)
--stdout Print to stdout instead of writing a file
--list List all available license types
--help Show help message

Comparison

Feature license-maker choosealicense.com license-generator manual copy-paste
CLI one-liner
Zero dependencies N/A N/A
Auto-detect author
Auto-fill year
Works offline
npx support N/A N/A
8 license types

Related Tools

Part of a zero-dependency CLI toolkit:

License

MIT © kszongic

About

Generate LICENSE files from the command line. MIT, Apache, GPL, BSD, ISC, MPL, Unlicense — zero dependencies.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors