Microsoft.Extensions.Configuration.CommandLine 10.0.1

About

Command line configuration provider implementation for Microsoft.Extensions.Configuration. This package enables you to read configuration parameters from the command line arguments of your application. You can use CommandLineConfigurationExtensions.AddCommandLine extension method on IConfigurationBuilder to add the command line configuration provider to the configuration builder.

How to Use

The following example shows how to read application configuration from the command line. You can use a command like dotnet run --InputPath "c:\fizz" --OutputPath "c:\buzz" to run it.

using System;
using Microsoft.Extensions.Configuration;

class Program
{
    static void Main(string[] args)
    {
        // Build a configuration object from command line
        IConfiguration config = new ConfigurationBuilder()
            .AddCommandLine(args)
            .Build();

        // Read configuration values
        Console.WriteLine($"InputPath: {config["InputPath"]}");
        Console.WriteLine($"OutputPath: {config["OutputPath"]}");
    }
}

Additional Documentation

Feedback & Contributing

Microsoft.Extensions.Configuration.CommandLine is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Showing the top 20 packages that depend on Microsoft.Extensions.Configuration.CommandLine.

Packages Downloads
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
136
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
127
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
124
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
122
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
117
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
113
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
106
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
102
R4Mvc.Tools
R4Mvc is a tool that generates strongly typed helpers for ASP.NET Core MVC.
94
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
11
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
9
Microsoft.Extensions.Hosting
Hosting and startup infrastructures for applications.
8
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications.
8
Microsoft.Extensions.Hosting
.NET Core hosting and startup infrastructures for applications. This package was built from the source code at https://github.com/aspnet/Extensions/tree/0de62ae930da31048ba7e54c8cd0c6c0bcbd9095
8

Version Downloads Last updated
10.0.1 4 12/10/2025
10.0.0 32 11/13/2025
10.0.0-rc.2.25502.107 42 10/14/2025
10.0.0-rc.1.25451.107 53 9/10/2025
10.0.0-preview.7.25380.108 50 8/13/2025
10.0.0-preview.6.25358.103 42 7/16/2025
10.0.0-preview.5.25277.114 44 6/8/2025
10.0.0-preview.4.25258.110 66 5/15/2025
10.0.0-preview.3.25171.5 59 4/11/2025
10.0.0-preview.2.25163.2 61 3/20/2025
10.0.0-preview.1.25080.5 59 2/26/2025
9.0.11 24 11/13/2025
9.0.10 38 10/14/2025
9.0.9 44 9/10/2025
9.0.8 48 8/5/2025
9.0.7 57 7/12/2025
9.0.6 45 6/12/2025
9.0.5 64 5/16/2025
9.0.4 67 4/9/2025
9.0.3 65 3/13/2025
9.0.2 73 2/12/2025
9.0.1 83 1/18/2025
9.0.0 85 11/15/2024
9.0.0-rc.2.24473.5 74 10/15/2024
9.0.0-rc.1.24431.7 87 9/11/2024
9.0.0-preview.7.24405.7 107 8/15/2024
9.0.0-preview.6.24327.7 98 7/10/2024
9.0.0-preview.5.24306.7 88 6/14/2024
9.0.0-preview.4.24266.19 91 5/24/2024
9.0.0-preview.3.24172.9 98 4/16/2024
9.0.0-preview.2.24128.5 102 3/29/2024
9.0.0-preview.1.24080.9 107 2/19/2024
8.0.0 108 11/16/2023
8.0.0-rc.2.23479.6 111 10/24/2023
8.0.0-rc.1.23419.4 115 9/17/2023
8.0.0-preview.7.23375.6 112 8/23/2023
8.0.0-preview.6.23329.7 110 7/22/2023
8.0.0-preview.5.23280.8 119 8/3/2023
8.0.0-preview.4.23259.5 116 8/3/2023
8.0.0-preview.3.23174.8 110 5/14/2023
8.0.0-preview.2.23128.3 106 5/17/2023
8.0.0-preview.1.23110.8 92 2/24/2023
7.0.0 104 12/5/2022
7.0.0-rc.2.22472.3 97 12/5/2022
7.0.0-rc.1.22426.10 121 9/16/2022
7.0.0-preview.7.22375.6 105 8/16/2022
7.0.0-preview.6.22324.4 108 9/16/2022
7.0.0-preview.5.22301.12 105 6/29/2022
7.0.0-preview.4.22229.4 118 6/29/2022
7.0.0-preview.3.22175.4 106 6/29/2022
7.0.0-preview.2.22152.2 120 6/29/2022
7.0.0-preview.1.22076.8 120 6/29/2022
6.0.2-mauipre.1.22102.15 124 6/29/2022
6.0.2-mauipre.1.22054.8 123 6/29/2022
6.0.1 83 11/18/2024
6.0.0 116 6/29/2022
6.0.0-rc.2.21480.5 121 6/29/2022
6.0.0-rc.1.21451.13 109 6/29/2022
6.0.0-preview.7.21377.19 104 8/29/2022
6.0.0-preview.6.21352.12 114 10/6/2022
6.0.0-preview.5.21301.5 123 10/10/2022
6.0.0-preview.4.21253.7 104 9/26/2022
6.0.0-preview.3.21201.4 94 10/23/2022
6.0.0-preview.2.21154.6 121 9/13/2022
6.0.0-preview.1.21102.12 102 2/14/2023
5.0.0 110 2/22/2023
5.0.0-rc.2.20475.5 116 12/19/2022
5.0.0-rc.1.20451.14 107 7/31/2022
5.0.0-preview.8.20407.11 118 1/27/2023
5.0.0-preview.7.20364.11 115 9/2/2022
5.0.0-preview.6.20305.6 114 9/22/2022
5.0.0-preview.5.20278.1 92 2/5/2023
5.0.0-preview.4.20251.6 103 10/9/2022
5.0.0-preview.3.20215.2 112 2/24/2023
5.0.0-preview.2.20160.3 103 10/17/2022
5.0.0-preview.1.20120.4 132 10/17/2022
3.1.32 121 1/27/2023
3.1.31 119 11/23/2022
3.1.30 109 10/23/2022
3.1.29 107 9/16/2022
3.1.28 104 9/16/2022
3.1.27 120 9/16/2022
3.1.26 98 2/24/2023
3.1.25 115 9/26/2022
3.1.24 85 1/4/2023
3.1.23 100 2/24/2023
3.1.22 96 7/26/2022
3.1.21 121 6/29/2022
3.1.20 124 6/29/2022
3.1.19 118 6/29/2022
3.1.18 113 6/29/2022
3.1.17 107 6/29/2022
3.1.16 110 6/29/2022
3.1.15 114 6/29/2022
3.1.14 109 6/29/2022
3.1.13 102 6/29/2022
3.1.12 112 6/29/2022
3.1.11 113 6/29/2022
3.1.10 111 6/29/2022
3.1.9 110 10/16/2022
3.1.8 104 9/2/2022
3.1.7 117 8/31/2022
3.1.6 102 8/12/2022
3.1.5 112 10/18/2022
3.1.4 113 2/24/2023
3.1.3 121 11/29/2022
3.1.2 107 6/29/2022
3.1.1 119 6/29/2022
3.1.0 113 6/29/2022
3.1.0-preview3.19553.2 101 6/29/2022
3.1.0-preview2.19525.4 101 6/29/2022
3.1.0-preview1.19506.1 106 6/29/2022
3.0.3 107 6/29/2022
3.0.2 103 6/29/2022
3.0.1 98 6/29/2022
3.0.0 109 6/29/2022
3.0.0-rc1.19456.10 118 6/29/2022
3.0.0-preview9.19423.4 91 6/29/2022
3.0.0-preview8.19405.4 105 6/29/2022
3.0.0-preview7.19362.4 104 6/29/2022
3.0.0-preview6.19304.6 94 6/29/2022
3.0.0-preview5.19227.9 108 6/29/2022
3.0.0-preview4.19216.2 111 6/29/2022
3.0.0-preview3.19153.1 108 6/29/2022
3.0.0-preview.19074.2 105 6/29/2022
3.0.0-preview.18572.1 109 6/29/2022
2.2.0 117 6/29/2022
2.2.0-preview3-35497 102 6/29/2022
2.2.0-preview2-35157 129 6/29/2022
2.2.0-preview1-35029 102 6/29/2022
2.1.1 99 6/29/2022
2.1.0 115 6/29/2022
2.1.0-rc1-final 116 6/29/2022
2.1.0-preview2-final 122 6/29/2022
2.1.0-preview1-final 111 6/29/2022
2.0.2 117 6/29/2022
2.0.1 105 6/29/2022
2.0.0 98 6/29/2022
2.0.0-preview2-final 98 6/29/2022
2.0.0-preview1-final 120 6/29/2022
1.1.2 134 6/29/2022
1.1.1 107 6/29/2022
1.1.0 111 6/29/2022
1.1.0-preview1-final 106 6/29/2022
1.0.2 124 6/29/2022
1.0.1 115 6/29/2022
1.0.0 111 6/29/2022
1.0.0-rc2-final 106 6/29/2022
1.0.0-rc1-final 101 6/29/2022