Wolfe.CommandLine 0.2.0

dotnet add package Wolfe.CommandLine --version 0.2.0
                    
NuGet\Install-Package Wolfe.CommandLine -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Wolfe.CommandLine" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Wolfe.CommandLine" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Wolfe.CommandLine" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Wolfe.CommandLine --version 0.2.0
                    
#r "nuget: Wolfe.CommandLine, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Wolfe.CommandLine@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Wolfe.CommandLine&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Wolfe.CommandLine&version=0.2.0
                    
Install as a Cake Tool

Wolfe.CommandLine

Wolfe.CommandLine

Wolfe.CommandLine is a set of utility extensions for the System.CommandLine package, including automatic completion registration.

Installation

Installation is as easy as just adding the package:

dotnet package add Wolfe.CommandLine

Usage

Tab completion

System.CommandLine does support suggestions out of the box using dotnet suggest, but they're not wired up anywhere. Your shell needs to know they exist and how to access them, so this utility package puts that wiring in place with a completion command group.

using System.CommandLine;
using Wolfe.CommandLine.Completions;

var root = new RootCommand()
    .AddCompletions("my-app");

This registers:

  • the 'suggest' directive that the completion scripts call back into
  • a completion command group:
    • my-app completion <shell> — emit the script (bash, zsh, fish, pwsh)
    • my-app completion install <shell> — install it
    • my-app completion uninstall <shell> — remove it
How install works

Installation will pick a directory that the shell loads completions from automatically, if one is available, so no startup file is edited:

  • fish~/.config/fish/completions/ (always)
  • bash — the XDG bash-completion user directory (when the bash-completion package is present)
  • zsh — a writable $fpath directory, preferring brew's site-functions (when it exists)

When no such directory is available (always for pwsh), it falls back to a managed # >>> my-app completion >>> block in the shell's startup file. Uninstall sweeps both.

Auto-install

To skip the manual completion install step entirely, call the auto-installer once at startup, before invoking the parsed command:

var root = new RootCommand()
    .AddCompletions("my-app");
await CompletionAutoInstall.Run("my-app", args);
return await root.Parse(args).InvokeAsync();

The first time the app runs, completion is installed for the user's current shell:

  • silently (with a notice on stderr) when there is a directory the shell loads automatically
  • behind a [y/N] prompt when it would have to edit a startup file

It runs at most once per shell, and never throws. It won't prompt unless the terminal is interactive, and if the user declines, their answer is recorded under the XDG state home.

The installed scripts are thin bridges: on tab they run my-app [suggest:<cursor>] "<line>" and feed the candidates back to the shell, so completions always match the installed binary and never go stale.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 128 8/27/2026
0.1.0 93 8/27/2026