← All languages

wildling

C# library and CLI for pattern-based string generation. Zero NuGet dependencies (.NET BCL only). Targets .NET 8.

Example

Install

From this repository:

cd csharp
./build.sh
./bin/wildling "Year 19##"

From a release tag:

git clone --branch v2.0.7 --depth 1 https://github.com/dotmonk/wildling.git
cd wildling
./build.sh csharp

Registry (CLI): the NuGet package is a .NET tool (PackAsTool), not a library you can dotnet add package into an app:

dotnet tool install -g DotMonk.Wildling
wildling "Year 19##"

Library: reference the project from a clone (or the built dist/ assembly). Do not use PackageReference to DotMonk.Wildling — that package identity is tool-only and restore will fail with NU1212.

// e.g. after clone: dotnet add reference path/to/wildling/csharp/Wildling.csproj
using WildlingLib;

var wildling = Wildling.Create(new[] { "Year 19##" });
object value = wildling.Next();
while (value is not false)
{
    Console.WriteLine(value);
    value = wildling.Next();
}

Produces dist/wildling.dll when built from this tree. Requires the .NET 8 runtime, or Docker (the launcher falls back to the runtime image if dotnet is not on PATH).

CLI

./bin/wildling "Year 19##"
./bin/wildling --dictionary planets:../dictionaries/planets.txt "%{'planets'}"
./bin/wildling --template ./config.json

Help text and --check output follow docs/cli.md / docs/help.txt.

Build

./build.sh   # Docker (dotnet SDK 8): publish to dist/, copies help.txt

Project tests live in ../tests/ and are run with ../test.sh.