Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,10 @@ dotnet tool install -g WhyConfig.NET

## Use

From your app's project directory:

```bash
whyconfig explain Database:Host --project path/to/YourApp --environment Development
whyconfig explain Database:Host
```

The CLI checks the project's `appsettings` files, Development User Secrets, and current environment variables. Run `whyconfig --help` for options.

For the exact configuration of a running app, use `WhyConfig.Core` with its `IConfigurationRoot`:

```csharp
using WhyConfig.Core;

var builder = WebApplication.CreateBuilder(args);
var result = ConfigExplainer.Explain(builder.Configuration, "Database:Host");
Console.WriteLine($"{result.Winner?.Provider}: {result.EffectiveValue}");
```
To inspect another project, add `--project path/to/YourApp`. Run `whyconfig --help` for more options.
9 changes: 0 additions & 9 deletions docs/RELEASING.md

This file was deleted.

37 changes: 37 additions & 0 deletions src/WhyConfig.Cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# WhyConfig.NET

See which .NET configuration source set a value, and which values it replaced.

## Install

Requires the .NET 10 SDK.

```bash
dotnet tool install -g WhyConfig.NET
```

## Use

From your app's project directory:

```bash
whyconfig explain Database:Host
```

Example output:

```text
Database:Host

appsettings.json
db.production.com
overridden

appsettings.Development.json
localhost
WINNER

Effective value: localhost
```

To inspect another project, add `--project path/to/YourApp`. Run `whyconfig --help` for more options.
5 changes: 2 additions & 3 deletions src/WhyConfig.Cli/WhyConfig.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@
<PackAsTool>true</PackAsTool>
<ToolCommandName>whyconfig</ToolCommandName>
<PackageId>WhyConfig.NET</PackageId>
<Version>0.1.0</Version>
<Version>0.1.1</Version>
<Authors>Benziza</Authors>
<Description>Explain .NET configuration provider precedence for a key.</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<ItemGroup>
<None Include="../../README.md" Pack="true" PackagePath="/" />
<None Include="../../assets/whyconfig-demo.gif" Pack="true" PackagePath="assets/" />
<None Update="README.md" Pack="true" PackagePath="README.md" />
</ItemGroup>

</Project>