templating icon indicating copy to clipboard operation
templating copied to clipboard

Improve CLI experience for new projects

Open andrebaltieri opened this issue 4 years ago • 8 comments
trafficstars

Today we have a lot of templates and if you're starting on .NET is difficult to choose between them. Is also difficult to see what templates I can use... need to Google that.

If you're using Visual Studio, everything is more clear, the templates are organized and we have a GUI for that. But I think we have a lot of developers working through CLI, using VS Code.

The idea here is to have a global .NET command that show some selectable options on terminal, as Angular does when you start a new App.

For example dotnet new will show some questions to help me on creating my app.

dotnet new
  - Web application (ASP.NET/Blazor)
  - Mobile Application (MAUI)
  - Console Application
  ...

We can have more options after selecting the first one, and goes on. You got the idea.

Please, let me know if this make sense.

andrebaltieri avatar May 26 '21 11:05 andrebaltieri

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

Closing here since I think dotnet/cli is the right place for this issue!

andrebaltieri avatar May 26 '21 11:05 andrebaltieri

Reopening since dotnet/cli was moved to here :) sry!

andrebaltieri avatar May 26 '21 11:05 andrebaltieri

@KathleenDollard could you please check it? should it be part of the parser (to some extend)?

vlada-shubina avatar Jun 14 '21 11:06 vlada-shubina

We've talked a bit about having a more guided CLI experience for when we can detect an 'interactive' session. That would essentially prompt the user for input for arguments/options that are required to create the template. I think dotnet new would be the perfect entrypoint for this kind of experience - if no template is specified and we're in an interactive context (i.e. is a TTY and stdin isn't redirected, etc), then we should be able to have a much more interactive experience.

We could really go wild here - there are node.js/rich/Spectre.Console-style prompts for choices, multi-selects, etc. But you quickly get into spaces where you want a higher-level abstraction over the raw input/output. We might need to coordinate with System.CommandLine for this.

baronfel avatar Apr 18 '22 18:04 baronfel

Love it! I’ve wanted this since we first started this project.

sayedihashimi avatar Apr 18 '22 18:04 sayedihashimi

In case we get some support from System.CommandLine, it would be definitely a good feature to do. However, implementing interactive mode just for dotnet new might be unreasonably much effort. Also, it makes sense to enable it SDK-wide, not only for dotnet new.

vlada-shubina avatar Apr 19 '22 10:04 vlada-shubina

Feature request for interactive mode in System.CommandLine: https://github.com/dotnet/command-line-api/issues/1319

vlada-shubina avatar Jul 14 '22 11:07 vlada-shubina

We merged this issue with https://github.com/dotnet/templating/issues/6024. Please follow up there, sorry for inconvenience.

vlada-shubina avatar May 18 '23 12:05 vlada-shubina