List License Templates
List all available license templates that can be added to your repository.
Usage
gh-templates license list [OPTIONS] [ARGS]...
Options
Option | Description |
---|---|
-p, --popular | Show only popular/common licenses |
-n, --non-software | Show non-software licenses |
-s, --search <SEARCH> | Search for licenses containing this term, can contain wildcard |
--include-deprecated | Show deprecated licenses as well |
--update-cache | Update the license cache before listing |
--osi-approved | Show only OSI-approved licenses |
--fsf-libre | Show only FSF libre-approved licenses |
-h, --help | Print help |
Examples
List All Available Licenses
gh-templates license list
This command displays all available license templates with their names and descriptions.
List Only Popular Licenses
gh-templates license list --popular
Search for Specific Licenses
gh-templates license list --search mit
List OSI-approved Licenses
gh-templates license list --osi-approved
Sample Output
Available License Templates:
mit MIT License - Simple and permissive
apache-2.0 Apache License 2.0 - Permissive with patent protection
gpl-3.0 GNU General Public License v3.0 - Strong copyleft
bsd-3-clause 3-Clause BSD License - Permissive with attribution
bsd-2-clause 2-Clause BSD License - Simplified BSD
isc ISC License - Simplified permissive license
mpl-2.0 Mozilla Public License 2.0 - Weak copyleft
lgpl-3.0 GNU Lesser General Public License v3.0
unlicense The Unlicense - Public domain dedication
cc0-1.0 Creative Commons Zero v1.0 Universal
Understanding License Names
License names shown in the list can be used directly with the add
command:
# Use any license name from the list
gh-templates license add mit
gh-templates license add apache-2.0
gh-templates license add gpl-3.0
License Categories
Licenses are typically categorized by their restrictions:
Permissive Licenses
- MIT: Most permissive, allows almost anything
- Apache-2.0: Permissive with patent protection
- BSD-3-Clause: Permissive with attribution requirement
- ISC: Simple and permissive
Copyleft Licenses
- GPL-3.0: Strong copyleft, derivatives must be open-source
- LGPL-3.0: Lesser GPL, allows linking with proprietary code
- MPL-2.0: Weak copyleft, file-level copyleft
Public Domain
- Unlicense: Releases code to public domain
- CC0-1.0: Creative Commons public domain dedication
Choosing a License
Consider these factors when selecting a license:
- Project Type: Open-source library vs. application
- Commercial Use: Whether you want to allow commercial use
- Attribution: Whether you require attribution
- Copyleft: Whether derivatives must remain open-source
- Patent Rights: Whether you need patent protection
Quick Reference
Need | Recommended License |
---|---|
Maximum freedom | MIT |
Patent protection | Apache-2.0 |
Keep derivatives open | GPL-3.0 |
Public domain | Unlicense |
Simple permissive | ISC |
Next Steps
After reviewing the available licenses:
-
Preview licenses you're considering:
gh-templates license preview mit
-
Add a license to your repository:
gh-templates license add mit
-
Compare licenses by previewing multiple options:
gh-templates license preview mit apache-2.0
Related Commands
- Preview License Templates - Preview license content
- Add License Templates - Add licenses to your repository