nmbl Documentation
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage
Edit page

new - Create from Ardalis Templates

Overview

The new command is a thin wrapper around dotnet new that forwards all arguments to the .NET CLI template engine. It is intended for use with Ardalis project templates. When called with no arguments it displays usage information.

Note: This command only works with templates that have already been installed via dotnet new install. It does not install templates itself.

Syntax

nmbl new <template-short-name> [options]

Arguments

  • template-short-name - The short name of an installed dotnet new template (e.g., clean-arch).

Options

All options are forwarded verbatim to dotnet new. Common options include:

  • -o, --output <path> - Location to place the generated output.
  • -n, --name <name> - Name for the output being created.
  • --dry-run - Display a summary of what would happen without creating any files.
  • --force - Force content generation even if it changes existing files.

Any other valid dotnet new option for the chosen template is also accepted.

Exit Codes

  • 0 - The dotnet new process exited successfully, or no arguments were supplied (usage display).
  • 1 - The dotnet process could not be started or an unexpected error occurred.
  • Other — The exit code returned by dotnet new is passed through unchanged.

Examples

Display usage information

nmbl new

Install an Ardalis template, then scaffold

# Install the template first
dotnet new install Ardalis.CleanArchitecture.Template

# Scaffold a new solution
nmbl new clean-arch -o MyProject

Scaffold with a specific name

nmbl new clean-arch -o MyProject -n MyApp

Preview what would be created

nmbl new clean-arch --dry-run

Force overwrite of existing files

nmbl new clean-arch -o MyProject --force

Installing Ardalis templates

Templates must be installed before use:

dotnet new install Ardalis.CleanArchitecture.Template

To list all currently installed templates:

dotnet new list
  • Use dotnet sln to manage solution files after scaffolding.
  • Use dotnet add reference to wire up project references.