licgen is a command-line tool that brings the functionality of choosealicense.com to your terminal, completely offline. It helps you quickly generate license files for your projects without having to search for them online.
- Offline License Help: View permissions, conditions, and limitations for popular licenses in a clean table format.
- Dynamic Template System: Adding new licenses is as easy as creating a
.templatetext file. - Smart Defaults: Automatically writes to
LICENSE.txt,LICENSE.md, orLICENSE.jsonbased on the format. - Interactive Mode: Prompts for required fields like Name and Year if not provided.
- Full CLI Support: Supports arguments for non-interactive use and piping.
git clone https://github.com/teja/licgen.git
cd licgen
make
sudo make installlicgen listSee permissions, conditions, and limitations (like choosealicense.com):
licgen mit --helpBy default, licgen writes to a file in the current directory:
licgen mit # Interactive mode, writes to LICENSE.txt
licgen mit --name "John Doe" # Non-interactive, writes to LICENSE.txt- Text (Default): Writes to
LICENSE.txt - Markdown: Use
-mor--markdown. Writes toLICENSE.md. - JSON: Use
-jor--json. Writes toLICENSE.json.
licgen mit --markdown # Creates LICENSE.md
licgen mit --json # Creates LICENSE.jsonIf you want the output printed to the terminal instead of a file (e.g., for piping):
licgen mit --stdout # Prints to terminal
licgen mit -s # Short versionlicgen mit --name "Jane Doe" --year 2026 --output MY_LICENSE
# Using short flags:
licgen mit -n "Jane Doe" -y 2026 -o MY_LICENSEAdding a new license is incredibly simple. Just create a .template file in the templates/ directory:
ID: mylic
Name: My Custom License
SPDX: MY-LIC
Category: permissive
Description: A very cool license.
Permissions:
- Commercial use
- Private use
Conditions:
- License notice
---
Copyright (c) {{year}} {{name}}
... license text here ...The tool currently supports many popular licenses including:
- Permissive: MIT, Apache 2.0, BSD 2/3-Clause, ISC, Zlib, Boost
- Copyleft: GPL v3.0 (and more in progress)
- Public Domain: Unlicense, CC0, WTFPL
This project is licensed under the MIT License.