dotnet / machinelearning-modelbuilder

Simple UI tool to build custom machine learning models.
Creative Commons Attribution 4.0 International
264 stars 56 forks source link

Set up CLI suggestions (tab-based auto-completion) doesn't work. #1404

Closed vzhuqin closed 3 years ago

vzhuqin commented 3 years ago

System Information (please complete the following information):

To Reproduce Steps to reproduce the behavior: 1.After install tool ML.NET CLI, on PowerShell, run below: dotnet tool install dotnet-suggest -g echo $profile

  1. Copy the contents of dotnet-suggest-shim.ps1 to myPowerShell profile;
  2. Scroll down to '....'
  3. See error

Expected behavior Set up CLI suggestions (tab-based auto-completion) can work.

Screenshots image

Additional context https://docs.microsoft.com/en-us/dotnet/machine-learning/how-to-guides/install-ml-net-cli

vzhuqin commented 3 years ago

The doc was removed from the original https://docs.microsoft.com/en-us/dotnet/machine-learning/how-to-guides/install-ml-net-cli , could someone provide the new docs to verify?

luisquintanilla commented 3 years ago

@LittleLittleCloud after the dotnet-suggest updates merged, what are the setup instructions (if any) to get this working on the CLI? Is it the same as the instructions that were removed from the doc?


Set up CLI suggestions (tab-based auto-completion)

Since the ML.NET CLI is based on System.CommandLine, it has built-in support for tab completion.

An example of how tab auto completion works is shown in the following animation:

image

'Tab-based auto-completion' (parameter suggestions) works on Windows PowerShell and macOS/Linux bash but it won't work on Windows CMD.

To enable it, in the current preview version, the end user has to take a few steps once per shell, outlined below. Once this is done, completions will work for all apps written using System.CommandLine such as the ML.NET CLI.

On the machine where you'd like to enable completion, you'll need to do two things.

  1. Install the dotnet-suggest global tool by running the following command:

    dotnet tool install dotnet-suggest -g
  2. Add the appropriate shim script to your shell profile. You may have to create a shell profile file. The shim script will forward completion requests from your shell to the dotnet-suggest tool, which delegates to the appropriate System.CommandLine-based app.

    • For bash, add the contents of dotnet-suggest-shim.bash to ~/.bash_profile.

    • For PowerShell, add the contents of dotnet-suggest-shim.ps1 to your PowerShell profile. You can find the expected path to your PowerShell profile by running the following command in your console:

    echo $profile

(For other shells, look for or open an issue.)

LittleLittleCloud commented 3 years ago

@luisquintanilla Yes, the setup step is identical with previous cli.

https://github.com/dotnet/command-line-api/blob/main/docs/Features-overview.md#Suggestions

luisquintanilla commented 3 years ago

Great. Thanks