HoofMark.CSharpTemplating.Cli
0.1.1
dotnet tool install --global HoofMark.CSharpTemplating.Cli --version 0.1.1
dotnet new tool-manifest
dotnet tool install --local HoofMark.CSharpTemplating.Cli --version 0.1.1
#tool dotnet:?package=HoofMark.CSharpTemplating.Cli&version=0.1.1
nuke :add-package HoofMark.CSharpTemplating.Cli --version 0.1.1
HoofMark.CSharpTemplating.Cli
Generate code or any other text output from template files written in pure C#.
cstemplate is a VSCode extension and CLI tool that runs C# template files (.template.cs) directly from VS Code.
HoofMark.CSharpTemplating.Cli is the command-line interface for running templates, packaged as a .NET tool and invoked by the VSCode cstemplate extension.
Getting started
- Install the CLI tool
cstemplatevia tool packageHoofMark.CSharpTemplating.Cli - Install the
cstemplateextension from the VS Code Marketplace - Add a package reference to
HoofMark.CSharpTemplating.Abstractionsin your template .csproj file - Create a template (
*.template.cs) and optional config (*.json) file in the project - Using VSCode context menu, shortcut keys or command palette, run the template to generate output.
For full documentation, see hoofmark.github.io/cstemplate.
Prerequisites
- .NET 10 SDK or later
- VS Code with the C# Dev Kit extension
Usage
The cstemplate extension for VSCode provides functionality that is similar to T4 templates in Visual Studio, but without the need to learn a separate templating language or to edit complex syntax containing a mix of C# code and embedded template instructions. Template files (*.template.cs) are written in pure C#, so can use any C# language features (StringBuilder, interpolated strings, etc) to generate and format output. If required, templates can also reference NuGet packages and custom DLLs at design time. Standard C# Dev Kit functionality and intellisense provides full support for editing, compiling and debugging templates, while the extension provides context menu, keyboard shortcuts and command palette options to generate code directly within VSCode.
Configuration files placed alongside the templates can be used to define template inputs (argument values, .json or .xml models, database connections, etc). The same template can be reused in multiple projects to generate output specific to each project.
Template output is simply one or more text files, written to a target location relative to the current project / solution. An individual template can be used to generate a single C# class, produce boilerplate code for data access objects, or to scaffold an entire project.
Additional documentation
For full documentation, see hoofmark.github.io/cstemplate.
Feedback
For source code and to log issues and feedback, see GitHub.
| 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. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.1 | 36 | 7/16/2026 |
See full changelog: https://github.com/hoofmark/cstemplate/CHANGELOG.md