<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/extending-net-cli-with-custom-tools---dotnet-init-initializes-your-nuget-package-2hoa5q8y6" -->

---
title: Extending .NET CLI with custom tools - dotnet init...
description: A walkthrough of building a custom .NET CLI tool, dotnet init, which prompts developers for NuGet package metadata (package id, version, description, etc.) and...
canonical: https://daily.dev/posts/extending-net-cli-with-custom-tools---dotnet-init-initializes-your-nuget-package-2hoa5q8y6
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Extending .NET CLI with custom tools - dotnet init initializes your NuGet package | daily.dev
og:description: A walkthrough of building a custom .NET CLI tool, dotnet init, which prompts developers for NuGet package metadata (package id, version, description, etc.) and...
og:url: https://daily.dev/posts/extending-net-cli-with-custom-tools---dotnet-init-initializes-your-nuget-package-2hoa5q8y6
og:image: https://api.daily.dev/og/posts/2hOa5Q8Y6.png
og:image:alt: Extending .NET CLI with custom tools - dotnet init initializes your NuGet package
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Extending .NET CLI with custom tools - dotnet init initializes your NuGet package

**[Maarten Balliauw](https://daily.dev/sources/maartenballiauw)** · 4 min read · 0 upvotes · 0 comments

## Summary

A walkthrough of building a custom .NET CLI tool, dotnet init, which prompts developers for NuGet package metadata (package id, version, description, etc.) and writes it into the new .csproj format. The piece also explains the general pattern for extending the dotnet command: creating a console app named dotnet-<something>, packaging it with the DotnetCliTool package type, and publishing it so others can reference it via DotNetCliToolReference. Context is given on the .NET Core 1.1 era shift from project.json back to a simplified .csproj format.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.maartenballiauw.be/posts/2017-04-10-extending-dotnet-cli-with-custom-tools>

## Questions this post answers

### How do I create a custom dotnet CLI tool like dotnet ef or dotnet init?

Create a console application whose output assembly is named dotnet-<something> so the CLI can locate it, then package it as a NuGet package with the MSBuild property PackageType set to DotnetCliTool (case-sensitive) and GeneratePackageOnBuild set to true. Publish the package so others reference it via the DotNetCliToolReference item in their csproj, and running dotnet <something> launches dotnet-<something>.exe with the passed arguments.

_daily.dev surfaces practical walkthroughs like this for developers building their own dotnet CLI extensions._

### What MSBuild properties are needed to turn a .NET Core console app into a dotnet CLI tool package?

The two key properties are PackageType, set to DotnetCliTool (case-sensitive), which marks the package as a CLI tool, and GeneratePackageOnBuild, set to true, which produces the NuGet package on build. Combined with an AssemblyName of dotnet-<toolname> and OutputType of Exe, building the project produces a ready-to-reference tools package.

_Developers packaging internal tooling check details like this on daily.dev before wiring up csproj properties._

## Similar posts on daily.dev

- [The Complete Guide to Creating NuGet Packages in .NET](https://daily.dev/posts/the-complete-guide-to-creating-nuget-packages-in-net-4carsceoo) · We Are .NET · 0 upvotes · 0 comments
- [6 Steps for Setting Up a New .NET Project the Right Way](https://daily.dev/posts/6-steps-for-setting-up-a-new-net-project-the-right-way-fjdpiz9bk) · Milan Jovanović · 36 upvotes · 0 comments
- [C\# Finally Has First-Class CLI Scripts in .NET 10](https://daily.dev/posts/c-finally-has-first-class-cli-scripts-in-net-10-r3hjflu70) · Atomic Spin · 31 upvotes · 2 comments
- [One shot tool execution in .NET 10](https://daily.dev/posts/one-shot-tool-execution-in-net-10-uysfibjfu) · The Art of Simplicity · 4 upvotes · 1 comments

---

Tags: [#.net](https://daily.dev/tags/.net), [#nuget](https://daily.dev/tags/nuget)

[View this post on daily.dev](https://daily.dev/posts/extending-net-cli-with-custom-tools---dotnet-init-initializes-your-nuget-package-2hoa5q8y6)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Extending .NET CLI with custom tools - dotnet init initializes your NuGet package","url":"https://daily.dev/posts/extending-net-cli-with-custom-tools---dotnet-init-initializes-your-nuget-package-2hoa5q8y6","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/extending-net-cli-with-custom-tools---dotnet-init-initializes-your-nuget-package-2hoa5q8y6"},"datePublished":"2026-10-04T13:04:10.266Z","dateModified":"2026-10-04T13:05:01.778Z","description":"A walkthrough of building a custom .NET CLI tool, dotnet init, which prompts developers for NuGet package metadata (package id, version, description, etc.) and...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/062b82d44d0f58b37f4f559ae646985b?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/062b82d44d0f58b37f4f559ae646985b?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Maarten Balliauw","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Maarten Balliauw","logo":"https://media.daily.dev/image/upload/s--rOTg3VYO--/f_auto,q_auto/v1791119043/logos/maartenballiauw?_a=BAMAMicg0","url":"https://daily.dev/sources/maartenballiauw"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/extending-net-cli-with-custom-tools---dotnet-init-initializes-your-nuget-package-2hoa5q8y6","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":".net,nuget","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Maarten Balliauw","item":"https://daily.dev/sources/maartenballiauw"},{"@type":"ListItem","position":3,"name":"Extending .NET CLI with custom tools - dotnet init initializes your NuGet package"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/extending-net-cli-with-custom-tools---dotnet-init-initializes-your-nuget-package-2hoa5q8y6#faq","mainEntity":[{"@type":"Question","name":"How do I create a custom dotnet CLI tool like dotnet ef or dotnet init?","acceptedAnswer":{"@type":"Answer","text":"Create a console application whose output assembly is named dotnet-<something> so the CLI can locate it, then package it as a NuGet package with the MSBuild property PackageType set to DotnetCliTool (case-sensitive) and GeneratePackageOnBuild set to true. Publish the package so others reference it via the DotNetCliToolReference item in their csproj, and running dotnet <something> launches dotnet-<something>.exe with the passed arguments. daily.dev surfaces practical walkthroughs like this for developers building their own dotnet CLI extensions."}},{"@type":"Question","name":"What MSBuild properties are needed to turn a .NET Core console app into a dotnet CLI tool package?","acceptedAnswer":{"@type":"Answer","text":"The two key properties are PackageType, set to DotnetCliTool (case-sensitive), which marks the package as a CLI tool, and GeneratePackageOnBuild, set to true, which produces the NuGet package on build. Combined with an AssemblyName of dotnet-<toolname> and OutputType of Exe, building the project produces a ready-to-reference tools package. Developers packaging internal tooling check details like this on daily.dev before wiring up csproj properties."}}]}
```

