MetaEngine.CSharp.Protobuf.HttpClient.Tool 1.0.0

dotnet tool install --global MetaEngine.CSharp.Protobuf.HttpClient.Tool --version 1.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 MetaEngine.CSharp.Protobuf.HttpClient.Tool --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=MetaEngine.CSharp.Protobuf.HttpClient.Tool&version=1.0.0
                    
nuke :add-package MetaEngine.CSharp.Protobuf.HttpClient.Tool --version 1.0.0
                    

metaengine-protobuf-csharp-httpclient

Generate idiomatic C# clients and models from a Protobuf (.proto) definition — HttpClient-based gRPC-Connect services with System.Text.Json models, or binary gRPC clients via Grpc.Net.Client + protobuf-net, with optional XML docs, validation annotations, retries, auth, and DI registration.

Powered by MetaEngine. Distributed as a .NET tool — install it with dotnet tool install and run it from the command line; no project reference required.

Install

# Global (available everywhere)
dotnet tool install -g MetaEngine.CSharp.Protobuf.HttpClient.Tool

# Or pin it to a repo (local tool manifest)
dotnet new tool-manifest        # once per repo
dotnet tool install MetaEngine.CSharp.Protobuf.HttpClient.Tool

Usage

metaengine-protobuf-csharp-httpclient <input> <output> <namespace> [options]
Argument / Option Description
input Protobuf (.proto) file path or inline proto content
output Output directory for generated C# files
namespace Root namespace for the generated client and models
--documentation Generate XML doc comments from proto comments
--middleware Generate middleware infrastructure (ApiDelegatingHandler + ServiceCollectionExtensions)
--validation-annotations Emit System.ComponentModel.DataAnnotations attributes on models from protovalidate (buf.validate) constraints
--bearer-auth [env-var] Bearer token from an env var (default API_TOKEN); adds an Authorization header
--basic-auth Basic auth from env vars (API_USERNAME / API_PASSWORD)
--retries [max-attempts] Enable retries with exponential backoff; optional value sets max attempts
--custom-header <name=env-var> Static header from an env var. Repeatable
--grpc-binary Generate binary gRPC clients (Grpc.Net.Client + protobuf-net) instead of Connect-RPC JSON
--dependency-injection Generate IServiceCollection extension methods for DI registration of typed HttpClients
--type-mapping <protobuf.Type=DotNetType> Override a protobuf well-known type mapping to a fully-qualified .NET type (e.g. google.protobuf.Timestamp=System.DateTime). Repeatable
--include-types <types> Only generate these proto types (comma-separated message/enum names)
--clean Clean the destination directory before generating
--verbose Enable verbose logging

Example

metaengine-protobuf-csharp-httpclient ./service.proto ./Generated Shop.Client \
  --documentation --dependency-injection --retries 3

Note — gRPC-Connect surfaces errors as gRPC status codes parsed into a typed GrpcException, so there is no HTTP-status --error-handling flag: error handling is unconditional engine behavior.

Requirements

The .NET SDK (8.0 or newer) — the same toolchain you already use to build C#. The tool runs on any platform .NET supports (Linux, macOS, Windows).

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
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
1.0.0 102 6/26/2026