Project Templates
kanject new scaffolds a deploy-ready .NET service from a template — the solution, manifest.json, stage files, an optional test project, and Lambda defaults all wired. The free templates ship inside the CLI (no NuGet feed access needed); a paid catalog adds more.
- Scaffold a service with
kanject new <template> --name - Choose between the three free templates —
webapi,minimal-api,tasks - Tune the scaffold with
--framework,--auth-provider, and--include-tests - Understand the free vs paid template catalogs
Scaffold a service
kanject new [template] [--name <Name>] installs or refreshes the bundled template pack, runs dotnet new, then runs kanject init. In a terminal, omitted inputs are progressive: choose the template first, then enter the project name. CI and redirected input must supply both.
# Scaffold a deploy-ready service from a templatekanject new webapi --name Acme.Analytics# Or choose a template, then enter the project name interactivelykanject new# Tune the scaffold with template optionskanject new webapi --name Acme.Api \ --framework net10.0 --auth-provider none --include-tests false The free templates
Three templates ship with the CLI itself:
Options
--framework—net8.0(default),net9.0, ornet10.0.--auth-provider—jwt(default) ornone. Applies towebapi.--include-tests—true(default) /false; scaffolds a wired xUnit project.--name/--output— the service name and where it lands.--non-interactive— never prompt; requires complete inputs and either--skip-initor--yes.--yes— explicitly accept onboarding defaults and any required confirmation; it is not just a synonym for non-interactive mode.
Free vs paid catalogs
The three above are free and bundled in the CLI — nothing to authenticate, and they update when the CLI does. A paid catalog (--paid, requires a Kanject subscription feed) adds richer starters: a notification hub, an instant-messaging API, a file-server API, and a source-generator project. --paid is sticky once the pack is installed; --free forces the bundled set.
# Pull from the paid catalog (requires a Kanject subscription feed)kanject new notification-hub --name Acme.Notifications --paid Keeping templates current
The free pack is versioned with the CLI, so kanject update (or kanject update --templates-only) refreshes it; kanject new also auto-refreshes before scaffolding. The paid pack flows through your subscription feed, and new runs a background update check before it creates the project.
Add another function
Inside an existing service, bare kanject add function shows the available function-capable templates, then asks for the function name. Supply only the template to skip the picker and answer the name prompt; automation must pass both, for example kanject add function tasks --name Acme.Worker --non-interactive.
Guidelines
- Pick by shape:
webapifor a controller-based REST API,minimal-apifor a lean API surface,tasksfor queue / event workers with no HTTP. - Keep
--include-tests true. The xUnit project is already wired — cheap to keep, costly to bolt on later. - Pin
--frameworkto your team's target rather than drifting on thenet8.0default. - Use
--auth-provider nonewhen auth is terminated at the edge (an API Gateway authorizer) rather than in the app. - Make CI intent explicit: pass the template and name, add
--non-interactive, and use--yesonly when the workflow intends to approve initialization or template installation.
kanject new <template> --namescaffolds a deploy-ready service: solution, manifest, stages, tests, Lambda defaults.- Three free templates ship in the CLI —
webapi,minimal-api,tasks— with no feed access required. --framework,--auth-provider, and--include-teststune the scaffold.- A paid catalog (
--paid) adds notification-hub, instant-messaging, file-server, and source-generator starters.