Redpoint.CommandLine 2025.1083.125

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.1083.125
                    
NuGet\Install-Package Redpoint.CommandLine -Version 2025.1083.125
                    
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.1083.125" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Redpoint.CommandLine" Version="2025.1083.125" />
                    
Directory.Packages.props
<PackageReference Include="Redpoint.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 Redpoint.CommandLine --version 2025.1083.125
                    
#r "nuget: Redpoint.CommandLine, 2025.1083.125"
                    
#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.
#addin nuget:?package=Redpoint.CommandLine&version=2025.1083.125
                    
Install Redpoint.CommandLine as a Cake Addin
#tool nuget:?package=Redpoint.CommandLine&version=2025.1083.125
                    
Install Redpoint.CommandLine as a Cake Tool

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 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. 
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.1119.450 35 4/29/2025
2025.1119.436 35 4/29/2025
2025.1119.409 36 4/29/2025
2025.1119.388 35 4/29/2025
2025.1119.360 25 4/29/2025
2025.1119.328 54 4/29/2025
2025.1119.299 38 4/29/2025
2025.1119.287 36 4/29/2025
2025.1116.868 41 4/26/2025
2025.1116.841 44 4/26/2025
2025.1116.444 46 4/26/2025
2025.1115.498 93 4/25/2025
2025.1115.491 92 4/25/2025
2025.1100.365 160 4/10/2025
2025.1100.336 148 4/10/2025
2025.1100.331 150 4/10/2025
2025.1098.108 138 4/8/2025
2025.1093.291 159 4/3/2025
2025.1091.38 141 4/1/2025
2025.1091.26 150 4/1/2025
2025.1090.237 147 3/31/2025
2025.1089.1386 145 3/30/2025
2025.1083.515 397 3/24/2025
2025.1083.408 323 3/24/2025
2025.1083.398 322 3/24/2025
2025.1083.125 328 3/24/2025
2025.1080.41 133 3/21/2025
2025.1075.357 129 3/16/2025
2025.1073.332 124 3/14/2025
2025.1072.541 141 3/13/2025
2025.1072.536 141 3/13/2025
2025.1064.602 204 3/5/2025
2025.1064.546 214 3/5/2025
2025.1062.589 150 3/3/2025
2025.1061.513 104 3/2/2025
2025.1060.490 101 3/1/2025
2025.1059.134 109 2/28/2025
2025.1057.1020 102 2/26/2025
2025.1056.584 97 2/25/2025
2025.1050.282 97 2/19/2025
2025.1050.232 89 2/19/2025
2025.1049.55 102 2/18/2025
2025.1045.285 106 2/14/2025
2025.1043.288 97 2/12/2025
2025.1043.246 91 2/12/2025
2025.1043.197 92 2/12/2025
2025.1043.180 86 2/12/2025
2025.1043.108 91 2/12/2025
2025.1043.38 92 2/12/2025
2025.1043.27 102 2/12/2025
2025.1042.725 90 2/11/2025
2025.1042.690 88 2/11/2025
2025.1042.688 92 2/11/2025
2025.1042.418 97 2/11/2025
2025.1042.215 88 2/11/2025
2025.1042.203 105 2/11/2025
2025.1042.184 95 2/11/2025
2025.1042.142 91 2/11/2025
2025.1042.127 89 2/11/2025
2025.1037.1327 91 2/6/2025
2025.1036.280 99 2/5/2025
2025.1036.55 93 2/5/2025
2025.1035.1387 108 2/4/2025
2025.1031.111 100 1/31/2025
2025.1030.916 108 1/30/2025
2025.1030.895 95 1/30/2025
2025.1030.592 98 1/30/2025
2025.1029.664 81 1/29/2025
2025.1029.632 80 1/29/2025
2025.1029.596 81 1/29/2025
2025.1028.386 88 1/28/2025
2025.1025.723 85 1/25/2025
2025.1025.712 85 1/25/2025
2025.1019.913 89 1/19/2025
2025.1018.374 88 1/18/2025
2025.1018.285 79 1/18/2025
2025.1017.646 84 1/17/2025
2025.1017.379 92 1/17/2025
2025.1016.1370 86 1/16/2025
2025.1016.765 83 1/16/2025
2025.1016.712 86 1/16/2025
2025.1016.550 80 1/16/2025
2025.1016.541 82 1/16/2025
2025.1016.532 86 1/16/2025
2025.1016.325 73 1/16/2025
2025.1016.308 79 1/16/2025
2025.1016.296 75 1/16/2025
2025.1016.237 83 1/16/2025
2025.1016.184 81 1/16/2025
2025.1016.70 81 1/16/2025
2025.1016.6 79 1/16/2025
2025.1015.1438 81 1/16/2025
2025.1015.1437 78 1/16/2025
2025.1015.1411 80 1/15/2025
2025.1015.240 62 1/15/2025
2025.1015.223 58 1/15/2025
2025.1015.183 59 1/15/2025
2025.1014.1342 66 1/14/2025
2025.1014.273 76 1/14/2025
2025.1014.256 77 1/14/2025
2025.1012.440 92 1/12/2025
2025.1012.327 77 1/12/2025
2025.1012.279 81 1/12/2025
2025.1002.636 101 1/2/2025
2025.1001.1435 97 1/2/2025
2025.1001.1397 95 1/1/2025
2025.1001.770 105 1/1/2025
2025.1001.570 107 1/1/2025
2025.1001.558 98 1/1/2025
2025.1001.421 107 1/1/2025
2025.1001.390 100 1/1/2025
2025.1001.234 112 1/1/2025
2025.1001.123 102 1/1/2025
2024.1360.354 93 12/25/2024
2024.1360.60 90 12/25/2024
2024.1360.32 94 12/25/2024
2024.1358.450 101 12/23/2024
2024.1358.359 92 12/23/2024
2024.1358.312 97 12/23/2024
2024.1358.244 94 12/23/2024
2024.1358.120 103 12/23/2024
2024.1348.253 101 12/13/2024
2024.1345.1379 92 12/10/2024
2024.1345.506 95 12/10/2024
2024.1345.379 90 12/10/2024
2024.1345.145 88 12/10/2024
2024.1345.72 95 12/10/2024
2024.1345.69 86 12/10/2024
2024.1345.15 93 12/10/2024
2024.1344.1436 94 12/10/2024
2024.1344.600 103 12/9/2024
2024.1344.411 93 12/9/2024
2024.1340.379 100 12/5/2024
2024.1340.15 101 12/5/2024
2024.1338.786 97 12/3/2024
2024.1338.722 105 12/3/2024
2024.1338.697 100 12/3/2024
2024.1338.639 101 12/3/2024
2024.1338.541 100 12/3/2024
2024.1338.318 92 12/3/2024
2024.1338.298 95 12/3/2024
2024.1338.98 106 12/3/2024
2024.1337.756 101 12/2/2024
2024.1337.634 100 12/2/2024
2024.1337.625 100 12/2/2024
2024.1337.621 103 12/2/2024
2024.1337.594 97 12/2/2024
2024.1337.136 82 12/2/2024
2024.1336.793 101 12/1/2024
2024.1336.773 101 12/1/2024
2024.1336.305 98 12/1/2024
2024.1336.12 105 12/1/2024
2024.1335.1421 99 11/30/2024
2024.1335.1384 100 11/30/2024
2024.1334.1308 95 11/29/2024
2024.1334.764 99 11/29/2024
2024.1334.722 99 11/29/2024
2024.1330.185 97 11/25/2024
2024.1328.505 98 11/23/2024
2024.1328.470 99 11/23/2024
2024.1328.452 98 11/23/2024
2024.1323.910 97 11/18/2024
2024.1323.653 90 11/18/2024
2024.1323.185 101 11/18/2024
2024.1323.49 91 11/18/2024
2024.1322.714 100 11/17/2024
2024.1320.653 96 11/15/2024
2024.1320.619 89 11/15/2024
2024.1320.601 98 11/15/2024
2024.1320.159 93 11/15/2024
2024.1320.98 93 11/15/2024
2024.1320.2 91 11/15/2024
2024.1319.1431 98 11/15/2024
2024.1319.1335 92 11/14/2024
2024.1317.631 101 11/12/2024
2024.1316.330 113 11/11/2024
2024.1311.540 106 11/6/2024
2024.1306.225 101 11/1/2024
2024.1306.199 100 11/1/2024
2024.1306.171 98 11/1/2024
2024.1306.117 97 11/1/2024
2024.1305.506 92 10/31/2024
2024.1305.502 104 10/31/2024
2024.1305.465 97 10/31/2024
2024.1305.442 92 10/31/2024
2024.1305.399 102 10/31/2024
2024.1299.1070 91 10/25/2024
2024.1289.621 98 10/15/2024
2024.1289.338 96 10/15/2024
2024.1277.836 101 10/5/2024
2024.1277.711 96 10/3/2024
2024.1277.695 97 10/3/2024
2024.1270.409 107 9/26/2024
2024.1269.621 122 9/25/2024
2024.1269.619 107 9/25/2024
2024.1269.605 109 9/25/2024
2024.1242.282 116 8/29/2024
2024.1242.261 97 8/29/2024
2024.1242.233 119 8/29/2024
2024.1238.829 116 8/25/2024
2024.1238.327 133 8/25/2024
2024.1225.297 127 8/12/2024
2024.1205.140 83 7/23/2024
2024.1204.110 121 7/22/2024
2024.1204.62 87 7/22/2024
2024.1190.491 118 7/8/2024
2024.1177.305 122 6/25/2024
2024.1168.700 101 6/16/2024
2024.1168.649 116 6/16/2024
2024.1168.535 102 6/16/2024
2024.1167.643 110 6/15/2024
2024.1166.989 121 6/14/2024
2024.1166.818 94 6/14/2024
2024.1166.535 97 6/14/2024
2024.1166.422 114 6/14/2024
2024.1166.362 99 6/14/2024
2024.1166.360 99 6/14/2024
2024.1165.1212 105 6/13/2024
2024.1165.1160 95 6/13/2024
2024.1165.1019 108 6/13/2024
2024.1165.978 114 6/13/2024
2024.1165.920 108 6/13/2024
2024.1165.908 95 6/13/2024
2024.1165.873 94 6/13/2024
2024.1165.830 117 6/13/2024
2024.1165.806 123 6/13/2024
2024.1165.794 96 6/13/2024
2024.1165.792 110 6/13/2024
2024.1165.761 109 6/13/2024
2024.1165.743 109 6/13/2024
2024.1165.735 93 6/13/2024
2024.1165.713 117 6/13/2024
2024.1165.640 104 6/13/2024
2024.1165.574 113 6/13/2024
2024.1165.466 109 6/13/2024
2024.1165.417 128 6/13/2024
2024.1165.392 113 6/13/2024
2024.1164.341 87 6/12/2024
2024.1155.941 121 6/3/2024
2024.1140.783 121 5/19/2024
2024.1140.692 121 5/19/2024
2024.1140.673 101 5/19/2024
2024.1129.506 125 5/8/2024
2024.1128.831 139 5/7/2024
2024.1124.465 96 5/3/2024
2024.1123.1162 91 5/2/2024
2024.1123.1117 76 5/2/2024
2024.1123.1050 84 5/2/2024
2024.1122.352 123 5/1/2024
2024.1122.233 109 5/1/2024
2024.1115.1101 131 4/24/2024
2024.1115.1048 105 4/24/2024
2024.1115.932 114 4/24/2024
2024.1115.858 101 4/24/2024
2024.1115.665 110 4/24/2024
2024.1115.648 131 4/24/2024
2024.1115.591 104 4/24/2024
2024.1101.390 111 4/10/2024
2024.1100.741 129 4/9/2024
2024.1099.526 108 4/8/2024
2024.1099.466 114 4/8/2024
2024.1098.573 129 4/7/2024
2024.1095.977 110 4/4/2024
2024.1095.847 104 4/4/2024
2024.1095.604 112 4/4/2024
2024.1095.485 125 4/4/2024
2024.1094.930 106 4/3/2024
2024.1094.910 122 4/3/2024
2024.1094.387 122 4/3/2024
2024.1094.313 122 4/3/2024
2024.1093.520 120 4/2/2024
2024.1092.240 114 4/1/2024
2024.1089.1425 125 3/29/2024
2024.1089.983 110 3/29/2024
2024.1089.942 104 3/29/2024
2024.1089.2 109 3/29/2024
2024.1088.1343 134 3/28/2024
2024.1088.1139 126 3/28/2024
2024.1088.875 120 3/28/2024
2024.1088.700 140 3/28/2024
2024.1088.603 127 3/28/2024
2024.1088.590 100 3/28/2024
2024.1088.575 130 3/28/2024
2024.1088.561 131 3/28/2024
2024.1088.506 110 3/28/2024
2024.1088.18 109 3/28/2024
2024.1087.1181 141 3/27/2024
2024.1087.1173 109 3/27/2024
2024.1087.1143 129 3/27/2024
2024.1087.1108 114 3/27/2024
2024.1087.950 146 3/27/2024
2024.1087.939 121 3/27/2024
2024.1087.252 122 3/27/2024
2024.1070.736 142 3/10/2024
2024.1049.1437 153 2/19/2024
2024.1036.571 139 2/5/2024
2024.1036.508 104 2/5/2024
2024.1032.1204 116 2/1/2024
2024.1032.1133 104 2/1/2024
2024.1032.1122 119 2/1/2024
2024.1032.1071 99 2/1/2024
2024.1032.940 121 2/1/2024
2024.1031.912 117 1/31/2024
2024.1031.893 99 1/31/2024
2024.1031.851 118 1/31/2024
2024.1031.829 113 1/31/2024
2024.1031.386 128 1/31/2024
2024.1031.318 123 1/31/2024
2024.1017.460 131 1/17/2024
2024.1017.420 119 1/17/2024
2024.1017.163 119 1/17/2024
2024.1016.414 323 1/16/2024
2024.1012.167 139 1/12/2024
2024.1011.406 122 1/11/2024
2024.1010.315 128 1/10/2024
2023.1358.326 159 12/24/2023
2023.1351.473 150 12/17/2023
2023.1351.445 121 12/17/2023
2023.1351.432 134 12/17/2023
2023.1350.478 121 12/16/2023
2023.1344.600 129 12/10/2023
2023.1344.529 139 12/10/2023
2023.1339.582 163 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 141 12/1/2023
2023.1335.203 136 12/1/2023
2023.1334.814 131 11/30/2023
2023.1332.652 127 11/28/2023
2023.1332.622 140 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 138 11/21/2023
2023.1325.551 140 11/21/2023
2023.1325.529 130 11/21/2023