TypedRest.CommandLine 1.6.6

There is a newer version of this package available.
See the version list below for details.
dotnet add package TypedRest.CommandLine --version 1.6.6
                    
NuGet\Install-Package TypedRest.CommandLine -Version 1.6.6
                    
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="TypedRest.CommandLine" Version="1.6.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TypedRest.CommandLine" Version="1.6.6" />
                    
Directory.Packages.props
<PackageReference Include="TypedRest.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 TypedRest.CommandLine --version 1.6.6
                    
#r "nuget: TypedRest.CommandLine, 1.6.6"
                    
#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 TypedRest.CommandLine@1.6.6
                    
#: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=TypedRest.CommandLine&version=1.6.6
                    
Install as a Cake Addin
#tool nuget:?package=TypedRest.CommandLine&version=1.6.6
                    
Install as a Cake Tool

TypedRest CommandLine

Build command-line interfaces for TypedRest clients.

dotnet add package TypedRest.CommandLine

Mirror your endpoints with the command types in the TypedRest.CommandLine.Commands namespace. Each command type knows how to map console arguments onto the methods of the matching endpoint type, so myapp contacts create … ends up calling client.Contacts.CreateAsync(…):

class MyCommand : EntryCommand<MyClient>
{
    public MyCommand(MyClient client)
        : base(client)
    {
        Add("contacts", x => new CollectionCommand<Contact>(x.Contacts));
    }
}

Then hand the arguments to an Executor, which builds the endpoint and command, runs it and turns exceptions into exit codes:

static Task<int> Main(string[] args)
    => new Executor<MyClient, MyCommand>().RunAsync(args);

Executor is the piece you call from Main(). It asks an IEndpointProvider for the entry endpoint, constructs the root command for it, hands it the arguments and turns any exception thrown along the way into a message on stderr and a non-zero exit code.

By default the entry endpoint is built by CliEndpointProvider<T>, which reads the URI and OAuth token from config files or prompts for them interactively. Pass your own IEndpointProvider<T> to the Executor constructor to change that.

Splitting out the endpoint provider keeps the question of where the API lives and how to authenticate against it separate from what the commands do. The default implementation stores the API URI and a cached OAuth token in the user's application data directory and prompts for whatever is missing; it only does so when running interactively, so the same binary can be used in scripts. Derive from EndpointProviderBase to change where those settings come from, or implement IEndpointProvider yourself and pass it to the Executor constructor.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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
1.7.0 35 8/2/2026
1.6.6 38 8/1/2026
1.6.5 128 5/17/2026
1.6.4 126 5/2/2026
1.6.3 158 2/15/2026
1.6.2 177 12/20/2025
1.6.1 274 9/8/2025
1.6.0 278 12/15/2024
1.5.4 273 9/8/2024
1.5.3 281 7/7/2024
1.5.2 333 12/27/2023
1.5.1 287 10/4/2023
1.5.0 280 10/3/2023
1.4.1 270 10/1/2023
1.4.0 338 9/30/2023
1.3.8 480 3/12/2023
1.3.7 585 11/28/2022
1.3.6 1,437 11/29/2021
1.3.5 600 9/5/2021
1.3.4 694 1/29/2021
Loading failed