Skip to main content

licgen 📃

PyPI Version Python Versions License CI Status

licgen is a fast, reliable, and dependency-free CLI tool designed to instantly generate standard open-source LICENSE files for your projects.

Whether you need a quick permissive license for a hobby script or a strict copyleft license for an enterprise repository, licgen handles template rendering, copyright holder injection, and automated project/year detection out of the box.

✨ Features

  • 🗃️ Curated License Library: Includes all major open-source licenses (MIT, Apache 2.0, GPLv3, AGPLv3, Unlicense, and more) pre-loaded as native resources.
  • 🤖 Smart Autocomplete & Detection: Automatically resolves the current copyright year and dynamically infers the project name from your current directory if omitted.
  • 🔍 Interactive Discovery: Built-in quick list command (--list) to instantly view all available license types directly in your terminal.
  • 📦 Zero Dependencies: Pure Python implementation with zero third-party dependencies, leveraging modern importlib.resources and argparse for maximum portability and speed.
  • 🪶 Lightweight & Global: Seamlessly installs as a global binary command that can be invoked from any directory.

🎯 Motivation

While creating open-source projects (like pairgen or manigen), setting up the right LICENSE file is always annoying. You usually have to search for the template online, copy-paste it, and manually edit the year and author name.

licgen was created to standardize and automate this routine into a single, straightforward CLI command. It perfectly complements your existing development workflow, making project initialization effortless and compliant from second one.

📦 Installation

You can install licgen directly from PyPI using pip:

pip install licgen

Or, if you use uv (recommended for CLI tools):

uv tool install licgen

🚀 Quick Start

Generate a standard MIT license for the current year in your working directory:

licgen mit -a "Your Name"

💡 Advanced Usage Examples

1. Listing Available Licenses

If you are unsure which license type string to pass, list all built-in templates:

licgen -l

2. Setup with Specific Year and Project Name

Generate desired license, explicitly defining the project name and a custom copyright year:

licgen apache-2.0 -a "Your name" -y 2048 -p "Project name"

3. Custom Output Directory

Initialize a license inside a specific sub-folder or a newly initialized git repository path:

licgen mit -a "Your name" -o ./my-new-project

🛠️ CLI Reference

Argument Short Description Default
LICENSE_TYPE - (Required) Type of license to generate. -
--author -a (Required) Name of the copyright holder / author. -
--list -l Show all available license types and exit. False
--year -y Copyright year. Current Year
--project -p Project name. Current Dir Name
--output-path -o Directory where the LICENSE file will be saved. Current Dir

🤝 Contributing

1. Clone the repository

git clone https://github.com/ash1ra/licgen
cd licgen

2. Install dependencies using uv

uv sync
# On Windows
.venv\Scripts\activate
# on Unix or MacOS
source .venv/bin/activate

3. Format and lint the code

uv run ruff format .
uv run ruff check .

4. Run the tests

uv run pytest tests/ -v

5. Submit a pull request

If you'd like to contribute, please fork the repository and open a pull request to the main branch.

Metadata

Release files for licgen 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for licgen 1.0.2
File Size Uploaded Provenance Actions
licgen-1.0.2.tar.gz 70.2 kB Without provenance Details for licgen-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for licgen 1.0.2
File Interpreter ABI Platform Actions
licgen-1.0.2-py3-none-any.whl Python 3 none any Details for licgen-1.0.2-py3-none-any.whl

Total release size: 159.7 kB

Release files / licgen-1.0.2.tar.gz

Download URL licgen-1.0.2.tar.gz
Size 70.2 kB
Tags Source
SHA-256 checksum
How to use checksums
23468a7a341be3efc8ee6f67fa620b374a93de65cbd408a12289f841dd425729
BLAKE2b-256 checksum
How to use checksums
68ddd89eedb3b944aa8e3dfd6ddc7d41d3eb8b7a32fbf556d7849c6d01aa8e24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / licgen-1.0.2-py3-none-any.whl

Download URL licgen-1.0.2-py3-none-any.whl
Size 89.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2609d2333d406fa3058933f267156b75d1d562f2cd2f93b3772f6e8bab14ed6
BLAKE2b-256 checksum
How to use checksums
fa330eba4d43837803147fab2f5ec0fdaf43ae551704427719c8d84cea3b9d9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for licgen 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page