LIGEN-CLI
A CLI tool for managing licenses Powered by ligen.
Features
- Create licenses with customizable copyright information
- Auto-discover license files in your repository
- View license type and copyright years
- Update copyright holder and years
Quick Start
Installation
go install github.com/MoonMoon1919/ligen-cli@latest
Command Structure
ligen-cli follows a verb-based command structure:
create - Generate new license files
get - Retrieve license information
update - Modify existing license properties
Basic Usage
ligen-cli create \
--project-name ligen-cli \
--holder "J Doe" \
--license-type MIT
Supported License types
MIT - MIT License
APACHE - Apache License 2.0
MOZILLA - Mozilla Public License 2.0
BOOST - Boost Software License 1.0
UNLICENSE - The Unlicense
GNU_LESSER - GNU Lesser General Public License 3.0
Usage
Creating licenses
ligen-cli create \
--project-name ligen-cli \
--holder "J Doe" \
--start-year 2023 \
--end-year 2025 \
--license-type MIT
Getting license data
# Create a lience
ligen-cli create \
--project-name ligen-cli \
--holder "J Doe" \
--start-year 2023 \
--end-year 2024 \
--license-type MIT
# retrieve years of license
ligen-cli get years
# get type of license
ligen-cli get type
Updating license data
# Create a license
ligen-cli create \
--project-name ligen-cli \
--holder "J Doe" \
--start-year 2023 \
--end-year 2024 \
--license-type MIT
# Update start year
ligen-cli update start-year --start-year 2022
# Update end year
ligen-cli update end-year --end-year 2025
# Update holder
ligen-cli update holder --holder "Jane Doe"
# Update project name (only used for some license types)
ligen-cli update project-name --project-name "peanut butter"
Path Options
By default, ligen-cli automatically discovers license files in your repository. You can also specify custom paths.
Auto-discovery
The CLI searches for common license files in this order:
- LICENSE
- UNLICENSE
- COPYING.LESSER
- LICENSE.txt
- LICENSE.md
Setting your own path
# Specify a custom license file location
ligen-cli get type --path ./licenses/LICENSE
ligen-cli update holder --path ./docs/LICENSE --value "New Holder"
Contributing
See CONTRIBUTING for details.
License
MIT License - see LICENSE for details.
Disclaimers
This work does not represent the interests or technologies of any employer, past or present. It is a personal project only.