diff --git a/README.md b/README.md index 6c2cdaf..c538b45 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/docs/RELEASING.md b/docs/RELEASING.md deleted file mode 100644 index 1c7f2bf..0000000 --- a/docs/RELEASING.md +++ /dev/null @@ -1,9 +0,0 @@ -# Releasing WhyConfig.NET - -The GitHub repository can stay private while the tool package is public on NuGet.org. - -1. In the [Benziza NuGet.org account](https://www.nuget.org/profiles/Benziza), create a [Trusted Publishing policy](https://learn.microsoft.com/en-us/nuget/nuget-org/trusted-publishing) with package owner `Benziza`, repository owner `Benziza`, repository `WhyConfig.NET`, workflow file `publish-nuget.yml`, no environment, and package glob `WhyConfig.NET`. Allow publishing new packages and new versions. -2. Run the **Publish NuGet tool** workflow from `main` in the Actions tab. It uses GitHub OIDC to obtain a short-lived publishing credential; no API key secret is needed. -3. After NuGet.org lists the package, verify installation with `dotnet tool install --global WhyConfig.NET` and `whyconfig --help`. - -For another release, change `Version` in `src/WhyConfig.Cli/WhyConfig.Cli.csproj`, merge it, then run the workflow again. NuGet.org does not allow replacing a published package version. diff --git a/src/WhyConfig.Cli/README.md b/src/WhyConfig.Cli/README.md new file mode 100644 index 0000000..43087d4 --- /dev/null +++ b/src/WhyConfig.Cli/README.md @@ -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. diff --git a/src/WhyConfig.Cli/WhyConfig.Cli.csproj b/src/WhyConfig.Cli/WhyConfig.Cli.csproj index d43dae1..d193844 100644 --- a/src/WhyConfig.Cli/WhyConfig.Cli.csproj +++ b/src/WhyConfig.Cli/WhyConfig.Cli.csproj @@ -19,15 +19,14 @@ true whyconfig WhyConfig.NET - 0.1.0 + 0.1.1 Benziza Explain .NET configuration provider precedence for a key. README.md - - +