Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

tlbx-to-json / json-to-tlbx

Convert between TeaLeaf binary format and JSON directly, without going through the text format.

tlbx-to-json

Convert a TeaLeaf binary file to JSON.

Usage

tealeaf tlbx-to-json <input.tlbx> [-o <output.json>]

Arguments

ArgumentRequiredDescription
<input.tlbx>YesPath to the TeaLeaf binary file
-o <output.json>NoOutput file path. If omitted, writes to stdout

Examples

# Write to file
tealeaf tlbx-to-json data.tlbx -o data.json

# Write to stdout
tealeaf tlbx-to-json data.tlbx

# Pipe to jq for filtering
tealeaf tlbx-to-json data.tlbx | jq '.config'

Notes

  • Produces the same JSON output as to-json on the equivalent text file
  • Reads the binary directly – no intermediate text conversion

json-to-tlbx

Convert a JSON file directly to TeaLeaf binary format.

Usage

tealeaf json-to-tlbx <input.json> -o <output.tlbx>

Arguments

ArgumentRequiredDescription
<input.json>YesPath to the JSON file
-o <output.tlbx>YesPath for the output binary file

Examples

# Direct JSON to binary
tealeaf json-to-tlbx api_data.json -o compact.tlbx

# Verify the result
tealeaf info compact.tlbx
tealeaf tlbx-to-json compact.tlbx -o verify.json

Notes

  • Performs schema inference (same as from-json)
  • Compiles directly to binary – no intermediate .tl file
  • Compression is enabled by default

Workflow Comparison

# Two-step (via text)
tealeaf from-json data.json -o data.tl
tealeaf compile data.tl -o data.tlbx

# One-step (direct)
tealeaf json-to-tlbx data.json -o data.tlbx

Both approaches produce equivalent binary output.

See Also