DevTools Logo

Protocol Buffers AST Explorer

Protocol Buffers AST Explorer

Inspect .proto messages, enums, services and resolved types locally

.proto input

Paste a .proto source and the explorer parses it into a structured AST: every message with typed, numbered fields; every enum with values; every service with request/response RPC signatures. Field types are resolved against the declared scope so you can tell scalars from message references at a glance. The parsed representation is exportable as JSON — handy for codegen pipelines, docs generation, or diffing schema evolution between versions. Parsing runs via the protobufjs engine, loaded lazily and executed entirely client-side; your schema definitions never leave your device.

    Examples

    Nested message walk

    Input
    parseProtobuf('syntax = "proto3"; message Outer { message Inner { int32 value = 1; } Inner inner = 1; }')
    Output
    { messages: ["Outer", "Outer.Inner"], nestedMessages: ["Outer.Inner"] }

    Outer lists Inner as a nested message and both appear with dotted full names.

    Sorted enum plus RPC

    Input
    parseProtobuf('syntax = "proto3"; enum P { HIGH = 2; LOW = 0; } service S { rpc One (A) returns (B); }')
    Output
    { enums: [{ values: [{ LOW: 0 }, { HIGH: 2 }] }], methods: [{ name: "One", requestStream: false }] }

    Enum values sort by id and service methods keep request/response types with streaming flags.

    About this tool

    Protobuf AST Explorer parses .proto sources with parseProtobuf(source) (alias exploreProtobuf): protobufjs compiles the schema with keepCase, then walks the reflection root into sorted messages, enums, and services plus a stable JSON ast of { syntax, package, imports, root }, with imports sorted alphabetically.

    Fields resolve to scalar, message, enum, or unknown kinds via SCALAR_TYPES plus root.lookup: message User { Profile profile = 2; } reports kind message with resolvedType demo.Profile, repeated and map flags preserved, and rule defaulting to repeated or optional when protobufjs omits it.

    Output is deterministic: messages, enums, and services sort by fullName, nested children sort by name, enum values sort by id then name, and service methods plus namespace JSON sort by method and member name, so repeated parses are byte-identical.

    How to use this tool

    1. Paste the schema

      Provide proto2 or proto3 source with syntax, package, messages, enums, and services.

    2. Read resolved fields

      Check each field kind and resolvedType to trace message and enum references.

    3. Walk nesting

      Use nestedMessages and the ast.root tree to follow Outer.Inner style scopes.

    4. Copy stable JSON

      Export the sorted ast for snapshots, docs, or code-review diffs.

    Use cases

    Reviewing schema changes

    Diff sorted messages, fields, and RPCs before merging a .proto update.

    Tracing type references

    Follow resolvedType links to find which messages depend on a renamed enum.

    Documenting services

    Export the method map with streaming flags for API docs and client generation.

    Common mistakes

    Mistake:Expecting declaration order to be preserved.

    Fix:Messages, enums, services, and children sort alphabetically — search by fullName instead of position.

    Mistake:Reading rule as always present.

    Fix:protobufjs may omit rule, so the explorer defaults it to repeated or optional — check repeated and map flags directly.

    Mistake:Assuming broken syntax returns empty output.

    Fix:Invalid schemas throw protobufjs parse errors — fix the reported illegal or expected token first.

    Frequently asked questions

    What does this tool do?

    It runs parseProtobuf on .proto source with protobufjs, returning sorted messages with field kinds, enums with sorted values, services with RPC streaming flags, and a deterministic ast of syntax, package, imports, and root.

    How are field kinds and nesting resolved?

    Scalar names map to scalar, root.lookup resolves message and enum targets with dotted resolvedType, and Outer lists Inner in nestedMessages with full names like Outer.Inner.

    Is my schema uploaded or stored?

    No. Protobuf parsing and tree building run entirely in your browser.

    Why did parsing throw, or the order change?

    Invalid syntax throws the protobufjs illegal or expected error, and messages, enums, services, and children always sort alphabetically rather than keeping declaration order.

    References & standards

    .env Secret Safety Linter

    Validate .env syntax and spot likely leaked credentials or placeholder secrets.

    .htaccess Generator

    Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth

    2D Fluid Dynamics & Particle Physics Sandbox

    A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.

    AI Function Calling Schema Generator

    Generate function calling JSON schemas from TypeScript interfaces

    Algorithm Arena & Data Structure Visualizer

    Interactive arena for algorithms and data structures: eight sorting algorithms racing on one seeded input, six pathfinding algorithms walking generated mazes, and BST, AVL, Red-Black, B-tree, heap and trie operations replayed step by step with rotations highlighted. Every run shows the Big-O table and the phase-highlighted reference implementation in four languages, and compared values can be played as pitch (sonification) through the shared audio engine. Everything runs client-side; inputs never leave the browser.

    Ansible Playbook Generator

    Build an Ansible playbook — hosts, vars, and tasks with modules — as YAML