delice is a tool for determining the license information of the packages that are referenced in a project/solution. This is a port of the Node.js utility delice
, created by Tierney Cyren.
This tool ships as a dotnet
global tool and can be installed like so:
dotnet tool install -g dotnet-delice
You can then use it like so:
dotnet delice [folder, sln, csproj, fsproj]
-?|-h|--help
Boolean. Show help-j|--json
Boolean. Output results as JSON rather than pretty-print--json-output [path]
String. Path to file that the JSON should be written to. Note: Only in use if you use-j|--json
.
- Project Name
- The name of the project that was checked
- License Expression
- A license expression found when parsing references
- Some packages may result in an undetermined license. See Undetermined Licenses for more information
- Packages
- The name(s) of the packages found for that license
The following is an example of pretty-printed output:
Project dotnet-delice
License Expression: MIT
βββ There are 10 occurances of MIT
βββ¬ Packages:
βββ FSharp.Core
βββ Microsoft.NETCore.App
βββ Microsoft.NETCore.DotNetAppHost
βββ Microsoft.NETCore.DotNetHostPolicy
βββ Microsoft.NETCore.DotNetHostResolver
βββ Microsoft.NETCore.Platforms
βββ Microsoft.NETCore.Targets
βββ NETStandard.Library
βββ Newtonsoft.Json
βββ System.ComponentModel.Annotations
- Attempt to determine license from license file
- Use the GitHub API (if a GitHub repo) or basic file parsing to detect license info (see undetermined licenses)
- Show conformance info from the licenses
- Ability to filter for only a particular license
- Anything you'd like? Open an issue π
At the end of 2018 the licenseUrl
field in the nuspec file was deprecated to be replaced with a richer license metadata field. You can read more about it in the annuncement, the documentation and Spec wiki.
This new metadata makes it possible to determine from the package what the license in use by a package is, rather than relying on navigating through to the referred license file.
Some NuGet packages have moved over to the new format, but many of them are still using the legacy approach which makes it difficult for delice to determine what the license is of a package. Presently, these packages will be reported with an "Unable to determine" license type with the URL of the license URL included in the output.
The file LicenseCache.fs
contains a map of commonly used packages and the license file that they have. This means that delice can determine more licenses out of the box.
If you're coming across packages that you think should be in there, open a Pull Request with the updates.
This project is a port of the Node.js utility delice
, created by Tierney Cyren and aims to provide the same sorts of functionality but in a .NET friendly workflow.