← Back to Docs
Recipe

Protobuf schema writer

Generate a typed Protobuf schema from a Meridian payload definition and write it to disk. Used when shipping structured telemetry or license envelopes to native components.

Prerequisites

  • Meridian CLI v2.4+ installed and authenticated
  • A payload.json definition in the working directory
  • Write access to the target output path

Steps

  1. Define the payload shape

    Create payload.json with field names, types, and wire numbers. Supported types: string, bytes, uint32, uint64, bool, enum, repeated, and nested messages.

  2. Run the schema generator
    meridian proto write --in payload.json --out schema.proto
  3. Verify the output

    Open schema.proto and confirm all message definitions, field numbers, and type mappings are correct.

  4. Compile for your target language
    protoc --cpp_out=./gen schema.proto

Flags

FlagDefaultDescription
--inpayload.jsonPath to the payload definition file
--outschema.protoDestination path for the generated .proto
--packagemeridianProtobuf package name