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
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
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package CleanArchScaffolder --version 1.9.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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)
AppDbContextandIAppDbContextscaffolded and registeredDependencyInjectionextension methods in Application and InfrastructureProgram.csconfigured with controllers, OpenAPI, and Scalar- Connection string pre-configured in
appsettings.json .gitignore(standard Visual Studio template)
Prerequisites
- .NET 10 SDK or later
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 | 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.