dotnet / dotnet/command-line-api

Interactive mode and tab completion

Open
#1,319 3 comments 2 reactions 0 assignees View on GitHub
Area-Completions enhancement
Dominant language
C#
Stars
3.7k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

There are some command line programs that are resource intensive to start, most of them provide interactive mode.
My app's interactive mode implementation:

```csharp
while (true)
{
Console.Write("> ");
string? args = Console.ReadLine();
if (string.IsNullOrWhiteSpace(args))
{
Log.Warning("No args entered");
continue;
}

await rootCommand.InvokeAsync(args);
}
```

But when I try to add tab completion, I get stuck. Currently, there's no public API to acquire suggestions manually and placing them into console. A build-in interactive mode API would be great.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.