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
                    
if you are setting up this repo
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
                    
nuke :add-package NetRpc.Cli --version 0.0.0-alpha
                    

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

  1. Clone the repository: git clone https://github.com/AdeAttwood/NetRpc.git
  2. Build the solution: dotnet build NetRpc.sln

Usage

Installing the Tool

  1. Build and pack the tool: dotnet pack src/NetRpc.Cli/NetRpc.Cli.csproj
  2. 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-jsonapi for C# or typescript-client for 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

  1. Restore dependencies: dotnet restore
  2. Build: dotnet build
  3. Run tests: dotnet test

Contributing

Contributions are welcome! Please submit issues and pull requests.

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