DigitalEngine.TemplateTool 1.1.5

dotnet tool install --global DigitalEngine.TemplateTool --version 1.1.5
                    
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 DigitalEngine.TemplateTool --version 1.1.5
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=DigitalEngine.TemplateTool&version=1.1.5
                    
nuke :add-package DigitalEngine.TemplateTool --version 1.1.5
                    

EngineTemplate CLI Tool

A command-line tool for generating features in Engine Template projects.

Installation

Install globally:

dotnet tool install -g DigitalEngine.TemplateTool

Or update to latest version:

dotnet tool update -g DigitalEngine.TemplateTool

Commands

add-feature

Generate a new feature with handler, provider, client and endpoint.

dotnet digitalengine add-feature <FeatureName>

The tool will prompt you for:

  • Engine name (auto-detected from project structure)
  • HTTP method (MapGet or MapPost)
  • Route pattern (e.g., policy/{policyNumber})
  • Function name (e.g., GetPolicyByPolicyNumber)
  • Endpoint type (User, Base, Service, Admin, or Custom)
  • Authorization roles (multi-select)

What Gets Generated:

For MapPost:

  • {Feature}Handler.cs - Endpoint handler
  • I{Feature}Provider.cs - Provider interface
  • {Feature}Provider.cs - Provider implementation
  • {Function}Request.cs - Request model
  • {Function}Response.cs - Response model
  • Endpoint mapping in EndpointMappingExtensions.cs
  • DI registration in DependencyInjectionSetup.cs
  • Client method in appropriate client file

For MapGet:

  • Same as above, but without Request model

Client Generation:

  • Base/User/Custom endpoints → {Engine}Client.cs
  • Admin endpoints → {Engine}AdminClient.cs
  • Service endpoints → {Engine}ServiceClient.cs

Example:

dotnet digitalengine add-feature Policy

add-config

Generate IOptions configuration classes from appsettings.json.

dotnet digitalengine add-config

The tool will:

  1. Read your appsettings.json file
  2. Display top-level configuration sections (excludes system sections like Serilog, ConnectionStrings)
  3. Let you multi-select which sections to generate
  4. Create POCO classes in {Engine}.Api/Models/Config/
  5. Register them in DependencyInjectionSetup.cs with services.Configure<T>()

Supports nested objects:

For this appsettings.json:

{
  "GoogleMaps": {
    "ApiUrls": {
      "DirectionsUrl": "https://routes.googleapis.com",
      "PlacesUrl": "https://places.googleapis.com"
    },
    "Autogen": {
      "ApiKey": ""
    }
  }
}

Generates:

public class GoogleMapsOptions
{
    public GoogleMapsApiUrls ApiUrls { get; set; }
    public GoogleMapsAutogen Autogen { get; set; }
}

public class GoogleMapsApiUrls
{
    public string DirectionsUrl { get; set; }
    public string PlacesUrl { get; set; }
}

public class GoogleMapsAutogen
{
    public string ApiKey { get; set; }
}

Example:

dotnet digitalengine add-config
# Select: Redis, GoogleMaps, Exceptionless

undo

Remove a generated feature and all its files.

dotnet digitalengine undo <FeatureName>

The tool will:

  1. Ask for confirmation
  2. Delete all generated files (Handler, Provider, Interface, Models)
  3. Remove endpoint mappings from EndpointMappingExtensions.cs
  4. Remove DI registrations from DependencyInjectionSetup.cs
  5. Remove client methods from client files
  6. Clean up unused using statements

Example:

dotnet digitalengine undo Policy
# Confirm: Yes

Other Commands

Help

dotnet digitalengine --help
dotnet digitalengine add-feature --help

Version

dotnet digitalengine --version

Testing

The tool includes integration tests:

cd DigitalEngine.TemplateTool.Tests
dotnet test
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.1.5 261 2/11/2026
1.1.2 128 2/10/2026
1.0.9 118 2/10/2026
1.0.8 132 1/16/2026
1.0.5 130 1/14/2026
1.0.4 132 1/14/2026
1.0.3 127 1/13/2026
1.0.2 126 1/13/2026
1.0.0 158 1/13/2026 1.0.0 is deprecated because it has critical bugs.

v1.1.5: Fixed using statement not being added to EndpointMappingExtensions when creating new endpoint methods