{"id":51515736,"url":"https://github.com/meta-engine/protobuf-csharp-httpclient","last_synced_at":"2026-07-08T11:00:58.872Z","repository":{"id":368935026,"uuid":"1281458876","full_name":"meta-engine/protobuf-csharp-httpclient","owner":"meta-engine","description":"Generate idiomatic C# gRPC-Connect (or binary gRPC) clients and models from Protobuf (.proto) definitions — a dotnet tool.","archived":false,"fork":false,"pushed_at":"2026-06-26T15:19:01.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-02T22:26:59.347Z","etag":null,"topics":["api-client","codegen","csharp","dotnet","dotnet-tool","grpc","http-client","metaengine","protobuf","protobuf-codegen"],"latest_commit_sha":null,"homepage":"https://www.metaengine.eu/packages/protobuf-csharp-httpclient","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meta-engine.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-26T15:18:58.000Z","updated_at":"2026-06-26T15:26:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/meta-engine/protobuf-csharp-httpclient","commit_stats":null,"previous_names":["meta-engine/protobuf-csharp-httpclient"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/meta-engine/protobuf-csharp-httpclient","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meta-engine%2Fprotobuf-csharp-httpclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meta-engine%2Fprotobuf-csharp-httpclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meta-engine%2Fprotobuf-csharp-httpclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meta-engine%2Fprotobuf-csharp-httpclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meta-engine","download_url":"https://codeload.github.com/meta-engine/protobuf-csharp-httpclient/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meta-engine%2Fprotobuf-csharp-httpclient/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35262336,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-08T02:00:06.796Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","codegen","csharp","dotnet","dotnet-tool","grpc","http-client","metaengine","protobuf","protobuf-codegen"],"created_at":"2026-07-08T11:00:58.012Z","updated_at":"2026-07-08T11:00:58.855Z","avatar_url":"https://github.com/meta-engine.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# MetaEngine Protobuf C# HttpClient\n\n[![NuGet version](https://img.shields.io/nuget/v/MetaEngine.CSharp.Protobuf.HttpClient.Tool.svg)](https://www.nuget.org/packages/MetaEngine.CSharp.Protobuf.HttpClient.Tool/)\n[![NuGet downloads](https://img.shields.io/nuget/dt/MetaEngine.CSharp.Protobuf.HttpClient.Tool.svg)](https://www.nuget.org/packages/MetaEngine.CSharp.Protobuf.HttpClient.Tool/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n**Generate idiomatic C# clients and models from Protobuf (`.proto`) definitions.**\n\n`HttpClient`-based gRPC-Connect services with `System.Text.Json` models — or binary gRPC clients via `Grpc.Net.Client` + protobuf-net — typed, with optional XML docs, DataAnnotations validation from protovalidate, retries, auth, and DI registration.\n\n\u003e Distributed as a **.NET tool** — `dotnet tool install` and run it from the command line. No project reference, no MSBuild wiring; it uses the .NET SDK you already have.\n\n---\n\n## Quick Links\n\n- **NuGet Package**: [MetaEngine.CSharp.Protobuf.HttpClient.Tool](https://www.nuget.org/packages/MetaEngine.CSharp.Protobuf.HttpClient.Tool)\n- **Website**: [metaengine.eu](https://www.metaengine.eu)\n\n---\n\n## Features\n\n- ✅ **Native dotnet tool** - `dotnet tool install` and run; no project reference, no build-time wiring\n- ✅ **gRPC-Connect services** - One typed `HttpClient` service per gRPC service (Connect-RPC over JSON)\n- ✅ **Binary gRPC option** - `--grpc-binary` switches to `Grpc.Net.Client` + protobuf-net\n- ✅ **`System.Text.Json` models** - Records/classes with typed members and standalone enums\n- ✅ **XML docs** - Optional `/// \u003csummary\u003e` doc comments from proto comments\n- ✅ **DataAnnotations** - Optional `[Required]`, `[StringLength]`, `[Range]`, ... from protovalidate (`buf.validate`) constraints\n- ✅ **DI registration** - Optional `IServiceCollection` extension methods for typed `HttpClient`s\n- ✅ **Type mapping** - Override protobuf well-known type mappings to .NET types\n- ✅ **Auth \u0026 resilience** - Bearer/basic auth, custom headers, retries with exponential backoff\n- ✅ **Type Filtering** - Generate only the messages/enums you need\n\n---\n\n## Installation\n\n```bash\n# Global (available everywhere)\ndotnet tool install -g MetaEngine.CSharp.Protobuf.HttpClient.Tool\n\n# Or pin it to a repo (local tool manifest)\ndotnet new tool-manifest        # once per repo\ndotnet tool install MetaEngine.CSharp.Protobuf.HttpClient.Tool\n```\n\n---\n\n## Requirements\n\n- **.NET SDK 8.0** or later — the same toolchain you use to build C#. The tool runs on any platform .NET supports (Linux, macOS, Windows).\n\n---\n\n## Quick Start\n\n```bash\nmetaengine-protobuf-csharp-httpclient \u003cinput\u003e \u003coutput\u003e \u003cnamespace\u003e [options]\n```\n\n### Recommended Setup\n\n```bash\nmetaengine-protobuf-csharp-httpclient ./service.proto ./Generated Shop.Client \\\n  --documentation \\\n  --dependency-injection\n```\n\n### More Examples\n\n```bash\n# Binary gRPC client (Grpc.Net.Client + protobuf-net) with retries\nmetaengine-protobuf-csharp-httpclient service.proto ./Generated Shop.Client \\\n  --grpc-binary --retries 3\n\n# Override a well-known type mapping + auth\nmetaengine-protobuf-csharp-httpclient service.proto ./Generated Shop.Client \\\n  --type-mapping google.protobuf.Timestamp=System.DateTime --bearer-auth API_TOKEN\n```\n\n---\n\n## CLI Options\n\n| Argument / Option | Description | Default |\n|---|---|---|\n| `input` *(required)* | Protobuf (`.proto`) file path or inline proto content | - |\n| `output` *(required)* | Output directory for generated C# files | - |\n| `namespace` *(required)* | Root namespace for the generated client and models | - |\n| `--documentation` | Generate XML doc comments from proto comments | `false` |\n| `--middleware` | Generate middleware infrastructure (`ApiDelegatingHandler` + `ServiceCollectionExtensions`) | `false` |\n| `--validation-annotations` | Emit `System.ComponentModel.DataAnnotations` attributes from protovalidate (`buf.validate`) constraints | `false` |\n| `--bearer-auth [env-var]` | Bearer token from an env var (default `API_TOKEN`); adds an `Authorization` header | - |\n| `--basic-auth` | Basic auth from env vars (`API_USERNAME` / `API_PASSWORD`) | `false` |\n| `--retries [max-attempts]` | Enable retries with exponential backoff; optional value sets max attempts | - |\n| `--custom-header \u003cname=env-var\u003e` | Static header from an env var. Repeatable | - |\n| `--grpc-binary` | Generate binary gRPC clients (`Grpc.Net.Client` + protobuf-net) instead of Connect-RPC JSON | `false` |\n| `--dependency-injection` | Generate `IServiceCollection` extension methods for DI registration of typed `HttpClient`s | `false` |\n| `--type-mapping \u003cprotobuf.Type=DotNetType\u003e` | Override a protobuf well-known type mapping to a fully-qualified .NET type (e.g. `google.protobuf.Timestamp=System.DateTime`). Repeatable | - |\n| `--include-types \u003ctypes\u003e` | Only generate these proto types (comma-separated message/enum names) | - |\n| `--clean` | Clean the destination directory before generating | `false` |\n| `--verbose` | Enable verbose logging | `false` |\n\n\u003e **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.\n\n---\n\n## Generated Code Structure\n\n```\noutput/\n  ├── Models/                    # One file per proto message/enum (System.Text.Json)\n  │   ├── Order.cs               # public class Order { ... }\n  │   ├── OrderStatus.cs         # standalone enum type\n  │   └── ...\n  ├── Client/                    # One service per gRPC service\n  │   ├── OrderServiceClient.cs  # all RPCs on OrderService\n  │   └── ...\n  └── BaseHttpClient.cs          # shared gRPC-Connect / gRPC plumbing\n```\n\n---\n\n## Support\n\n- **Issues**: [GitHub Issues](https://github.com/meta-engine/protobuf-csharp-httpclient/issues)\n- **Email**: info@metaengine.eu\n- **Website**: [metaengine.eu](https://www.metaengine.eu)\n\n---\n\n## License\n\nMIT License - see [LICENSE](./LICENSE) file for details.\n\n---\n\n## About This Repository\n\nThis is the **documentation and issue tracking repository** for MetaEngine Protobuf C# HttpClient. The package is published to [NuGet.org](https://www.nuget.org/packages/MetaEngine.CSharp.Protobuf.HttpClient.Tool).\n\nSource code is proprietary, but the package is free to use under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeta-engine%2Fprotobuf-csharp-httpclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeta-engine%2Fprotobuf-csharp-httpclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeta-engine%2Fprotobuf-csharp-httpclient/lists"}