A powerful CLI tool for rapidly bootstrapping .NET modular monolith applications with clean architecture, PostgreSQL, Docker support, and best practices built-in.
- ✅ Initialize complete .NET solution with API and SharedKernel projects
- ✅ Add new modules with database context, DI setup, and folder structure
- ✅ Automatic dependency injection aggregation
- ✅ DbUp migration management with versioned and repeatable scripts
- ✅ Docker multi-stage builds with chiseled runtime images
- ✅ Structured logging with Serilog (JSON format for observability)
- ✅ Global exception handling and model validation
- .NET SDK 10.0 or later
dotnet-eftool (for Entity Framework migrations)dotnet tool install --global dotnet-ef
- PostgreSQL (for local development)
- Docker (optional, for containerized deployment)
-
Configure NuGet to use GitHub Packages
Create or update
%APPDATA%\NuGet\NuGet.Config(Windows) or~/.nuget/NuGet/NuGet.Config(Linux/macOS):<?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> <add key="github-modmon" value="https://nuget.pkg.github.com/MarcelleBond/index.json" /> </packageSources> <packageSourceCredentials> <github-modmon> <add key="Username" value="YOUR_GITHUB_USERNAME" /> <add key="ClearTextPassword" value="YOUR_GITHUB_PAT" /> </github-modmon> </packageSourceCredentials> </configuration>
Replace
YOUR_GITHUB_USERNAMEandYOUR_GITHUB_PATwith your GitHub username and Personal Access Token (withread:packagespermission). -
Install the tool globally
dotnet tool install --global ModMon --version 1.0.0
-
Verify installation
modmon --help
dotnet tool update --global ModMondotnet tool uninstall --global ModMonmodmon init --name MyProject
cd MyProjectThis creates:
MyProject.sln- Solution fileMyProject.Api- ASP.NET Core Web API projectMyProject.SharedKernel- Shared kernel libraryDockerfileanddocker-compose.yml- Docker configuration
modmon module add --name OrdersThis creates a complete module with:
- Database context and migrations
- Dependency injection setup
- Folder structure for controllers, services, models, etc.
- Automatic integration with the API project
# Using .NET CLI
dotnet run --project MyProject.Api
# Using Docker
docker-compose up --buildmodmon --help
modmon -hmodmon init --name <ProjectName> [--output <Path>]Options:
--name(required): Name of the project--output(optional): Target directory (defaults to current directory)
Example:
modmon init --name ECommerce
modmon init --name ECommerce --output C:\Projects\MyAppmodmon module add --name <ModuleName> [--output <Path>]Options:
--name(required): Name of the module--output(optional): Path to search for .sln file (defaults to current directory)
Example:
modmon module add --name Products
modmon module add --name Customers --output C:\Projects\MyAppmodmon info [--path <Path>] [--format json]modmon validate [--path <Path>] [--format json]modmon module list [--path <Path>] [--format json]All commands support --format json for machine-readable output:
modmon init --name MyApp --format json
modmon info --format json
modmon validate --format jsonPreview changes without making them:
modmon init --name MyApp --dry-run --format json
modmon module add --name Users --dry-run --format jsonEnable detailed logging:
modmon init --name MyApp --verbose
modmon module add --name Users --verbose --log-file modmon.log- User Guide - Comprehensive user documentation
- AI Agent Guide - Machine-readable documentation for AI agents
dotnet build
dotnet run -- init --name TestProjectdotnet pack --configuration ReleaseThe package will be created in ./nupkg/ModMon.1.0.0.nupkg.
dotnet tool install --global --add-source ./nupkg ModMonThe project includes a GitHub Actions workflow that automatically publishes to GitHub Packages when you create a version tag:
git tag v1.0.0
git push origin v1.0.0Or manually trigger the workflow from GitHub Actions with a version number.
MyProject/
├── MyProject.sln
├── Dockerfile
├── docker-compose.yml
├── MyProject.Api/
│ ├── Program.cs
│ ├── appsettings.json
│ ├── appsettings.Development.json
│ └── Extensions/
│ ├── DependencyInjection.cs
│ └── SerilogExtensions.cs
├── MyProject.SharedKernel/
│ ├── Common/
│ ├── Database/Entities/
│ ├── Exceptions/
│ ├── Extensions/
│ └── Middleware/
└── MyProject.Orders/
├── AutoMapperProfiles/
├── Controllers/
├── Database/
│ ├── OrdersDbContext.cs
│ ├── Entities/
│ ├── Migrations/
│ └── Scripts/
├── Exceptions/
├── Extensions/
├── Interfaces/
├── Models/
└── Services/
MIT