Hello,
the main motivation for a new tool was to make a cli for the end user, in
my opinion the existing tools are somewhat geared to be used by tools, with
hard-to-use parameter input and output.
For example with a (convoluted) request like this, the parameters are easy
to enter on the command line, and would be very hard to do with the
grpc_cli text format, or json:
service SM {
rpc SendSM(SMData) returns (SMData);
}
message SMData {
string data = 1;
string data2 = 2;
map<string, SMData> data_list = 3;
repeated SMData data_repeat = 4;
}
# grpcget invoke localhost:50051 SM.SendSM data="Value"
data_list.item1.data="Value inside the map with key 'item'"
data_list.item1.data2="Value inside the same map as the previous param"
data_repeat.0.data="Value inside the repeat with index '0'"
data_repeat.0.data2="Value into the same index '0' as the previous"
data_repeat.1.data2="Value inside the repeat with index '1'"
The other motivation was to allow intput and output customization, like
showing google.protobuf.* types as the real underlining type, and custom
application types like UUID to be passed as a single value instead as an
internal "user_id.value".
Things that are missing for now are supporting servers without reflection,
stream support, and even other intput/output formats like JSON.
Another objective of this was to create an embeddable library that I can
use to create a cli for my own service, which for example allows me to
abbreviate service names when calling, supporting application specific
types and authentication, etc.
gprc_cli also have a problem of documentation, I had to search a lot to
find out how to set the parameters on the command line.
Regards,
Rangel
On Tuesday, 24 April 2018 04:35:55 UTC-3, Jan Tattermusch wrote:
>
> Hi Rangel,
> thanks for sharing!
>
> How does your tool compare to the grpc_cli (which is part of gRPC) in
> terms of features? What are the key differences, pros and cons?
>
> Jan
>
> On Mon, Apr 23, 2018 at 1:59 PM, Rangel Reale <[email protected]
> <javascript:>> wrote:
>
>> grpcget is a command-line client for gRPC servers with reflection enabled.
>>
>> https://github.com/RangelReale/grpcget
>>
>> With this tool you can query the server for services and symbols, and
>> invoke methods with parameters.
>>
>> The parameters for a method invocation are simple name=value parameters,
>> and the name can have "." to set values in inner messages.
>>
>> The default implementation output is aimed to be user-friendly, not JSON
>> or marchine parseable. But using output customizers it is easy to create a
>> version that does output other formats.
>>
>> grpcget is also a customizable library that you can use in your projects.
>>
>> It supports customizing setters and getters so you can define special
>> handling for types that your application supports.
>>
>> Example:
>>
>> # grpcget -plaintext invoke localhost:50051 helloworld.Greeter.SayHello
>> name="Han Solo"
>> message: Hello Han Solo
>>
>> This library is heavily based on grpccurl, and the packages it uses.
>>
>> Thanks,
>> Rangel Reale
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "grpc.io" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/grpc-io.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/grpc-io/ea4af446-5efe-409c-a4d6-8cb93098dee9%40googlegroups.com
>>
>> <https://groups.google.com/d/msgid/grpc-io/ea4af446-5efe-409c-a4d6-8cb93098dee9%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
>
> Jan
>
--
You received this message because you are subscribed to the Google Groups
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/4297a649-d877-4ce1-ac23-3ebeb2b231b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.