Shimakaze.License 1.3.0

dotnet tool install --global Shimakaze.License --version 1.3.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local Shimakaze.License --version 1.3.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Shimakaze.License&version=1.3.0
                    
nuke :add-package Shimakaze.License --version 1.3.0
                    

Shimakaze.License

A .NET CLI tool that generates license files directly from official SPDX license templates. No license texts are bundled — everything is fetched on demand from spdx.org and cached locally.

Features

  • Generate a LICENSE file from any SPDX license ID (e.g. MIT, Apache-2.0, GPL-3.0-only)
  • Search the SPDX license list with fuzzy matching
  • Automatic template rendering: variables, copyright year and author are filled in for you
  • Optional template sections can be removed (--no-optional)
  • Line wrapping to a configurable print width
  • Transparent HTTP caching with ETag-based revalidation
  • Requires no network on repeated runs

Requirements

Installation

dotnet tool install --global Shimakaze.License

Usage

The tool registers itself as dotnet-license, so it is invoked through dotnet license.

Create a license file

# Create an MIT license in the current directory as LICENSE
dotnet license new MIT

# Pass the copyright holder as the second argument
dotnet license new MIT "Your Name"

# Write to a specific file
dotnet license new MIT -o /path/to/LICENSE

# Keep the output out of the console
dotnet license new MIT -q

# Drop optional template sections (e.g. the "MIT" section of Apache-2.0)
dotnet license new MIT --no-optional

# Wrap lines to a given width (0 disables wrapping)
dotnet license new MIT --print-width 100

new also accepts the aliases create and use.

Search the SPDX license list

dotnet license search gpl

Fuzzy-matches against license IDs and prints a table of License ID / License name. The alias find also works.

List dependency licenses

# List licenses of packages referenced by the current directory
dotnet license list

# Point at a project, solution or directory
dotnet license list path/to/app.slnx
dotnet license list path/to/app.csproj

The output is a tree: solution (if any) > project > project references and package references, resolved recursively. Each package row shows its resolved version and license.

# Include transitive (indirect) dependencies, up to 3 levels (same as --depth 3)
dotnet license list -r

# Control the depth of the dependency tree explicitly
dotnet license list --depth 5
dotnet license list --depth 0   # direct references only
dotnet license list --depth -1  # unlimited

# Select the target framework for a multi-targeting project
dotnet license list --framework net8.0

Full options

Command Option Description
new <SPDX Expression> License to create (required)
new <Author> Copyright holder to substitute (optional)
new -o, --out, --output File to write the license to (default LICENSE)
new -q, --quiet Do not print the generated license to the console
new --print-width Wrap lines longer than this width (default 80, 0 disables)
new --no-optional Ignore optional sections in the template
search <Like Name> Substring to match against license IDs (required)
list <Project> Project, solution or directory to inspect (optional, default current directory)
list -r, --recurse Include transitive dependencies (equivalent to --depth 3)
list -d, --depth Maximum depth of the dependency tree (-1 unlimited, 0 direct only)
list -f, --framework Target framework to use for multi-targeting projects

How it works

  1. new looks up the given SPDX expression in the license list from https://spdx.org/licenses/licenses.json.
  2. The corresponding template (.json details) is downloaded and rendered — the <<var:...>> placeholders are replaced with their defaults, the copyright year is set to the current year, and your author string is substituted where possible.
  3. Result is written to the output file (and printed unless -q).

Both the license list and individual templates are cached next to the tool (<tool dir>/.cache). Cached entries are revalidated with HTTP ETag / HEAD requests, so subsequent runs work offline or are fast.

Contributing

Bug reports, feature requests and pull requests are welcome. Please open an issue first for any non-trivial change.

License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.3.0 116 8/10/2026