NetRpc.Cli
0.0.0-alpha
This is a prerelease version of NetRpc.Cli.
The owner has unlisted this package.
This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet tool install --global NetRpc.Cli --version 0.0.0-alpha
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
dotnet tool install --local NetRpc.Cli --version 0.0.0-alpha
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=NetRpc.Cli&version=0.0.0-alpha&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package NetRpc.Cli --version 0.0.0-alpha
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
NetRpc
NetRpc is a .NET tool for generating RPC clients and servers from Thrift IDL files. It supports code generation for C# and TypeScript, enabling seamless cross-language RPC communication.
Features
- Parse Thrift IDL files using ANTLR.
- Generate C# server code.
- Generate TypeScript client code.
- Command-line interface for easy integration.
Installation
- Clone the repository:
git clone https://github.com/AdeAttwood/NetRpc.git - Build the solution:
dotnet build NetRpc.sln
Usage
Installing the Tool
- Build and pack the tool:
dotnet pack src/NetRpc.Cli/NetRpc.Cli.csproj - Install globally:
dotnet tool install -g --add-source ./src/NetRpc.Cli/bin/Release rpcnet.cli
CLI Tool
Run the installed tool to generate code from a Thrift file:
rpcnet --entry path/to/thrift/file.thrift --generator csharp-jsonapi
You can also specify multiple entry points for services that share common includes:
rpcnet --entry service1.thrift --entry service2.thrift --generator csharp-jsonapi
Options:
--entry(-e): Path to the Thrift IDL file. Can be specified multiple times for multiple entry points.--generator(-g): Code generator (csharp-jsonapifor C# ortypescript-clientfor TypeScript).--include(-i): Add a directory to the list of directories searched for include directives. Can be specified multiple times.--output(-o): The output file to save the generated code to (optional, defaults to console).
Generated code is output to the console by default. Redirect to a file if
needed, e.g., rpcnet ... > output.cs, or use the --output option.
Examples
See the samples/ directory for working examples:
DotnetJsonWebApi: ASP.NET Core Web API with generated C# service.DenoTypescriptClient: Deno TypeScript client for RPC calls.
Building from Source
- Restore dependencies:
dotnet restore - Build:
dotnet build - Run tests:
dotnet test
Contributing
Contributions are welcome! Please submit issues and pull requests.
| Product | Versions 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 |
|---|