CleanCli 1.0.2
dotnet tool install --global CleanCli --version 1.0.2
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
dotnet tool install --local CleanCli --version 1.0.2
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=CleanCli&version=1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package CleanCli --version 1.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
CleanCli
Scaffold a production-ready .NET 9 Clean Architecture API in seconds.
Install
dotnet tool install -g CleanCli
Usage
cleancli new
Answer a few prompts and your project is ready.
Project name: MyApp
Database: MSSQL / PostgreSQL
Include JWT authentication? Y/N
Include Docker support? Y/N
Output directory: ./MyApp
┌─────────────────────────────────┐
│ Setting │ Value │
│ Project Name │ MyApp │
│ Database │ MSSQL │
│ JWT Auth │ Yes │
│ Docker │ Yes │
│ Output │ ./MyApp │
└─────────────────────────────────┘
Generate project? Y
✓ Project generated successfully!
cd ./MyApp
dotnet restore
dotnet run --project src/MyApp.Api
What Gets Generated
MyApp/
├── src/
│ ├── MyApp.Api # Controllers, Program.cs, middleware
│ ├── MyApp.Application # MediatR handlers, FluentValidation, DI
│ ├── MyApp.Domain # Result<T>, Error, ErrorType
│ ├── MyApp.Infrastructure # Dapper, DbConnectionFactory, DI
│ └── MyApp.Contracts # Request/response DTOs
├── tests/
├── Dockerfile # (if Docker selected)
├── docker-compose.yml # (if Docker selected)
└── MyApp.sln
Stack
| Layer | Tech |
|---|---|
| API | ASP.NET Core 9, Serilog, Swagger |
| Application | MediatR, FluentValidation |
| Infrastructure | Dapper, MSSQL or PostgreSQL |
| Auth | JWT Bearer (optional) |
| Containers | Docker + docker-compose (optional) |
Patterns Included
- Result/Error pattern —
Result<T>,Error,ErrorTypeout of the box, no exceptions for control flow - MediatR pipeline — ValidationBehavior wired up automatically
- Global exception middleware — unhandled exceptions caught and returned as clean JSON
- CorrelationId middleware —
X-Correlation-IDheader auto-generated or forwarded on every request - DI wired per layer — each layer has its own
DependencyInjection.csextension method
Requirements
Uninstall
dotnet tool uninstall -g CleanCli
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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.