A GitHub CLI extension to view and generate license files.
All license information is obtained from the GitHub API (https://docs.github.com/en/rest/licenses).
NOTE: The only purpose the CLI serves, is to save you the effort of opening up a browser to copy-&-paste the appropriate LICENSE text. It does NOT provide legal advice and you should still double-check the LICENSE yourself for any errors.
gh extension install Shresht7/gh-license
Invoke the cli extension like so:
gh license <command>
For example, to generate a license file:
gh license create mit
Create a license file
new
, add
, init
, set
gh-license create [flags]
Flag | Type | Description | Default |
---|---|---|---|
--author, -a |
string |
Author of the project | [AuthorName] |
--description, -d |
string |
Project description | |
--output, -o |
string |
Filepath | LICENSE |
--project, -p |
string |
Project name | [RepositoryName] |
--web, -w |
bool |
Create license file using the web interface | false |
--year, -y |
string |
Year | [CurrentYear] |
gh-license create mit
gh-license create mit --author Shresht7 --year 2023
gh-license create --web
gh-license create mit --web
Show a list of licenses
gh-license list [flags]
Flag | Type | Description | Default |
---|---|---|---|
--json, -j |
bool |
Output in JSON format | false |
--pretty-json, -p |
bool |
Output in pretty JSON format | false |
--web, -w |
bool |
Open the license in the browser | false |
gh-license list
gh-license list --json
gh-license list --pretty-json
View license of a repository
r
gh-license repo [flags]
Flag | Type | Description | Default |
---|---|---|---|
--json, -j |
bool |
Print the license in JSON format | false |
--pretty-json, -p |
bool |
Print the license in pretty JSON format | false |
--web, -w |
bool |
Open the license in the browser | false |
gh license repo
gh license repo Shresht7/gh-license
gh license repo gh-license
gh license repo --json
gh license repo Shresht7/gh-license --pretty-json
View details about a particular license
show
, get
gh-license view [flags]
Flag | Type | Description | Default |
---|---|---|---|
--json, -j |
bool |
Print the license details in JSON format | false |
--pretty-json, -p |
bool |
Print the license details in pretty JSON format | false |
--web, -w |
bool |
Open the license in the browser | false |
gh-license view mit
gh-license view mit --json
gh-license view mit --pretty-json
This software is licensed under the MIT License. See the LICENSE file for details.