OnionForge.Cli
1.2.0
dotnet tool install --global OnionForge.Cli --version 1.2.0
dotnet new tool-manifest
dotnet tool install --local OnionForge.Cli --version 1.2.0
#tool dotnet:?package=OnionForge.Cli&version=1.2.0
nuke :add-package OnionForge.Cli --version 1.2.0
OnionForge.Cli
🚀 Enterprise Onion Architecture + DDD + CQRS + AI Code Generation for .NET
OnionForge is a powerful enterprise-grade .NET architecture generator designed for modern backend development using:
- Onion Architecture
- Domain-Driven Design (DDD)
- CQRS
- MediatR
- FluentValidation
- Minimal APIs
- EF Core
- Repository + Unit of Work
- Outbox Pattern
- OpenTelemetry-ready architecture
- Docker-ready infrastructure
- AI-powered focused code generation
✨ Features
✅ Onion Architecture solution generation ✅ DDD aggregate generation ✅ CQRS command/query/handler generation ✅ Minimal API endpoint generation ✅ FluentValidation integration ✅ Repository + Unit of Work scaffolding ✅ EF Core configuration generation ✅ Outbox Pattern support ✅ Docker support ✅ OpenTelemetry support ✅ AI-assisted focused code generation ✅ Enterprise-ready project structure
📦 Installation
Install globally
dotnet tool install --global OnionForge.Cli
Update
dotnet tool update --global OnionForge.Cli
Verify
onionforge --help
🚀 Quick Start
Create a new Onion Architecture solution
onionforge new-solution \
--name EStore \
--namespace EStore \
--output "D:\Projects\EStore"
🧱 Generate DDD Aggregate
onionforge add-aggregate \
--name Product \
--module Catalog \
--properties "Name:string,Price:decimal"
⚡ Generate CQRS Command
onionforge add-command \
--name CreateProduct \
--module Catalog \
--properties "Name:string,Price:decimal"
🔍 Generate CQRS Query
onionforge add-query \
--name GetProductById \
--module Catalog \
--properties "Id:Guid"
🧠 Generate Handler
onionforge add-handler \
--name CreateProduct \
--module Catalog \
--type command \
--properties "Name:string,Price:decimal"
🌐 Generate Minimal API Endpoint
onionforge add-endpoint \
--name CreateProduct \
--module Catalog \
--type command \
--http post \
--route "/api/catalog/products"
🔥 Generate Full CRUD
onionforge add-crud \
--entity Product \
--module Catalog \
--properties "Name:string,Price:decimal"
This generates:
- Aggregate
- Repository
- Commands
- Queries
- Handlers
- Validators
- Minimal API endpoints
- EF configurations
📡 Add Outbox Pattern
onionforge add-outbox
🐳 Add Docker Support
onionforge add-docker
📈 Add OpenTelemetry
onionforge add-otel
🤖 AI Code Generation
Generate focused architecture-compliant code using AI.
Setup
setx OPENAI_API_KEY "your_api_key"
setx ONIONFORGE_AI_MODEL "gpt-4o-mini"
Generate AI Code
onionforge ai-code \
--name CreateOrder \
--module Orders \
--kind command \
--prompt "Create order with inventory validation and domain events"
AI generation is intentionally focused and compile-friendly.
🏗 Generated Architecture
src/
App.Api
App.Application
App.Domain
App.Infrastructure
tests/
App.UnitTests
App.IntegrationTests
🛠 Tech Stack
- .NET 10
- ASP.NET Core
- EF Core
- MediatR
- FluentValidation
- Minimal APIs
- Serilog
- OpenTelemetry
💡 Perfect For
- Enterprise APIs
- SaaS platforms
- ERP systems
- E-Commerce systems
- Modular monoliths
- Microservices
- Cloud-native applications
📌 Vision
OnionForge aims to become the ultimate enterprise architecture accelerator for modern .NET development by combining AI with proven architectural patterns.
Built by developers. Designed for real-world enterprise systems.
👨💻 Author
Raheel Ahmed
- Solution Architect
- Principal Software Architect
- Enterprise .NET Specialist
📄 License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. 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 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. |
This package has no dependencies.