Use dotnet new netcorepal-web to quickly create a CleanDDD dotnet project. The script only serves as an optional wrapper; agents/non-interactive scenarios can directly call dotnet.
When to use
- Create a CleanDDD solution from scratch, or need to quickly generate a runnable boilerplate in a new directory.
- When an existing old template needs to be upgraded, you can regenerate in a new directory and then migrate the code.
Prerequisite inputs
Framework(defaultnet10.0): optionalnet8.0/net9.0/net10.0Database(defaultMySql): optionalMySql/SqlServer/PostgreSQL/Sqlite/GaussDB/DMDB/MongoDBMessageQueue(defaultRabbitMQ): optionalRabbitMQ/Kafka/AzureServiceBus/AmazonSQS/NATS/RedisStreams/PulsarUseAspire(defaulttrue):true/falseIncludeCopilotInstructions(defaultfalse):true/falseProjectName(default current directory name, automatically converted to PascalCase,-replaced with.)OutputDir(default current directory path)
Before executing the command: show the parameter summary and optional items, and continue only after obtaining user confirmation.
How to run (dotnet)
- Install the template (if not installed/needs updating)
dotnet new install NetCorePal.Template
- Create the project (example parameters, replace as needed)
dotnet new netcorepal-web \
--Framework net10.0 \
--Database MySql \
--MessageQueue RabbitMQ \
--UseAspire true \
--name My.Project \
--IncludeCopilotInstructions false \
--output /path/to/target
Before executing dotnet new , first show the user the summary of the above parameters while providing optional parameters and obtain explicit confirmation, then execute the command after confirmation.
Optional script (interactive)
If parameter validation/interactive collection is needed, a wrapper script is available:
python3 scripts/interactive_init.py [同上参数,可省略进入交互]
- When parameters are omitted, it enters interactive mode, and a command preview is shown before running.
- By default automatically installs/updates
NetCorePal.Template, if already installed you can add--skip-template-install。 - Whether called by script or agent, the parameter summary should be shown before execution and the user should be asked for confirmation.
Parameter confirmation prompt (example)
- "Preparing to execute the cleanddd template: Framework=net10.0, Database=MySql, MessageQueue=RabbitMQ, UseAspire=true, IncludeCopilotInstructions=false, ProjectName=My.Project, OutputDir=/path. Continue?"