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
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package DigitalEngine.TemplateTool --version 1.1.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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 handlerI{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:
- Read your
appsettings.jsonfile - Display top-level configuration sections (excludes system sections like Serilog, ConnectionStrings)
- Let you multi-select which sections to generate
- Create POCO classes in
{Engine}.Api/Models/Config/ - Register them in
DependencyInjectionSetup.cswithservices.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:
- Ask for confirmation
- Delete all generated files (Handler, Provider, Interface, Models)
- Remove endpoint mappings from
EndpointMappingExtensions.cs - Remove DI registrations from
DependencyInjectionSetup.cs - Remove client methods from client files
- 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 | Versions 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.
v1.1.5: Fixed using statement not being added to EndpointMappingExtensions when creating new endpoint methods