KY.Generator 10.2.0

Prefix Reserved
dotnet add package KY.Generator --version 10.2.0
                    
NuGet\Install-Package KY.Generator -Version 10.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="KY.Generator" Version="10.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="KY.Generator" Version="10.2.0" />
                    
Directory.Packages.props
<PackageReference Include="KY.Generator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add KY.Generator --version 10.2.0
                    
#r "nuget: KY.Generator, 10.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package KY.Generator@10.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=KY.Generator&version=10.2.0
                    
Install as a Cake Addin
#tool nuget:?package=KY.Generator&version=10.2.0
                    
Install as a Cake Tool

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

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETCoreApp 2.0

    • No dependencies.
  • .NETCoreApp 3.0

    • No dependencies.
  • net10.0

    • No dependencies.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on KY.Generator:

Package Downloads
KY.Generator.Fluent

Fluent language for KY-Generator

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.2.0 99 8/22/2026
10.1.2 231 8/17/2026
10.1.1 93 8/15/2026
10.1.0 92 8/13/2026
10.0.0 121 7/31/2026
10.0.0-preview.50 59 7/30/2026
10.0.0-preview.48 58 7/25/2026
10.0.0-preview.46 126 6/23/2026
10.0.0-preview.45 77 5/22/2026
10.0.0-preview.36 257 12/15/2025
10.0.0-preview.35 117 11/29/2025
10.0.0-preview.17 196 10/16/2025
10.0.0-preview.15 598 7/23/2025
9.1.0 715 11/11/2025
9.0.1 573 10/9/2025
9.0.0 423 8/1/2025
8.10.0 654 11/11/2025
8.9.3 574 10/22/2025
8.9.2 567 10/9/2025
8.9.1 748 7/24/2025
Loading failed