Kiwify.Kiwi.CLI.Configuration
1.0.0
Prefix Reserved
dotnet add package Kiwify.Kiwi.CLI.Configuration --version 1.0.0
NuGet\Install-Package Kiwify.Kiwi.CLI.Configuration -Version 1.0.0
<PackageReference Include="Kiwify.Kiwi.CLI.Configuration" Version="1.0.0" />
<PackageVersion Include="Kiwify.Kiwi.CLI.Configuration" Version="1.0.0" />
<PackageReference Include="Kiwify.Kiwi.CLI.Configuration" />
paket add Kiwify.Kiwi.CLI.Configuration --version 1.0.0
#r "nuget: Kiwify.Kiwi.CLI.Configuration, 1.0.0"
#:package Kiwify.Kiwi.CLI.Configuration@1.0.0
#addin nuget:?package=Kiwify.Kiwi.CLI.Configuration&version=1.0.0
#tool nuget:?package=Kiwify.Kiwi.CLI.Configuration&version=1.0.0
Kiwify.Kiwi.CLI.Configuration
Bridges CLI-parsed command values into the standard Microsoft.Extensions.Configuration pipeline. Lets command-line options flow into IConfiguration alongside JSON files, environment variables, and other providers.
Target: net6.0
Dependencies: Kiwify.Kiwi.CLI, Microsoft.Extensions.Configuration, Microsoft.Extensions.Configuration.Abstractions
How it works
After app.Execute(args) runs, call GetExecutedCommand<T>() to retrieve the populated command object, then pass it to AddKiwiCommandModel. Only properties that were explicitly set on the command line are included - defaults that were never supplied are omitted, so they don't shadow values from other providers.
Usage
using Kiwify.Kiwi.CLI.Configuration;
using Microsoft.Extensions.Configuration;
app.Execute(args);
var cmd = app.GetExecutedCommand<SetupOptions>();
if (cmd is not null)
{
IConfigurationBuilder builder = new ConfigurationBuilder()
.AddJsonFile("appsettings.json", optional: true)
.AddEnvironmentVariables()
.AddKiwiCommandModel(cmd, sectionPrefix: "app"); // CLI wins over earlier providers
IConfigurationRoot config = builder.Build();
// Values are available via standard IConfiguration API
var host = config["app:Host"];
var port = config["app:Port"];
}
Without a section prefix
builder.AddKiwiCommandModel(cmd);
// Keys are flat: "Host", "Port", "Workers"
Merging into an existing IConfigurationRoot
IConfigurationRoot existing = new ConfigurationBuilder()
.AddJsonFile("appsettings.json")
.Build();
IConfigurationRoot merged = existing
.AddKiwiCommandModelToExistingConfiguration(cmd, sectionPrefix: "app");
Key mapping
| Property type | Key format |
|---|---|
Primitive (string, int, bool) |
prefix:PropertyName |
Collection (string[], List<T>) |
prefix:PropertyName:0, :1, :2 … |
| Dictionary | prefix:PropertyName:key1, :key2 … |
| Nested object | prefix:PropertyName:NestedProp |
Property names respect [PropertyName] and [JsonPropertyName] attributes.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. 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 was computed. 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. net10.0 was computed. 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. |
-
net6.0
- Kiwify.Kiwi.CLI (>= 1.0.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.8)
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.0.0 | 97 | 5/28/2026 |