Linux command
license 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
List licenses
license list
Generate MIT license
license mit
Generate Apache license
license apache-2.0
Generate GPL license
license gpl-3.0
Generate and redirect to file
license mit > LICENSE
With author name and year
license -n "[Your Name]" -y [2025] mit
Save license to a file
license -o LICENSE.txt mit
说明
license generates open source license files from the command line. It supports all license types listed on the GitHub Licenses API and more, including MIT, Apache-2.0, GPL-3.0, BSD-2-Clause, ISC, MPL-2.0, and Unlicense. The tool outputs license text to stdout by default. Use -o to save directly to a file. Author name is resolved from command-line flags, the LICENSE_FULL_NAME environment variable, or git/hg config.
参数
- list
- List all available license types.
- -n, -name _NAME_
- Author name for the license. Falls back to LICENSE_FULL_NAME env var, then git config.
- -y, -year _YEAR_
- Year for copyright notice. Defaults to the current year.
- -o _FILE_
- Save the license to the specified file instead of stdout.
- -help
- Display help information.
FAQ
What is the license command used for?
license generates open source license files from the command line. It supports all license types listed on the GitHub Licenses API and more, including MIT, Apache-2.0, GPL-3.0, BSD-2-Clause, ISC, MPL-2.0, and Unlicense. The tool outputs license text to stdout by default. Use -o to save directly to a file. Author name is resolved from command-line flags, the LICENSE_FULL_NAME environment variable, or git/hg config.
How do I run a basic license example?
Run `license list` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does list do in license?
List all available license types.