Skip to main content
Search Documentation & Spec
Type to search all 17 pages

Tooling

Editor extensions and command-line tool for inspecting, querying, and editing .obuf files.

Editor extensions

Both extensions require the omnibuf CLI on your PATH. Opening a .obuf file decodes it to JSON and saving re-encodes valid JSON back to wire bytes.

Visual Studio Code

omnibuf.omnibuf-vscode

Custom editor for *.obuf files with syntax-highlighted JSON editing, Split and 16-byte Hex views, live reload on disk changes, and optional FileDescriptorSet schema settings. Invalid JSON blocks save so the underlying binary file stays intact.

code --install-extension omnibuf.omnibuf-vscode

Neovim / Vim

omnibuf/omnibuf-vim

BufReadCmd / BufWriteCmd plugin for *.obuf buffers with atomic write-back, companion hex split view (:OmnibufSplit), hex toggle (:OmnibufHex), and per-buffer schema switching (:OmnibufSchema).

-- lazy.nvim
{ "omnibuf/omnibuf-vim" }

-- vim-plug
Plug 'omnibuf/omnibuf-vim'

OmniBuf CLI

omnibuf/omnibuf-cli

Standalone command-line binary for decoding raw .obuf packets to JSON, querying fields with built-in jq filters, and encoding JSON back to wire bytes with or without a FileDescriptorSet schema.

# Homebrew (macOS & Linux)
brew install omnibuf/tap/omnibuf

# mise
mise use -g github:omnibuf/omnibuf-cli

# Shell script
curl -fsSL https://omnibuf.com/install.sh | sh

# Go
go install github.com/omnibuf/omnibuf-cli/cmd/omnibuf@latest

Schema-less inspection

Protobuf collapses strings, byte slices, sub-messages, maps, and packed arrays into one wire type, and shares a single varint wire type across booleans, signed integers, and unsigned integers. Inspecting a raw Protobuf packet with protoscope leaves you guessing what each field means. OmniBuf carries an explicit 4-bit wire type on every field, plus element types on arrays and maps. Running omnibuf prints the exact booleans, signed numbers, UTF-8 strings, arrays, and maps on the wire. Packets encoded with Field #0 also decode with their original field names.

$ protoscope packet.pbProtobuf · guesses types
1: 1          # bool / uint / sint / enum?
2: 3          # +3 uint or -2 sint?
3: {"FRA"}    # string / bytes / sub-msg?
4: "\x0a\x14" # bytes / string / packed array?
$ omnibuf -c packet.obufOmniBuf · actual values
{"field_1": true, "field_2": -2, "field_3": "FRA", "field_4": [10, 20]}
$ omnibuf -c packet-field0.obufOmniBuf + Field #0 · actual values & names
{"active": true, "delta": -2, "city": "FRA", "peers": [10, 20]}

jq queries

Pass a jq filter expression as the first argument (or via -q / --query or -f / --filter) to slice, select, or reshape decoded fields in a single command. Flags such as -r (raw string output) and -c (compact single-line JSON) work the same way as jq. Hex (-x), base64 (-b), and explicit file paths (-i / --input and -o / --output) are supported directly.

# Pretty-print any OmniBuf packet as JSON
omnibuf packet.obuf

# Extract a nested field as a raw string (-r)
omnibuf -r '.location.city' packet.obuf

# Filter array elements and emit compact JSON (-c)
omnibuf -c '.neighbors[] | select(.established) | .router' packet.obuf

JSON conversion

omnibuf auto-detects whether its input is JSON or OmniBuf wire bytes (pass -e / --encode or -d / --decode to force a direction). Piping a JSON object into omnibuf encodes it into a self-describing OmniBuf packet with Field #0 field names, preserving the JSON object's key order for sequential tags. Supplying --schema (-s) with a compiled FileDescriptorSet encodes or decodes against your .proto definitions, with --field0 (alias --self-describing) to embed inline field names and --max-schema-bytes (default 64 MiB) to cap descriptor file and decompressed size.

# Pipe JSON directly into omnibuf to produce self-describing wire bytes (Field #0)
echo '{"event": {"int": 10, "city": "FRA"}}' | omnibuf > event.obuf

# Round-trip back to JSON or query a field in one pipeline
echo '{"event": {"int": 10, "city": "FRA"}}' | omnibuf | omnibuf '.event.city'

# Encode or decode against a compiled Protobuf FileDescriptorSet (.pb, .pb.gz, .json)
omnibuf encode --schema descriptors.pb --type demo.v1.PeerUpdate input.json > packet.obuf
omnibuf decode --schema descriptors.pb --type demo.v1.PeerUpdate packet.obuf

Schemaless type mapping

Converting JSON without --schema requires a top-level JSON object. omnibuf infers each wire type from the JSON literal and assigns sequential field numbers starting at 1 (keys named field_<N> reserve field number N directly). Pass --deterministic to sort keys lexicographically before numbering, or --no-field0 to omit inline field names. Pass --schema descriptors.pb --type pkg.Msg for exact .proto field numbers, 32-bit floats, fixed-width integers, enums, and maps.

JSON ValueOmniBuf Wire TypeProtobuf Equiv.
true / falseWireBoolTrue (3) / WireBoolFalse (2)bool
Non-negative integer (0..2^64-1)WireUint (0)uint32 / uint64
Negative integer (-2^63..-1)WireSint (1, ZigZag)sint32 / sint64
Decimal, exponent (./e), or >64-bitWireFloat64 (9, 8B LE)double
String ("FRA")WireString (10, UTF-8)string
"base64:..." (valid std base64)WireBytes (11, raw bytes)bytes
Nested object ({...})WireSubMsg (12)message
Homogeneous array ([...])WireArray (13)
Numbers widen across elements: WireUint → WireSint → WireFloat64. All-base64 string arrays encode as WireBytes. Objects share one field table. Nested arrays and empty arrays are supported; mixed incompatible types fail and null elements are omitted.
repeated T
nullOmitted (absent field)unset field