dct (Dotnet CLI Tool)
Scaffold CQRS and Clean Architecture components from the command line.
Details
- Role
- Author
- Started
- July 2025
- Language
- C#
- Platform
- Cross-platform
- Licence
- MIT
Overview
CQRS in a Clean Architecture codebase means a lot of small, structurally identical files. Every feature is a command or query, a handler, usually a validator, and the interfaces that bind them. Writing them by hand is repetitive, and repetitive work is where conventions quietly drift apart.
dct is a .NET global tool that generates those artifacts from templates. You run dct init once, which drops a .dct folder into the project root containing the templates and configuration; from then on dct create command User/CreateUser produces a file that matches how your team writes them.
The templates are the point. Because generation is driven by files in your repository rather than by conventions baked into the tool, dct adapts to a codebase instead of imposing a structure on it — and the conventions get enforced by default rather than by review.
Highlights
- Generates CQRS artifacts: commands, queries, handlers, classes and interfaces
- Templates and config live in a .dct folder inside your own repository
- Fully customisable output — the tool adapts to your codebase, not the reverse
- Installed globally via dotnet tool install -g dct
- Built on Spectre.Console.Cli with Scriban templating
- Published on NuGet
Built with
- .NET
- Spectre.Console.Cli
- Scriban