All Projects → xoofx → grpc-curl

xoofx / grpc-curl

Licence: BSD-2-Clause license
grpc-curl is a command line tool for interacting with gRPC servers

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to grpc-curl

protobuf-ts
Protobuf and RPC for TypeScript
Stars: ✭ 527 (+793.22%)
Mutual labels:  protocol-buffers, grpc-client
Evans
Evans: more expressive universal gRPC client
Stars: ✭ 2,710 (+4493.22%)
Mutual labels:  protocol-buffers, grpc-client
stockholm
💵 Modern Python library for working with money and monetary amounts. Human friendly and flexible approach for development. 100% test coverage + built-in support for GraphQL and Protocol Buffers transports using current best-practices.
Stars: ✭ 26 (-55.93%)
Mutual labels:  protocol-buffers
terraform-external-module-artifact
Terraform module to fetch any kind of artifacts using curl (binary and text okay)
Stars: ✭ 13 (-77.97%)
Mutual labels:  curl
ios-grpc-note-crud-app
Swift iOS gRPC Client Note Taking App
Stars: ✭ 16 (-72.88%)
Mutual labels:  grpc-client
adempiere-vue
ADempiere-Vue is a new UI for ADempiere ERP, CRM & SCM. It is based on Vue and uses the UI Toolkit element-ui. It is a great UI for ADempiere ERP, CRM & SCM, based on the newest development stack of Vue, built-in i18n solution, typical templates for enterprise applications, lots of awesome features. This project was forked from Vue-Element-Admin…
Stars: ✭ 37 (-37.29%)
Mutual labels:  grpc-client
antk
Redkato, - Indonesian anime scraper
Stars: ✭ 14 (-76.27%)
Mutual labels:  curl
CwsShareCount
PHP class to get social share count for Delicious, Facebook, Google+, Linkedin, Pinterest, Reddit, StumbleUpon and Twitter.
Stars: ✭ 13 (-77.97%)
Mutual labels:  curl
protodoc
protodoc generates Protocol Buffer documentation.
Stars: ✭ 43 (-27.12%)
Mutual labels:  protocol-buffers
get header
This function is similar to the get_headers function
Stars: ✭ 35 (-40.68%)
Mutual labels:  curl
onymous-plurk
Anonymous Plurk Cross-matching Tool - Plurk偷偷說交叉比對工具
Stars: ✭ 20 (-66.1%)
Mutual labels:  curl
igdb
IGDB PHP API Wrapper
Stars: ✭ 20 (-66.1%)
Mutual labels:  curl
curl
A PHP 5.4+ library for making asynchronous HTTP requests.
Stars: ✭ 73 (+23.73%)
Mutual labels:  curl
api-test
🌿 A simple bash script to test JSON API from terminal in a structured and organized way.
Stars: ✭ 53 (-10.17%)
Mutual labels:  curl
ambient
What can a public hotspot tell you?
Stars: ✭ 57 (-3.39%)
Mutual labels:  curl
request
http requests DSL for R
Stars: ✭ 36 (-38.98%)
Mutual labels:  curl
kafka-protobuf-serde
Serializer/Deserializer for Kafka to serialize/deserialize Protocol Buffers messages
Stars: ✭ 52 (-11.86%)
Mutual labels:  protocol-buffers
grpc-client-pool
grpc client pool for grpc-sidecar and grpc-proxy.
Stars: ✭ 61 (+3.39%)
Mutual labels:  grpc-client
makego
Makefile setup for our Golang projects.
Stars: ✭ 65 (+10.17%)
Mutual labels:  protocol-buffers
flutter curl
Flutter plugin to use libcurl for HTTP calls
Stars: ✭ 42 (-28.81%)
Mutual labels:  curl

grpc-curl Build Status Coverage Status NuGet

grpc-curl is a command line tool for interacting with gRPC servers.

All the functionalities of grpc-curl are also accessible through the NuGet package DynamicGrpc that is part of this repository.

This tool is the .NET equivalent of the popular gRPCurl written in Golang.

NOTE: grpc-curl doesn't not support yet all the features that gRPCurl is providing.

Features

  • Allows to invoke method services for all gRPC calling modes (unary, client streaming, server streaming, full-duplex).
  • Allows to print proto reflection descriptors back to proto language (via --describe with grpc-curl, or via the API .ToProtoString() with DynamicGrpc)
  • Supports for plain Protocol Buffers naming conventions and JSON.
  • Supports for google.protobuf.Any: The type has to be encoded - and is decoded with the shadow property @type on a dictionary (e.g @type = "type.googleapis.com/YourTypeName").
  • Build on top of the DynamicGrpc library available as a separate NuGet package.
  • Build for net6.0+
  • Available for multiple platforms. See binaries section below.

Usage

grpc-curl currently requires that the gRPC server has activated gRPC reflection.

Copyright (C) 2022 Alexandre Mutel. All Rights Reserved
grpc-curl - Version: 1.3.6

Usage: grpc-curl [options] address service/method

  address: A http/https URL or a simple host:address.
           If only host:address is used, HTTPS is used by default
           unless the options --http is passed.

## Options

  -d, --data=VALUE           Data for string content.
      --http                 Use HTTP instead of HTTPS unless the protocol is
                               specified directly on the address.
      --json                 Use JSON naming for input and output.
      --describe             Describe the service or dump all services
                               available.
  -v, --verbosity[=VALUE]    Set verbosity.
  -h, --help                 Show this help.

Query a service

./grpc-curl --json -d "{""getStatus"":{}}" http://192.168.100.1:9200 SpaceX.API.Device.Device/Handle

Will print the following result:

{
  "apiVersion": 4,
  "dishGetStatus": {
    "deviceInfo": {
      "id": "0000000000-00000000-00000000",
      "hardwareVersion": "rev2_proto3",
      "softwareVersion": "992cafb5-61c7-46a3-9ef7-5907c8cf90fd.uterm.release",
      "countryCode": "FR",
      "utcOffsetS": 1
    },
    "deviceState": {
      "uptimeS": 667397
    },
    "obstructionStats": {
      "fractionObstructed": 2.2786187E-06,
      "wedgeFractionObstructed": [
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0
      ],
      "wedgeAbsFractionObstructed": [
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0
      ],
      "validS": 667070.0,
      "avgProlongedObstructionIntervalS": "NaN"
    },
    "alerts": {
      "roaming": true
    },
    "downlinkThroughputBps": 461012.72,
    "uplinkThroughputBps": 294406.6,
    "popPingLatencyMs": 30.35,
    "boresightAzimuthDeg": 0.7464048,
    "boresightElevationDeg": 65.841354,
    "gpsStats": {
      "gpsValid": true,
      "gpsSats": 12
    }
  }
}

Describe a service

./grpc-curl --describe http://192.168.100.1:9200 SpaceX.API.Device.Device

Will print:

// SpaceX.API.Device.Device is a service:
service Device {
  rpc Stream ( .SpaceX.API.Device.ToDevice ) returns ( .SpaceX.API.Device.FromDevice );
  rpc Handle ( .SpaceX.API.Device.Request ) returns ( .SpaceX.API.Device.Response );
}

Describe all proto files serviced via reflection

./grpc-curl --describe http://192.168.100.1:9200

Will print:

// spacex/api/common/status/status.proto is a proto file.
syntax = "proto3";

package SpaceX.API.Status;

// SpaceX.API.Status.Status is a message:
message Status {
  int32 code = 1;
  string message = 2;
}


// spacex/api/device/command.proto is a proto file.
syntax = "proto3";

package SpaceX.API.Device;

// SpaceX.API.Device.PublicKey is a message:
message PublicKey {
  string key = 1;
  repeated Capability capabilities = 2;
}

// ....... and more prints ........

Usage API

All the functionalities of grpc-curl are also accessible through the NuGet package DynamicGrpc.

var channel = GrpcChannel.ForAddress("http://192.168.100.1:9200");
// Fetch reflection data from server
var client = await DynamicGrpcClient.FromServerReflection(channel);

// Call the method `Handle` on the service `SpaceX.API.Device.Device`
var result = await client.AsyncUnaryCall("SpaceX.API.Device.Device", "Handle", new Dictionary<string, object>()
{
    { "get_status", new Dictionary<string, object>() }
});

// Print a proto descriptor
FileDescriptor descriptor = client.Files[0];
Console.WriteLine(descriptor.ToProtoString());

Binaries

grpc-curl is available on multiple platforms:

Platform Packages
win-x64, win-arm, win-arm64 zip
linux-x64, linux-arm, linux-arm64 deb, tar
rhel-x64 rpm, tar
osx-x64, osx-arm64 tar

If you have dotnet 6.0 installed, you can install this tool via NuGet:

dotnet tool install --global grpc-curl

Otherwise, you can install native binaries to Windows, Linux, and macOS with the various debian/rpm/zip packages available directly from the releases.

grpc-curl is also available via homebrew for macOS and Linux:

$ brew tap xoofx/grpc-curl
$ brew install grpc-curl

License

This software is released under the BSD-Clause 2 license.

Author

Alexandre Mutel aka xoofx.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].