/grpc-visualizer

Visually inspect protobuf files. Developed while interning @cisco.

Primary LanguageJavaMIT LicenseMIT

grpc-visualizer

CLI to visually inspect gRPC's .proto config files.

Demo GIF (>>> indicates a streaming RPC call, ──> indicates a singular value.)

grpc-visualizer path/to/grpc-config.proto ["command 1" "command 2"...]

commands: 
	'help'
	'message [REGEX]' — display structure of message data
	'digraph (svg|pdf|png|dot) [REGEX]' — display structure of message types in relation to each other
	'service [REGEX]' — display client/server RPC functions
	'gui' — open web server on port 8383 for interactive digraphs

Directional Graphs

Input:

message RecursiveType {
    // ...
    My code = 4;
}
message My {
    RecursiveType should = 1;
    // ...
    RecursiveType crash = 3;
    My code = 4;
}
message Person {
    // ...
    message PhoneNumber { /* ... */ }
    repeated PhoneNumber phones = 4;
}
message AddressBook {
    repeated Person people = 1;
}

Command: digraph svg
Output:
Demo Digraph

Cyclic Dependency Detection

Example 1

Input:

message A {
    B aHasB = 1;
    C aAlsoHasC = 2;
}
message B {
    D bHasD = 1;
}
message C {
    D cHasD = 1;
}
message D {
    A dMischievouslyHasA = 1;
}

Command: digraph svg A
Output:
Demo Cyclic Dependency Detection

Example 2

Input:

message A {
    B aHasB = 1;
}
message B {
    C bHasC = 1;
    D andD = 2;
    E andE = 3;
}
message C {
    D cAlsoHasD = 1;
}
message D {
    A dMischievouslyHasA = 1;
}
message E {
}

Command: digraph svg
Output:
Demo Cyclic Dependency Detection

Command: digraph svg A
Output:
Demo Cyclic Dependency Detection

Command: digraph svg C
Output:
Demo Cyclic Dependency Detection

Command: digraph svg D
Output:
Demo Cyclic Dependency Detection