bytepeel

bytepeel decodes encoded and binary data layer by layer: hex, base64, PEM, JWTs, xxd/hexdump -C dumps, gzip/zlib/zstd, DER/ASN.1, CBOR, MessagePack and schemaless protobuf, nested in any order. It is built so that AI coding agents can call it instead of reading bytes by eye or writing a throwaway decoding script.

$ printf 'ChRTR1ZzYkc4c0lIZHZjbXhrSVNFPRAq' | bytepeel --format tree
base64(std,padded) [0..32] conf=0.85 -> 24 bytes
  protobuf [0..24] conf=0.90
    #1 LEN [0..22] len=20: string 0.95 "SGVsbG8sIHdvcmxkISE=" | packed_varint 0.03 | bytes 0.02
      base64(std,padded) [0..20] conf=0.95 -> 14 bytes
        utf8 [0..14] conf=1.00 "Hello, world!!"
    #2 VARINT [22..24] uint=42 int=42 sint=21
  • Recursive: base64 → protobuf → a string field that is base64 again → text, in one call.
  • Honest about ambiguity: each protobuf LEN field lists ranked interpretations (message, string, packed_varint, bytes), and each varint shows its uint, int and sint views.
  • Agent-friendly: compact JSON by default, byte ranges on everything, 64-bit integers as strings (safe for jq and JavaScript), and errors as {"error":{"code","message","offset"}} with stable codes.
  • Edits too: bytepeel set changes a value deep inside and re-encodes every layer in its original style.
  • Small: a zero-dependency Rust core and a single static binary.
npx bytepeel --help              # the CLI and MCP server, no install needed
npm install -g bytepeel          # or install it (Node 18+)
cargo install bytepeel           # or build it (Rust 1.87+)

Where to go next#