cleanddd-dotnet-init
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecleanddd dotnet init
CleanDDD Dotnet Initialization
使用 快速创建 CleanDDD dotnet 项目。脚本仅作为可选包装,代理/非交互场景可直接调用 dotnet。
dotnet new netcorepal-webUse to quickly create CleanDDD dotnet projects. The script is only an optional wrapper; you can directly call dotnet in agent/non-interactive scenarios.
dotnet new netcorepal-web使用时机
Usage Scenarios
- 从零新建 CleanDDD 解决方案,或需要在新目录快速生成可运行样板。
- 已有旧模板需升级时,可在新目录重新生成后迁移代码。
- Create a CleanDDD solution from scratch, or quickly generate a runnable boilerplate in a new directory.
- When an existing old template needs to be upgraded, regenerate it in a new directory and then migrate the code.
前置输入
Prerequisite Inputs
- (default
Framework): 可选net10.0/net8.0/net9.0net10.0 - (default
Database): 可选MySql/MySql/SqlServer/PostgreSQL/Sqlite/GaussDB/DMDBMongoDB - (default
MessageQueue): 可选RabbitMQ/RabbitMQ/Kafka/AzureServiceBus/AmazonSQS/NATS/RedisStreamsPulsar - (default
UseAspire):true/truefalse - (default
IncludeCopilotInstructions):false/truefalse - (default 当前目录名,自动转 PascalCase,
ProjectName替换为-). - (default 当前目录路径)
OutputDir
在执行命令前:展示参数汇总及可选项,获得用户确认后再继续。
- (default
Framework): Optional values:net10.0/net8.0/net9.0net10.0 - (default
Database): Optional values:MySql/MySql/SqlServer/PostgreSQL/Sqlite/GaussDB/DMDBMongoDB - (default
MessageQueue): Optional values:RabbitMQ/RabbitMQ/Kafka/AzureServiceBus/AmazonSQS/NATS/RedisStreamsPulsar - (default
UseAspire):true/truefalse - (default
IncludeCopilotInstructions):false/truefalse - (default: current directory name, automatically converted to PascalCase,
ProjectNamereplaced with-). - (default: current directory path)
OutputDir
Before executing the command: Display the parameter summary and optional values, and proceed only after obtaining user confirmation.
运行方式(dotnet)
Execution Methods (dotnet)
- 安装模板(如未安装/需更新)
bash
dotnet new install NetCorePal.Template- 创建项目(示例参数,可按需替换)
bash
dotnet new netcorepal-web \
--Framework net10.0 \
--Database MySql \
--MessageQueue RabbitMQ \
--UseAspire true \
--name My.Project \
--IncludeCopilotInstructions false \
--output /path/to/target在执行 前,请先向用户展示上述参数的汇总同时给出可选参数并获得明确确认,确认后再执行命令。
dotnet new- Install the template (if not installed/needs update)
bash
dotnet new install NetCorePal.Template- Create a project (sample parameters, can be replaced as needed)
bash
dotnet new netcorepal-web \
--Framework net10.0 \
--Database MySql \
--MessageQueue RabbitMQ \
--UseAspire true \
--name My.Project \
--IncludeCopilotInstructions false \
--output /path/to/targetBefore executing , please first display the summary of the above parameters along with optional values to the user and obtain explicit confirmation before executing the command.
dotnet new可选脚本(交互)
Optional Script (Interactive)
如需参数校验/交互式收集,可用包装脚本:
bash
python3 scripts/interactive_init.py [同上参数,可省略进入交互]- 省略参数时进入交互模式,运行前会显示命令预览。
- 默认自动安装/更新 ,如已安装可加
NetCorePal.Template。--skip-template-install - 无论脚本或 agent 调用,都应在执行前展示参数汇总并请用户确认。
If you need parameter validation/interactive collection, you can use the wrapper script:
bash
python3 scripts/interactive_init.py [same parameters as above, can be omitted to enter interaction]- Omit parameters to enter interactive mode; a command preview will be displayed before running.
- Automatically installs/updates by default; add
NetCorePal.Templateif it's already installed.--skip-template-install - Whether using the script or agent call, you should display the parameter summary and request user confirmation before execution.
参数确认提示(示例)
Parameter Confirmation Prompt (Example)
- "准备执行 cleanddd 模板:Framework=net10.0, Database=MySql, MessageQueue=RabbitMQ, UseAspire=true, IncludeCopilotInstructions=false, ProjectName=My.Project, OutputDir=/path。是否继续?"
- "Ready to execute the CleanDDD template: Framework=net10.0, Database=MySql, MessageQueue=RabbitMQ, UseAspire=true, IncludeCopilotInstructions=false, ProjectName=My.Project, OutputDir=/path. Do you want to proceed?"