BrighterTools.CodeGenerator 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global BrighterTools.CodeGenerator --version 2.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local BrighterTools.CodeGenerator --version 2.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=BrighterTools.CodeGenerator&version=2.0.0
                    
nuke :add-package BrighterTools.CodeGenerator --version 2.0.0
                    

BrighterTools.CodeGenerator

Code generation tooling for BrighterTools projects, packaged as a dotnet tool.

Projects

  • BrighterTools.CodeGenerator (console tool)
  • BrighterTools.CodeGenerator.Tests (xUnit tests)

Commands

  • Scaffold a consuming repo: dotnet tool run brightertools-codegenerator -- init
  • Generate from app-owned config: dotnet tool run brightertools-codegenerator -- generate --config CodeGeneration/codegen.json
  • Legacy-compatible invocation: dotnet tool run brightertools-codegenerator -- --config CodeGeneration/codegen.json

Cross-Platform Workflow

  • Relative --config paths resolve from the current working directory.
  • Relative paths inside codegen.json resolve from the folder containing that config file.
  • Consuming repos should keep a repo-owned CodeGeneration folder with pwsh entrypoints and thin Windows .bat shims.
  • The generated Windows .bat shims prefer pwsh and fall back to Windows PowerShell when pwsh is not installed.
  • init scaffolds those starter files for convention-based repos and keeps projectPath / templatesDirectory empty for tool-based usage.

Development

  • Build: dotnet build BrighterTools.CodeGenerator.slnx -c Release
  • Test: dotnet test BrighterTools.CodeGenerator.slnx -c Release
  • Pack locally: PackageToolForNuGet.bat

CI Packaging

  • GitHub Actions validates restore, build, and test on Windows, Linux, and macOS.
  • Packing still runs on Ubuntu and uploads the .nupkg and .snupkg artifacts.
  • The packaged .nupkg and .snupkg files are uploaded as workflow artifacts.
  • The publish-tool workflow is configured for Trusted Publishing with GitHub OIDC, not a stored NuGet API key.

NuGet Sources

  • The repo-level NuGet.config clears inherited package sources and restores from nuget.org.
  • This avoids machine-specific feeds such as Telerik affecting restore and pack.

Trusted Publishing Setup

  • You must configure Trusted Publishing in nuget.org for this GitHub repository before the publish workflow can push packages.
  • The workflow already includes the GitHub OIDC permission it needs: id-token: write.
  • The workflow uses NuGet/login@v1 to exchange the GitHub OIDC token for a short-lived NuGet API key during the publish job.
  • No long-lived NUGET_API_KEY repository secret is required for the GitHub publishing workflow once Trusted Publishing is configured.

Full setup and consuming-app guidance lives in usage.md.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
2.0.4 110 7/15/2026
2.0.3 103 7/13/2026
2.0.0 105 7/13/2026
1.0.0 109 7/7/2026

v2.0.0 - Cross-platform code generation workflow

Included:
- Added explicit generate and init CLI commands.
- Added scaffolded cross-platform CodeGeneration wrappers for consuming repos.
- Moved cleanup and verification behavior into config-driven repo workflow settings.
- Standardized config-relative path resolution from the codegen.json folder.

Breaking changes:
- Consuming repos should move to the scaffolded PowerShell wrapper workflow for cross-platform support.
- Newly scaffolded configs and scripts follow the v2 workflow conventions.