A .net core tool to print the licenses of a project. This tool support .NET Core and .NET Standard Projects.
dotnet tool install --global dotnet-project-licenses
dotnet tool uninstall --global dotnet-project-licenses
Usage: dotnet-project-licenses [options]
Options:
Option | Description |
---|---|
-i, --input |
Project Folder |
--allowed-license-types |
Simple json file of a text array of allowable licenses, if no file is given, all are assumed allowed |
-j, --json |
(Default: false) Saves licenses list in a json file (licenses.json) |
--include-project-file |
(Default: false) Adds project file path to information when enabled. |
-l, --log-level |
(Default: Error) Sets log level for output display. Options: Error,Warning,Information,Verbose. |
--manual-package-information |
Simple json file of an array of LibraryInfo objects for manually determined packages. |
--licenseurl-to-license-mappings |
Simple json file of Dictinary<string,string> to override default mappings |
--include-transitive |
Include distinct transitive package licenses per project file. |
-o, --output |
(Default: false) Saves as text file (licenses.txt) |
--outfile |
Output filename |
-f, --output-directory |
Set Output Directory/Folder |
--projects-filter |
Simple json file of a text array of projects to skip. Supports Ends with matching such as 'Tests.csproj, Tests.vbproj, Tests.fsproj' |
--packages-filter |
Simple json file of a text array of packages to skip. Or a regular expression defined between two forward slashes '/regex/ '. |
-u, --unique |
(Default: false) Unique licenses list by Id/Version |
-p, --print |
(Default: true) Print licenses. |
--export-license-texts |
Exports the raw license texts |
--help |
Display this help screen. |
--version |
Display version information. |
--ignore-ssl-certificate-errors |
Ignores SSL certificate errors in HttpClient. |
--use-project-assets-json |
Use the resolved project.assets.json file for each project as the source of package information. Requires the -t option since this always includes transitive references. Requires nuget restore or dotnet restore to be run first. |
--timeout |
Set HttpClient timeout in seconds. |
--proxy-url |
Set a proxy server URL to be used by HttpClient. |
--proxy-system-auth |
Use the system credentials for proxy authentication. |
dotnet-project-licenses --help
dotnet-project-licenses -i projectFolder
Values for the input may include a folder path, a Visual Studio '.sln' file, a '.csproj' or a '.fsproj' file or a '.vbproj' file.
dotnet-project-licenses -i projectFolder -u
dotnet-project-licenses -i projectFolder -u -o
dotnet-project-licenses -i projectFolder -o --outfile ../../../another/folder/new-name.txt
dotnet-project-licenses -i projectFolder -u -o -j
dotnet-project-licenses -i projectFolder --export-license-texts
dotnet-project-licenses -i projectFolder -o -j -f ~/Projects/github --outfile ~/Projects/output.json --export-license-texts
dotnet-project-licenses -i projectFolder --export-license-texts --packages-filter '/Microsoft.*/'
dotnet-project-licenses -i projectFolder --proxy-url "http://my.proxy.com:8080"
dotnet-project-licenses -i projectFolder --proxy-url "http://my.proxy.com:8080" --proxy-system-auth
docker build . -t nuget-license
docker run -it -v projectPath:/tmp nuget-license -i /tmp -f /tmp --export-license-texts -l Verbose
where projectPath is the path of the project that you want to export the licenses.
You can also add the command parameters of the tool.
ex.
docker run -it -v ~/Projects/github/nuget-license:/tmp nuget-license -i /tmp -o --export-license-texts -l Verbose