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.1061.513 16 10 hours ago
2025.1060.490 29 a day ago
2025.1059.134 50 3 days ago
2025.1057.1020 65 4 days ago
2025.1056.584 83 5 days ago
2025.1050.282 87 12 days ago
2025.1050.232 78 12 days ago
2025.1049.55 90 13 days ago
2025.1045.285 96 17 days ago
2025.1043.288 87 19 days ago
2025.1043.246 82 19 days ago
2025.1043.197 83 19 days ago
2025.1043.180 78 19 days ago
2025.1043.108 82 19 days ago
2025.1043.38 81 19 days ago
2025.1043.27 94 19 days ago
2025.1042.725 80 19 days ago
2025.1042.690 80 19 days ago
2025.1042.688 84 19 days ago
2025.1042.418 86 19 days ago
2025.1042.215 77 20 days ago
2025.1042.203 97 20 days ago
2025.1042.184 87 20 days ago
2025.1042.142 83 20 days ago
2025.1042.127 79 20 days ago
2025.1037.1327 77 24 days ago
2025.1036.280 91 a month ago
2025.1036.55 84 a month ago
2025.1035.1387 98 a month ago
2025.1031.111 89 a month ago
2025.1030.916 100 a month ago
2025.1030.895 87 a month ago
2025.1030.592 89 a month ago
2025.1029.664 72 a month ago
2025.1029.632 69 a month ago
2025.1029.596 69 a month ago
2025.1028.386 80 a month ago
2025.1025.723 74 a month ago
2025.1025.712 77 a month ago
2025.1019.913 80 a month ago
2025.1018.374 79 a month ago
2025.1018.285 70 a month ago
2025.1017.646 77 a month ago
2025.1017.379 85 a month ago
2025.1016.1370 79 a month ago
2025.1016.765 76 a month ago
2025.1016.712 78 a month ago
2025.1016.550 71 a month ago
2025.1016.541 75 a month ago
2025.1016.532 77 a month ago
2025.1016.325 66 a month ago
2025.1016.308 72 a month ago
2025.1016.296 68 a month ago
2025.1016.237 74 a month ago
2025.1016.184 72 a month ago
2025.1016.70 72 a month ago
2025.1016.6 72 a month ago
2025.1015.1438 72 a month ago
2025.1015.1437 71 a month ago
2025.1015.1411 73 a month ago
2025.1015.240 55 2 months ago
2025.1015.223 49 2 months ago
2025.1015.183 52 2 months ago
2025.1014.1342 58 2 months ago
2025.1014.273 65 2 months ago
2025.1014.256 68 2 months ago
2025.1012.440 81 2 months ago
2025.1012.327 70 2 months ago
2025.1012.279 68 2 months ago
2025.1002.636 92 2 months ago
2025.1001.1435 88 2 months ago
2025.1001.1397 88 2 months ago
2025.1001.770 98 2 months ago
2025.1001.570 100 2 months ago
2025.1001.558 91 2 months ago
2025.1001.421 100 2 months ago
2025.1001.390 93 2 months ago
2025.1001.234 105 2 months ago
2025.1001.123 95 2 months ago
2024.1360.354 86 2 months ago
2024.1360.60 82 2 months ago
2024.1360.32 86 2 months ago
2024.1358.450 93 2 months ago
2024.1358.359 83 2 months ago
2024.1358.312 88 2 months ago
2024.1358.244 84 2 months ago
2024.1358.120 95 2 months ago
2024.1348.253 93 3 months ago
2024.1345.1379 83 3 months ago
2024.1345.506 86 3 months ago
2024.1345.379 81 3 months ago
2024.1345.145 81 3 months ago
2024.1345.72 88 3 months ago
2024.1345.69 79 3 months ago
2024.1345.15 86 3 months ago
2024.1344.1436 87 3 months ago
2024.1344.600 94 3 months ago
2024.1344.411 85 3 months ago
2024.1340.379 93 3 months ago
2024.1340.15 94 3 months ago
2024.1338.786 89 3 months ago
2024.1338.722 98 3 months ago
2024.1338.697 93 3 months ago
2024.1338.639 94 3 months ago
2024.1338.541 93 3 months ago
2024.1338.318 83 3 months ago
2024.1338.298 88 3 months ago
2024.1338.98 98 3 months ago
2024.1337.756 93 3 months ago
2024.1337.634 92 3 months ago
2024.1337.625 92 3 months ago
2024.1337.621 95 3 months ago
2024.1337.594 89 3 months ago
2024.1337.136 75 3 months ago
2024.1336.793 95 3 months ago
2024.1336.773 94 3 months ago
2024.1336.305 92 3 months ago
2024.1336.12 99 3 months ago
2024.1335.1421 93 3 months ago
2024.1335.1384 93 3 months ago
2024.1334.1308 89 3 months ago
2024.1334.764 92 3 months ago
2024.1334.722 93 3 months ago
2024.1330.185 91 3 months ago
2024.1328.505 92 3 months ago
2024.1328.470 93 3 months ago
2024.1328.452 92 3 months ago
2024.1323.910 92 3 months ago
2024.1323.653 85 3 months ago
2024.1323.185 96 3 months ago
2024.1323.49 85 3 months ago
2024.1322.714 95 3 months ago
2024.1320.653 91 4 months ago
2024.1320.619 83 4 months ago
2024.1320.601 92 4 months ago
2024.1320.159 88 4 months ago
2024.1320.98 87 4 months ago
2024.1320.2 86 4 months ago
2024.1319.1431 93 4 months ago
2024.1319.1335 86 4 months ago
2024.1317.631 95 4 months ago
2024.1316.330 108 4 months ago
2024.1311.540 101 4 months ago
2024.1306.225 93 4 months ago
2024.1306.199 93 4 months ago
2024.1306.171 91 4 months ago
2024.1306.117 89 4 months ago
2024.1305.506 85 4 months ago
2024.1305.502 97 4 months ago
2024.1305.465 90 4 months ago
2024.1305.442 84 4 months ago
2024.1305.399 94 4 months ago
2024.1299.1070 86 4 months ago
2024.1289.621 93 5 months ago
2024.1289.338 91 5 months ago
2024.1277.836 96 5 months ago
2024.1277.711 91 5 months ago
2024.1277.695 91 5 months ago
2024.1270.409 101 5 months ago
2024.1269.621 117 5 months ago
2024.1269.619 101 5 months ago
2024.1269.605 103 5 months ago
2024.1242.282 110 6 months ago
2024.1242.261 91 6 months ago
2024.1242.233 113 6 months ago
2024.1238.829 110 6 months ago
2024.1238.327 127 6 months ago
2024.1225.297 122 7 months ago
2024.1205.140 78 7 months ago
2024.1204.110 113 7 months ago
2024.1204.62 79 7 months ago
2024.1190.491 113 8 months ago
2024.1177.305 116 8 months ago
2024.1168.700 96 8 months ago
2024.1168.649 111 8 months ago
2024.1168.535 98 8 months ago
2024.1167.643 105 9 months ago
2024.1166.989 116 9 months ago
2024.1166.818 90 9 months ago
2024.1166.535 93 9 months ago
2024.1166.422 109 9 months ago
2024.1166.362 95 9 months ago
2024.1166.360 95 9 months ago
2024.1165.1212 100 9 months ago
2024.1165.1160 90 9 months ago
2024.1165.1019 103 9 months ago
2024.1165.978 109 9 months ago
2024.1165.920 104 9 months ago
2024.1165.908 91 9 months ago
2024.1165.873 90 9 months ago
2024.1165.830 113 9 months ago
2024.1165.806 116 9 months ago
2024.1165.794 91 9 months ago
2024.1165.792 105 9 months ago
2024.1165.761 104 9 months ago
2024.1165.743 105 9 months ago
2024.1165.735 89 9 months ago
2024.1165.713 113 9 months ago
2024.1165.640 100 9 months ago
2024.1165.574 108 9 months ago
2024.1165.466 105 9 months ago
2024.1165.417 121 9 months ago
2024.1165.392 109 9 months ago
2024.1164.341 83 9 months ago
2024.1155.941 116 9 months ago
2024.1140.783 116 9 months ago
2024.1140.692 117 9 months ago
2024.1140.673 97 9 months ago
2024.1129.506 120 10 months ago
2024.1128.831 135 10 months ago
2024.1124.465 89 10 months ago
2024.1123.1162 82 10 months ago
2024.1123.1117 67 10 months ago
2024.1123.1050 76 10 months ago
2024.1122.352 117 5/1/2024
2024.1122.233 102 5/1/2024
2024.1115.1101 127 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 99 4/24/2024
2024.1101.390 106 4/10/2024
2024.1100.741 123 4/9/2024
2024.1099.526 103 4/8/2024
2024.1099.466 108 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 121 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 95 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 116 3/27/2024
2024.1087.252 117 3/27/2024
2024.1070.736 137 3/10/2024
2024.1049.1437 148 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