KY.Generator.CLI 10.2.2

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global KY.Generator.CLI --version 10.2.2
                    
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 KY.Generator.CLI --version 10.2.2
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=KY.Generator.CLI&version=10.2.2
                    
nuke :add-package KY.Generator.CLI --version 10.2.2
                    

KY.Generator alternate text is missing from this package README image

Documentation | Getting Started | Supported Platforms | Need Help?

Setup for Visual Studio

via Annotations

Pros: Easy to use, rapid to implement

Cons: Attributes are part of the build, annotation assemblies have to be published and loaded when reflection is used

Install nuget package KY.Generator alternate text is missing from this package README image

Decorate a class with one of our Generate attributes

using KY.Generator;
...
[Generate("Output")]
internal class TypeToRead
{
  public string Property { get; set; }
}

See the complete showcase

See documentation for more details

via Fluent API

Pros: generator code is completely separated and is not published, more actions are available than via annotations

Cons: the initial setup is not so easy as with annotations

Create a new class library project

Install nuget package KY.Generator.Fluent alternate text is missing from this package README image

Derive a class from GeneratorFluentMain, override the execute method and use the Read method

public class GeneratorMain : GeneratorFluentMain
{
    public override void Execute()
    {
        this.Read()
            .FromType<Types>()
            .Write()
            .AngularModels().OutputPath("Output/Models").NoHeader()
            .AngularServices().OutputPath("Output/Services").NoHeader();
    }
}

See the complete showcase

See documentation for more details

Setup for Console/PowerShell

Install the .NET global tool alternate text is missing from this package README image

dotnet tool install -g KY.Generator.CLI

Run a command

ky-generator reflection -assembly=KY.Generator.Examples.Reflection.dll -name=ExampleType -namespace=KY.Generator.Examples.Reflection -relativePath=Output -language=TypeScript

The tool ships every built-in module, so nothing has to be installed next to it. It requires the .NET 8, 9 or 10 runtime; an assembly built for one of those is read by a matching process, whichever of them the tool itself was started on.

See documentation for more details

Settings file

Options that are the same for every project of a repository can be set once in a ky-generator.json instead of being repeated in the assembly attributes of each project.

{
  "$schema": "https://generator.ky-programming.de/v10/schema.json",
  "root": true,          // stop the search for further files above this one
  "options": {
    "addHeader": false,
    "lintSuppression": { "typescript": "/* eslint-disable */" }
  },
  "typescript": { "noIndex": true }
}

The search starts in the directory above the project and walks up to the root of the drive - at project level the assembly attributes are the way to configure the generator. The settings of the machine, in the application data folder, are the outermost layer, so every file found in the tree wins over them, and every file wins over the one above it. On top of that come the assembly attributes, the fluent syntax and the CLI parameters, in that order.

ky-generator settings-init      # write a file with every option and its default
ky-generator settings-validate  # check every file that applies, and find entries that change nothing
ky-generator settings           # what applies right now, and which file set it
ky-generator settings-set -key=options.addHeader -value=false
ky-generator settings-schema    # the json schema, for editor completion

settings-validate is the one to run after editing a file by hand: it reports invalid json, unknown keys and values that do not fit their option, and it exits non-zero on an error, so it works in a build pipeline. Entries whose value would apply anyway are listed as removable.

root: true stops the search above the file it sits on. ignoreGlobalSettings: true additionally drops the settings of the machine, for a repository whose generated output has to be identical everywhere - the id of the installation stays in the application data folder either way, since it cannot change a generated byte.

See documentation for every option.

Read More

For a complete overview see our documentation

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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
10.3.0 108 10/27/2026
10.2.2 102 10/25/2026
10.2.1 175 9/12/2026
10.2.0 207 8/22/2026
10.1.2 318 8/17/2026
10.1.1 151 8/15/2026
10.1.0 142 8/13/2026
10.0.0 163 7/31/2026
10.0.0-preview.36 600 12/15/2025
10.0.0-preview.35 472 11/29/2025
10.0.0-preview.17 583 10/16/2025
10.0.0-preview.15 1,026 7/23/2025
9.0.0 735 8/1/2025
8.8.6 905 2/16/2024
8.8.5 816 2/16/2024
8.8.4 812 2/13/2024
8.8.3 796 2/10/2024
8.8.2 817 2/9/2024
8.8.1 884 12/8/2023
8.8.0 758 12/3/2023
Loading failed