CleanArchScaffolder 1.9.2

dotnet tool install --global CleanArchScaffolder --version 1.9.2
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local CleanArchScaffolder --version 1.9.2
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=CleanArchScaffolder&version=1.9.2
                    
nuke :add-package CleanArchScaffolder --version 1.9.2
                    

Clean Arch CLI

A .NET global tool that scaffolds a complete Clean Architecture solution in seconds. One command gives you a fully wired solution with proper project references, dependency injection, Entity Framework Core, and a test project — ready to build and run.

Features

  • Interactive CLI powered by Spectre.Console
  • Four-layer architecture: Domain, Application, Infrastructure, and Api
  • xUnit test project with FluentAssertions
  • Pre-configured project references following the dependency rule
  • NuGet packages installed automatically (EF Core, MediatR, FluentValidation, Scalar)
  • AppDbContext and IAppDbContext scaffolded and registered
  • DependencyInjection extension methods in Application and Infrastructure
  • Program.cs configured with controllers, OpenAPI, and Scalar
  • Connection string pre-configured in appsettings.json
  • .gitignore (standard Visual Studio template)

Prerequisites

Installation

dotnet tool install -g CleanArchScaffolder

Usage

clean-arch

You will be prompted to enter a solution name. The tool then generates the full project structure in the current directory.

Generated Structure

MySolution.slnx
.gitignore
src/
  MySolution.Domain/
    Entities/
    ValueObjects/
    Enums/
  MySolution.Application/
    Interfaces/
      IAppDbContext.cs
    Features/
    DTOs/
    DependencyInjection.cs
  MySolution.Infrastructure/
    Persistence/
      AppDbContext.cs
    Repositories/
    DependencyInjection.cs
  MySolution.Api/
    Controllers/
    Program.cs
    appsettings.json
tests/
  MySolution.Application.Tests/

Project References

Api --> Infrastructure --> Application --> Domain
Application.Tests --> Application

The Api layer depends on Infrastructure, which depends on Application, which depends on Domain. This enforces the Clean Architecture dependency rule — inner layers never reference outer layers.

Installed Packages

Project Packages
Infrastructure Microsoft.EntityFrameworkCore.SqlServer, Microsoft.EntityFrameworkCore.Tools
Api Microsoft.EntityFrameworkCore.Design, Scalar.AspNetCore
Application MediatR, FluentValidation, FluentValidation.DependencyInjectionExtensions
Application.Tests xunit, FluentAssertions
Domain —

Building from Source

git clone <repo-url>
cd CleanArchScaffolder
dotnet pack
dotnet tool install -g CleanArchScaffolder --add-source ./nupkg

License

MIT

Product 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.

Version Downloads Last Updated
1.9.2 126 4/13/2026
1.9.0 115 4/13/2026
1.8.0 109 4/13/2026