Skip to main content
When you run dotnet new chromapperplugin, the template engine accepts parameters that customize the generated project. Pass them as flags on the command line.

Basic usage

dotnet new chromapperplugin --Author "YourName" -o MyPlugin
The -o / --output flag sets the output directory and the project name at the same time (see below).

Parameters

--Author
string
default:"YourName"
The author of the plugin. The template engine replaces every occurrence of the literal string YourName in the generated files with the value you supply.In Plugin.cs this sets the Author constant, which is used to build the plugin’s unique identifier:
public const string Author = "YourName"; // replaced with your value
public const string ID = $"com.{Author}.{Name}";
So --Author "alice" with -o CoolPlugin produces ID = "com.alice.CoolPlugin".
-o / --output
string
default:"Current directory"
The output directory for the generated project. Because the template’s sourceName is ChroMapperPluginTemplate, the dotnet template engine also replaces every occurrence of the string ChroMapperPluginTemplate throughout all generated files with the directory name you provide here.This means the output directory name becomes:
  • The C# namespace (namespace MyPlugin;)
  • The assembly name (<AssemblyName>MyPlugin</AssemblyName>)
  • The Name constant in Plugin.cs (public const string Name = "MyPlugin";)
  • The .csproj filename (MyPlugin.csproj)
If you omit -o, the template generates files in the current directory and uses the current directory name as the project name.

Parameter table

FlagTypeDefaultDescription
--AuthortextYourNameReplaces the YourName literal in all generated files
-o / --outputtextCurrent directorySets the output directory; also renames the project via sourceName substitution

Example commands

Minimal — use the default author name:
dotnet new chromapperplugin -o MyPlugin
Specify your author name:
dotnet new chromapperplugin --Author "alice" -o MyPlugin
Specify a multi-word author name:
dotnet new chromapperplugin --Author "Alice Smith" -o MyPlugin
The resulting Plugin.cs constants for the command above:
public const string Author = "Alice Smith";
public const string Name = "MyPlugin";
public const string ID = $"com.{Author}.{Name}"; // "com.Alice Smith.MyPlugin"
Keep Author a single identifier with no spaces if you plan to use ID as a Harmony patch namespace, since the ID is derived from it directly.
Reproduce the template test exactly (from templateTest.ps1):
dotnet new chromapperplugin -o NewTestPlugin --Author "Vainstains"

How parameter substitution works

The template engine performs two independent substitutions when it generates your project:
  1. sourceName substitution — replaces the literal string ChroMapperPluginTemplate everywhere (file names, directory names, file content) with the value of -o.
  2. symbols substitution — replaces the literal string YourName everywhere with the value of --Author.
Both substitutions run over every file the template includes, so there is no need to manually edit the generated files after running dotnet new.

Build docs developers (and LLMs) love