Sdk: Command-line app development and distribution workflow

Created on 6 Feb 2018  Â·  7Comments  Â·  Source: dotnet/sdk

This is kind of related to dotnet/sdk#8443.

Is there an easy way to develop, build and distribute command-line apps in .NET Core 2.0?

  • In Python, you set entry_points in setup.py and install app with pip install -e . during development.
  • In Node.js, you set bin in package.json and install app with npm link during development.
  • In Go, you write a main() function and install app with go install.
  • Etc.

So I understand that we can produce either portable (DLL) or self-contained (EXE) builds with dotnet publish -c <CONFIGURATION> -r <RUNTIME_IDENTIFIER>, but what happens next?

Most helpful comment

Thank you for your input.

You're "What's hard" largely aligns with our backlog and we'll keep it in our considerations.

We are working on the argument story. Nate McMaster's library is not a bad place to be right now. We're hoping to do better.

Kathleen


From: Arthur White notifications@github.com
Sent: Wednesday, February 7, 2018 2:40 PM
To: dotnet/cli
Cc: Kathleen Dollard; Mention
Subject: Re: [dotnet/cli] Command-line app development and distribution workflow (#8547)

What's easy

  • Almost everything: no major difficulty with NuGet so far.
  • Searching and downloading packages directly from Visual Studio (Code|Mac).
    The integration is nice!
  • Automatical dependency management and cleaning.

What's hard

What isn't there

How difficult is setting up argument management and help

I don't have a definitive opinion about this.
Actually, I'm barely digging in the .NET ecosystem as I decided to learn C# only 2 weeks ago.
Making a CLI was just a pretext. 🤓

I use the McMaster.Extensions.CommandLineUtilshttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FMcMaster.Extensions.CommandLineUtils%2F&data=04%7C01%7Ckathleen.dollard%40microsoft.com%7C433323fb37124454e37d08d56e7bd781%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C636536400534247175%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=IXUu2r9AGk330OwsT3JhuZVgr%2FjjDWvMCNs94WEVM3c%3D&reserved=0 package and it does the job pretty well so far.
Too bad it's not a Microsoft "official" package anymore, even if it seems (well) maintained by Microsoft employees. Also, the documentation seems poor compared to something like Python's argparsehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.python.org%2F3%2Flibrary%2Fargparse.html&data=04%7C01%7Ckathleen.dollard%40microsoft.com%7C433323fb37124454e37d08d56e7bd781%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C636536400534247175%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=9Za8AdM%2B9Yrfl96a2QMB7KhCxZFAnDEK9bvlcL1wYLQ%3D&reserved=0.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Fcli%2Fissues%2F8547%23issuecomment-363935924&data=04%7C01%7Ckathleen.dollard%40microsoft.com%7C433323fb37124454e37d08d56e7bd781%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C636536400534247175%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=Cr6DVxELyVqdWAhAMRO4sovVzP66IH4Mrg9REmjwbYY%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAFktXtKIbnZCwsVzGsUYb_cxvCL3fy8aks5tSiZygaJpZM4R73Kr&data=04%7C01%7Ckathleen.dollard%40microsoft.com%7C433323fb37124454e37d08d56e7bd781%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C636536400534247175%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=hfc44YKWRfEFt1T0H6w1%2Feg3Jlsi7Wsr0hKvfVUeTNg%3D&reserved=0.

All 7 comments

cc @KathleenDollard I don't believe this is related only to .NET Core. At least, I can't say so without you saying more about what problem you are trying to address here.

Is your issue the fact that .NET Core Apps are comprissed of multiple files and you are wondering how to distribute them? They were designed to be xcopyable to whatever machine they need to go to.

Is your problem the fact that you are looking for a marketplace like location for your apps? We don't have that for .NET Core.

If your apps are more development centric, we are building a feature called dotnet tools, where you can package your app and distribute it through nuget.org and then install them using the .NET Core SDK through a dotnet install tool -g <tool_package_id> command.

Is your issue the fact that .NET Core Apps are comprissed of multiple files and you are wondering how to distribute them? They were designed to be xcopyable to whatever machine they need to go to.

No, the "multiple files" design should not be an issue here.

Is your problem the fact that you are looking for a marketplace like location for your apps? We don't have that for .NET Core.

OK, that answers part of the question.

But at least, I'd like to easily "install" my console app under a system-wide, custom command during development, like I'd do with a trivial npm link for example.

Because actually, to get a custom command:

  • When we generate self-contained builds, we must manually move the binary + assets inside /usr/local/share/ (on Unix-like, I don't know about Windows).
  • When we generate a portable console app, it's impossible… The DLL must be called in conjunction with the dotnet <PATH_TO_DLL> command.

That's not intuitive at all.

Are you looking for npm -g?

That we are building. dotnet install tool -g

We will not have a marketplace, we will have NuGet.

Does that help? If so I can give you more information on it.


From: Arthur White notifications@github.com
Sent: Tuesday, February 6, 2018 4:20 PM
To: dotnet/cli
Cc: Kathleen Dollard; Mention
Subject: Re: [dotnet/cli] Command-line app development and distribution workflow (#8547)

Is your issue the fact that .NET Core Apps are comprissed of multiple files and you are wondering how to distribute them? They were designed to be xcopyable to whatever machine they need to go to.

No, the "multiple files" design should not be an issue here.

Is your problem the fact that you are looking for a marketplace like location for your apps? We don't have that for .NET Core.

OK, that answers part of the question.

But at least, I'd like to easily "install" my console app under a system-wide, custom command during development, like I'd do with a trivial npm link for example.

Because actually, to get a custom command:

  • When we generate self-contained builds, we must manually move the binary + assets inside /usr/local/share/ (on Unix-like, I don't know about Windows) to get our custom command.
  • When we generate a portable console app, it' impossible because the DLL must be called in conjunction with the dotnet command.

That's not intuitive at all.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Fcli%2Fissues%2F8547%23issuecomment-363612127&data=04%7C01%7Ckathleen.dollard%40microsoft.com%7Cdee6fc644c4a47c7393508d56dc09f23%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C636535596430379429%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=BGRxyIq7dOJEOeoRR1Nip2Fxarm%2BqzRRnv5cKwtbKUw%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAFktXnVD3EbqeELI-4vo0i894VBS_hsCks5tSOxYgaJpZM4R73Kr&data=04%7C01%7Ckathleen.dollard%40microsoft.com%7Cdee6fc644c4a47c7393508d56dc09f23%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C636535596430379429%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=LKQ0QWrr7DAlbxysLVyRE5gi1I89xlyi2MlHOKohXzM%3D&reserved=0.

Yeah, exactly!

I just searched about these .NET Core Global Tools and I came across the .NET Core 2.1 Roadmap post from last week.

Now I understand that's a WIP.

We will not have a marketplace, we will have NuGet

Sure, I see.
I misunderstood @livarcocc when he talked about a "marketplace" because NPM-like repositories are kind of falling in my definition of a marketplace. 😅

Thank you both!

I'm glad it fits your needs.

I'm very interested in your experience with it. What's hard, what's easy, what do you need that isn't there.

I'm also interested in how difficult setting up argument management and help is for you to do as you develop your tool.


From: Arthur White notifications@github.com
Sent: Tuesday, February 6, 2018 5:52 PM
To: dotnet/cli
Cc: Kathleen Dollard; Mention
Subject: Re: [dotnet/cli] Command-line app development and distribution workflow (#8547)

Yeah, exactly!

I just searched about these .NET Core Global Tools and I came across the .NET Core 2.1 Roadmap posthttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fblogs.msdn.microsoft.com%2Fdotnet%2F2018%2F02%2F02%2Fnet-core-2-1-roadmap%2F&data=04%7C01%7Ckathleen.dollard%40microsoft.com%7C34cacaac9647445ed22808d56dcd6f4f%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C636535651468003896%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=cLqcMPMlNMvzKwFJBzcsvUaP9Q0qWA04G0XFU4UF9WY%3D&reserved=0 from last week.

Now I understand that's a WIP.

We will not have a marketplace, we will have NuGet

Sure, I see.
I misunderstood @livarcocchttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Flivarcocc&data=04%7C01%7Ckathleen.dollard%40microsoft.com%7C34cacaac9647445ed22808d56dcd6f4f%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C636535651468003896%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=Z%2BkeMXlhfMLgR7Syrq6AlMQl9dPhaeb03tYVn2aTvwc%3D&reserved=0 when he talked about a "marketplace" because NPM-like repositories are kind of falling in my definition of a marketplace. 😅

Thank you both!

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Fcli%2Fissues%2F8547%23issuecomment-363628956&data=04%7C01%7Ckathleen.dollard%40microsoft.com%7C34cacaac9647445ed22808d56dcd6f4f%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C636535651468013909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=gxNboKUYAqHp%2FQ%2F4j8kX3e%2F%2BcYJuFcA23uAqAmi5l%2Bw%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAFktXj1boxlfmrtxPdNRWUfvmXrpO1Baks5tSQHXgaJpZM4R73Kr&data=04%7C01%7Ckathleen.dollard%40microsoft.com%7C34cacaac9647445ed22808d56dcd6f4f%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C636535651468013909%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=FI6e0%2BrTMZUPgRZpZkL0RVFf2D5qkn4HU2qkb9nY%2BRE%3D&reserved=0.

What's easy

  • Almost everything: no major difficulty with NuGet so far.
  • Searching and downloading packages directly from Visual Studio (Code|Mac). The integration is nice!
  • Automatic dependency management and cleaning.

What's hard

  • We only see a short summary of each package description so choosing the best one requires a visit to each project site. Integrating READMEs (when available) like NPM does should ease the process.
  • Figuring out the minimal requirements of a package (.NET Core and/or .NET Framework and which version).
  • Not hard but boring: the dialog asking for licenses acceptance at every package install.
  • Package signing but as I see, it's also a WIP.

What isn't there

  • Package search from the CLI like npm search.
  • Sorting search results by total number of downloads rather than "relevance". Thats an old request.
  • Convenient CLI helpers like npm version or npm outdated.
  • Interesting stats about the package code (like test coverage, at least).
  • Maybe an in-browser playground for each package. But I assume that's a lot of work for little benefit.

How difficult is setting up argument management and help

I don't have a definitive opinion about this.
Actually, I'm barely digging in the .NET ecosystem as I decided to learn C# only 2 weeks ago.
Making a CLI was just a pretext. 🤓

I use McMaster.Extensions.CommandLineUtils and it does the job pretty well so far.
Too bad it's not a Microsoft "official" package anymore, even if it seems (well) maintained by Microsoft employees. Also, the documentation seems poor compared to something like Python's argparse.

Thank you for your input.

You're "What's hard" largely aligns with our backlog and we'll keep it in our considerations.

We are working on the argument story. Nate McMaster's library is not a bad place to be right now. We're hoping to do better.

Kathleen


From: Arthur White notifications@github.com
Sent: Wednesday, February 7, 2018 2:40 PM
To: dotnet/cli
Cc: Kathleen Dollard; Mention
Subject: Re: [dotnet/cli] Command-line app development and distribution workflow (#8547)

What's easy

  • Almost everything: no major difficulty with NuGet so far.
  • Searching and downloading packages directly from Visual Studio (Code|Mac).
    The integration is nice!
  • Automatical dependency management and cleaning.

What's hard

What isn't there

How difficult is setting up argument management and help

I don't have a definitive opinion about this.
Actually, I'm barely digging in the .NET ecosystem as I decided to learn C# only 2 weeks ago.
Making a CLI was just a pretext. 🤓

I use the McMaster.Extensions.CommandLineUtilshttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FMcMaster.Extensions.CommandLineUtils%2F&data=04%7C01%7Ckathleen.dollard%40microsoft.com%7C433323fb37124454e37d08d56e7bd781%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C636536400534247175%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=IXUu2r9AGk330OwsT3JhuZVgr%2FjjDWvMCNs94WEVM3c%3D&reserved=0 package and it does the job pretty well so far.
Too bad it's not a Microsoft "official" package anymore, even if it seems (well) maintained by Microsoft employees. Also, the documentation seems poor compared to something like Python's argparsehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.python.org%2F3%2Flibrary%2Fargparse.html&data=04%7C01%7Ckathleen.dollard%40microsoft.com%7C433323fb37124454e37d08d56e7bd781%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C636536400534247175%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=9Za8AdM%2B9Yrfl96a2QMB7KhCxZFAnDEK9bvlcL1wYLQ%3D&reserved=0.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdotnet%2Fcli%2Fissues%2F8547%23issuecomment-363935924&data=04%7C01%7Ckathleen.dollard%40microsoft.com%7C433323fb37124454e37d08d56e7bd781%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C636536400534247175%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=Cr6DVxELyVqdWAhAMRO4sovVzP66IH4Mrg9REmjwbYY%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAFktXtKIbnZCwsVzGsUYb_cxvCL3fy8aks5tSiZygaJpZM4R73Kr&data=04%7C01%7Ckathleen.dollard%40microsoft.com%7C433323fb37124454e37d08d56e7bd781%7Cee3303d7fb734b0c8589bcd847f1c277%7C1%7C0%7C636536400534247175%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=hfc44YKWRfEFt1T0H6w1%2Feg3Jlsi7Wsr0hKvfVUeTNg%3D&reserved=0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joffreykern picture joffreykern  Â·  3Comments

clairernovotny picture clairernovotny  Â·  3Comments

dsplaisted picture dsplaisted  Â·  3Comments

gkhanna79 picture gkhanna79  Â·  3Comments

dasMulli picture dasMulli  Â·  3Comments