Redpoint.CommandLine 2025.1001.421

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Redpoint.CommandLine --version 2025.1001.421                
NuGet\Install-Package Redpoint.CommandLine -Version 2025.1001.421                
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="Redpoint.CommandLine" Version="2025.1001.421" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Redpoint.CommandLine --version 2025.1001.421                
#r "nuget: Redpoint.CommandLine, 2025.1001.421"                
#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.
// Install Redpoint.CommandLine as a Cake Addin
#addin nuget:?package=Redpoint.CommandLine&version=2025.1001.421

// Install Redpoint.CommandLine as a Cake Tool
#tool nuget:?package=Redpoint.CommandLine&version=2025.1001.421                

Redpoint.CommandLine

This library provides APIs for building dependency injected console applications, with both commands and option declarations being dependency injected.

To use this library, first define your command:

internal class SomeAction
{
	public class Options
	{
		public Option<string> SomeOpt = new Option<string>("--opt", "My option description.");

		// Add more fields or properties that use Option<> or Argument<> and they'll be automatically
		// registered to the command line parser.
	}

	public static Command CreateCommand(ICommandBuilder builder)
	{
		return new Command("some-action", "The description of your some-action command.");
	}

	public class CommandInstance : ICommandInstance
	{
        private readonly ILogger<CommandInstance> _logger;
        private readonly Options _options;

        public CommandInstance(
            ILogger<CommandInstance> logger,
            Options options)
        {
            _logger = logger;
            _options = options;
        }

        public Task<int> ExecuteAsync(ICommandInvocationContext context)
        {
            // Example on how to access an option's value.
            var value = context.ParseResult.GetValueForOption(_options.SomeOpt);

            // ... implement your command here ...
            _logger.LogInformation("Hello world!");

            // Return the exit code for the application.
            return Task.FromResult(0);
        }
	}
}

To register and execute commands, in your Program.Main:

// Use the command line builder APIs to build the root command.
var rootCommand = CommandLineBuilder.NewBuilder()
    .AddGlobalRuntimeServices((builder, services) =>
    {
        // Register global runtime services here, such as services.AddLogging(...)
    })
    .SetGlobalExecutionHandler(async (sp, executeCommand) =>
    {
        // Can be used to wrap execution of all commands, such as capturing
        // exceptions and logging them:

        var logger = sp.GetRequiredService<ILogger<Program>>();
        try
        {
            return await executeCommand().ConfigureAwait(true);
        }
        catch (Exception ex)
        {
            logger.LogError(ex, $"Uncaught exception during command execution: {ex}");
            return 1;
        }
    })
    // Add each of your commands like this:
    .AddCommand<SomeAction.CommandInstance, SomeAction.Options>(SomeAction.CreateCommand)
    // Then build the root command to use below.
    .Build("My console application description.");

// Parse and execute the command.
var exitCode = await rootCommand.InvokeAsync(args).ConfigureAwait(false);
await Console.Out.FlushAsync().ConfigureAwait(false);
await Console.Error.FlushAsync().ConfigureAwait(false);
Environment.Exit(exitCode);
throw new BadImageFormatException();
Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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. 
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
2025.1025.723 0 1/25/2025
2025.1025.712 0 1/25/2025
2025.1019.913 69 1/19/2025
2025.1018.374 68 1/18/2025
2025.1018.285 60 1/18/2025
2025.1017.646 67 1/17/2025
2025.1017.379 76 1/17/2025
2025.1016.1370 70 1/16/2025
2025.1016.765 71 1/16/2025
2025.1016.712 73 1/16/2025
2025.1016.550 66 1/16/2025
2025.1016.541 68 1/16/2025
2025.1016.532 72 1/16/2025
2025.1016.325 59 1/16/2025
2025.1016.308 65 1/16/2025
2025.1016.296 61 1/16/2025
2025.1016.237 69 1/16/2025
2025.1016.184 67 1/16/2025
2025.1016.70 67 1/16/2025
2025.1016.6 67 1/16/2025
2025.1015.1438 66 1/16/2025
2025.1015.1437 64 1/16/2025
2025.1015.1411 64 1/15/2025
2025.1015.240 48 1/15/2025
2025.1015.223 45 1/15/2025
2025.1015.183 46 1/15/2025
2025.1014.1342 36 1/14/2025
2025.1014.273 50 1/14/2025
2025.1014.256 53 1/14/2025
2025.1012.440 65 1/12/2025
2025.1012.327 59 1/12/2025
2025.1012.279 59 1/12/2025
2025.1002.636 87 1/2/2025
2025.1001.1435 83 1/2/2025
2025.1001.1397 82 1/1/2025
2025.1001.770 92 1/1/2025
2025.1001.570 94 1/1/2025
2025.1001.558 85 1/1/2025
2025.1001.421 94 1/1/2025
2025.1001.390 87 1/1/2025
2025.1001.234 99 1/1/2025
2025.1001.123 89 1/1/2025
2024.1360.354 77 12/25/2024
2024.1360.60 80 12/25/2024
2024.1360.32 82 12/25/2024
2024.1358.450 89 12/23/2024
2024.1358.359 81 12/23/2024
2024.1358.312 86 12/23/2024
2024.1358.244 82 12/23/2024
2024.1358.120 90 12/23/2024
2024.1348.253 89 12/13/2024
2024.1345.1379 81 12/10/2024
2024.1345.506 84 12/10/2024
2024.1345.379 79 12/10/2024
2024.1345.145 77 12/10/2024
2024.1345.72 84 12/10/2024
2024.1345.69 75 12/10/2024
2024.1345.15 82 12/10/2024
2024.1344.1436 83 12/10/2024
2024.1344.600 92 12/9/2024
2024.1344.411 81 12/9/2024
2024.1340.379 91 12/5/2024
2024.1340.15 92 12/5/2024
2024.1338.786 87 12/3/2024
2024.1338.722 96 12/3/2024
2024.1338.697 89 12/3/2024
2024.1338.639 91 12/3/2024
2024.1338.541 90 12/3/2024
2024.1338.318 80 12/3/2024
2024.1338.298 85 12/3/2024
2024.1338.98 95 12/3/2024
2024.1337.756 90 12/2/2024
2024.1337.634 89 12/2/2024
2024.1337.625 89 12/2/2024
2024.1337.621 92 12/2/2024
2024.1337.594 86 12/2/2024
2024.1337.136 72 12/2/2024
2024.1336.793 91 12/1/2024
2024.1336.773 90 12/1/2024
2024.1336.305 88 12/1/2024
2024.1336.12 95 12/1/2024
2024.1335.1421 89 11/30/2024
2024.1335.1384 89 11/30/2024
2024.1334.1308 85 11/29/2024
2024.1334.764 89 11/29/2024
2024.1334.722 90 11/29/2024
2024.1330.185 88 11/25/2024
2024.1328.505 89 11/23/2024
2024.1328.470 90 11/23/2024
2024.1328.452 89 11/23/2024
2024.1323.910 89 11/18/2024
2024.1323.653 82 11/18/2024
2024.1323.185 93 11/18/2024
2024.1323.49 82 11/18/2024
2024.1322.714 92 11/17/2024
2024.1320.653 88 11/15/2024
2024.1320.619 80 11/15/2024
2024.1320.601 90 11/15/2024
2024.1320.159 86 11/15/2024
2024.1320.98 85 11/15/2024
2024.1320.2 84 11/15/2024
2024.1319.1431 85 11/15/2024
2024.1319.1335 84 11/14/2024
2024.1317.631 93 11/12/2024
2024.1316.330 106 11/11/2024
2024.1311.540 99 11/6/2024
2024.1306.225 93 11/1/2024
2024.1306.199 93 11/1/2024
2024.1306.171 89 11/1/2024
2024.1306.117 89 11/1/2024
2024.1305.506 85 10/31/2024
2024.1305.502 97 10/31/2024
2024.1305.465 90 10/31/2024
2024.1305.442 84 10/31/2024
2024.1305.399 94 10/31/2024
2024.1299.1070 86 10/25/2024
2024.1289.621 93 10/15/2024
2024.1289.338 91 10/15/2024
2024.1277.836 96 10/5/2024
2024.1277.711 90 10/3/2024
2024.1277.695 91 10/3/2024
2024.1270.409 101 9/26/2024
2024.1269.621 117 9/25/2024
2024.1269.619 101 9/25/2024
2024.1269.605 103 9/25/2024
2024.1242.282 110 8/29/2024
2024.1242.261 91 8/29/2024
2024.1242.233 113 8/29/2024
2024.1238.829 110 8/25/2024
2024.1238.327 127 8/25/2024
2024.1225.297 122 8/12/2024
2024.1205.140 78 7/23/2024
2024.1204.110 113 7/22/2024
2024.1204.62 79 7/22/2024
2024.1190.491 113 7/8/2024
2024.1177.305 116 6/25/2024
2024.1168.700 96 6/16/2024
2024.1168.649 111 6/16/2024
2024.1168.535 98 6/16/2024
2024.1167.643 105 6/15/2024
2024.1166.989 116 6/14/2024
2024.1166.818 90 6/14/2024
2024.1166.535 93 6/14/2024
2024.1166.422 109 6/14/2024
2024.1166.362 95 6/14/2024
2024.1166.360 95 6/14/2024
2024.1165.1212 100 6/13/2024
2024.1165.1160 88 6/13/2024
2024.1165.1019 103 6/13/2024
2024.1165.978 109 6/13/2024
2024.1165.920 104 6/13/2024
2024.1165.908 91 6/13/2024
2024.1165.873 90 6/13/2024
2024.1165.830 113 6/13/2024
2024.1165.806 114 6/13/2024
2024.1165.794 91 6/13/2024
2024.1165.792 105 6/13/2024
2024.1165.761 104 6/13/2024
2024.1165.743 105 6/13/2024
2024.1165.735 89 6/13/2024
2024.1165.713 113 6/13/2024
2024.1165.640 94 6/13/2024
2024.1165.574 107 6/13/2024
2024.1165.466 105 6/13/2024
2024.1165.417 119 6/13/2024
2024.1165.392 107 6/13/2024
2024.1164.341 83 6/12/2024
2024.1155.941 116 6/3/2024
2024.1140.783 116 5/19/2024
2024.1140.692 112 5/19/2024
2024.1140.673 97 5/19/2024
2024.1129.506 119 5/8/2024
2024.1128.831 135 5/7/2024
2024.1124.465 89 5/3/2024
2024.1123.1162 82 5/2/2024
2024.1123.1117 67 5/2/2024
2024.1123.1050 76 5/2/2024
2024.1122.352 117 5/1/2024
2024.1122.233 102 5/1/2024
2024.1115.1101 125 4/24/2024
2024.1115.1048 101 4/24/2024
2024.1115.932 107 4/24/2024
2024.1115.858 97 4/24/2024
2024.1115.665 106 4/24/2024
2024.1115.648 125 4/24/2024
2024.1115.591 97 4/24/2024
2024.1101.390 104 4/10/2024
2024.1100.741 123 4/9/2024
2024.1099.526 102 4/8/2024
2024.1099.466 107 4/8/2024
2024.1098.573 124 4/7/2024
2024.1095.977 104 4/4/2024
2024.1095.847 99 4/4/2024
2024.1095.604 106 4/4/2024
2024.1095.485 120 4/4/2024
2024.1094.930 101 4/3/2024
2024.1094.910 117 4/3/2024
2024.1094.387 117 4/3/2024
2024.1094.313 117 4/3/2024
2024.1093.520 114 4/2/2024
2024.1092.240 108 4/1/2024
2024.1089.1425 120 3/29/2024
2024.1089.983 106 3/29/2024
2024.1089.942 99 3/29/2024
2024.1089.2 104 3/29/2024
2024.1088.1343 129 3/28/2024
2024.1088.1139 121 3/28/2024
2024.1088.875 116 3/28/2024
2024.1088.700 134 3/28/2024
2024.1088.603 123 3/28/2024
2024.1088.590 94 3/28/2024
2024.1088.575 125 3/28/2024
2024.1088.561 127 3/28/2024
2024.1088.506 106 3/28/2024
2024.1088.18 105 3/28/2024
2024.1087.1181 136 3/27/2024
2024.1087.1173 104 3/27/2024
2024.1087.1143 124 3/27/2024
2024.1087.1108 110 3/27/2024
2024.1087.950 141 3/27/2024
2024.1087.939 115 3/27/2024
2024.1087.252 117 3/27/2024
2024.1070.736 137 3/10/2024
2024.1049.1437 144 2/19/2024
2024.1036.571 135 2/5/2024
2024.1036.508 99 2/5/2024
2024.1032.1204 110 2/1/2024
2024.1032.1133 99 2/1/2024
2024.1032.1122 114 2/1/2024
2024.1032.1071 95 2/1/2024
2024.1032.940 116 2/1/2024
2024.1031.912 113 1/31/2024
2024.1031.893 95 1/31/2024
2024.1031.851 114 1/31/2024
2024.1031.829 109 1/31/2024
2024.1031.386 124 1/31/2024
2024.1031.318 119 1/31/2024
2024.1017.460 127 1/17/2024
2024.1017.420 113 1/17/2024
2024.1017.163 115 1/17/2024
2024.1016.414 318 1/16/2024
2024.1012.167 134 1/12/2024
2024.1011.406 117 1/11/2024
2024.1010.315 124 1/10/2024
2023.1358.326 155 12/24/2023
2023.1351.473 145 12/17/2023
2023.1351.445 116 12/17/2023
2023.1351.432 129 12/17/2023
2023.1350.478 116 12/16/2023
2023.1344.600 124 12/10/2023
2023.1344.529 134 12/10/2023
2023.1339.582 162 12/5/2023
2023.1338.1072 134 12/4/2023
2023.1336.844 137 12/2/2023
2023.1335.378 143 12/1/2023
2023.1335.236 140 12/1/2023
2023.1335.203 136 12/1/2023
2023.1334.814 130 11/30/2023
2023.1332.652 126 11/28/2023
2023.1332.622 139 11/28/2023
2023.1332.524 156 11/28/2023
2023.1331.1073 119 11/27/2023
2023.1331.423 126 11/27/2023
2023.1328.513 137 11/24/2023
2023.1327.985 145 11/23/2023
2023.1325.593 137 11/21/2023
2023.1325.551 140 11/21/2023
2023.1325.529 130 11/21/2023