Skip to content

xclud/dart_grpcgen

Repository files navigation

pub package likes points popularity license stars forks sdk version

Command-line application for code generation for gRPC clients from gRPC Reflection.

Get Started

Install the latest version of the tool globally, exposing the CLI on the command line:

dart pub global activate grpcgen

Usage:

grpcgen -h https://example.com

To install the tool as a dev dependency in your current project:

Add grpcgen package in your dev_dependencies:

dev_dependencies:
# dart run grpcgen -h https://example.com
grpcgen: any

Note: This package should not be added to dependencies.

Usage:

dart run grpcgen -h https://example.com

Usage

-h, --host=<https://example.com> (mandatory) Url to the web server with gRPC Reflection.
-o, --output=<lib/grpc/generated> Output directory to put the generated files (defaults to "lib/grpc/generated/").
-s, --schema=<v1> The schema to use, either v1alpha or v1 (defaults to "v1alpha").
-r, --[no-]reflection If set, reflection code is also generated.