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

decompile

Convert a TeaLeaf binary file (.tlbx) back to the human-readable text format (.tl).

Usage

tealeaf decompile <input.tlbx> -o <output.tl> [--compact] [--compact-floats]

Arguments

ArgumentRequiredDescription
<input.tlbx>YesPath to the TeaLeaf binary file
-o <output.tl>YesPath for the output text file
--compactNoRemove insignificant whitespace for token-efficient output
--compact-floatsNoStrip .0 from whole-number floats (e.g., 42.042). Re-parsing will produce Int instead of Float for these values

Description

The decompile command:

  1. Opens the binary file and reads the header
  2. Loads the string table and schema table
  3. Reads the section index
  4. Decompresses sections as needed
  5. Reconstructs @struct definitions from the schema table
  6. Writes each section as a key-value pair in text format

Notes

  • Comments are not preserved – comments from the original .tl are stripped during compilation
  • Formatting may differ – the decompiled output uses the default formatting, which may differ from the original source
  • Data is lossless – all values, schemas, and structure are preserved
  • Bytes are lossless – bytes values are written as b"..." hex literals, which round-trip correctly

Compact Mode

The --compact flag removes insignificant whitespace from the output: no spaces after : in key-value pairs, no spaces after , in arrays and objects, no indentation, and no blank lines between sections. This produces a token-efficient format ideal for LLM context windows.

tealeaf decompile data.tlbx -o data_compact.tl --compact

The compact output is semantically identical to the pretty-printed output and round-trips without data loss.

Compact Floats

The --compact-floats flag strips .0 from whole-number floats for additional character savings. This is useful for financial datasets where values like 35934000000.0 become 35934000000.

# Maximum token savings: compact whitespace + compact floats
tealeaf decompile data.tlbx -o data.tl --compact --compact-floats

Trade-off: Re-parsing the output will produce Int instead of Float for whole-number values. See Round-Trip Fidelity for details.

Examples

# Decompile a binary file
tealeaf decompile data.tlbx -o data_recovered.tl

# Decompile with compact output (fewer tokens for LLM input)
tealeaf decompile data.tlbx -o data_compact.tl --compact

# Maximum token savings (compact whitespace + compact floats)
tealeaf decompile data.tlbx -o data_max.tl --compact --compact-floats

# Round-trip verification
tealeaf compile original.tl -o compiled.tlbx
tealeaf decompile compiled.tlbx -o roundtrip.tl
tealeaf compile roundtrip.tl -o roundtrip.tlbx
# compiled.tlbx and roundtrip.tlbx should be equivalent

See Also

  • compile – reverse operation
  • info – inspect without decompiling