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
| Argument | Required | Description |
|---|---|---|
<input.tlbx> | Yes | Path to the TeaLeaf binary file |
-o <output.tl> | Yes | Path for the output text file |
--compact | No | Remove insignificant whitespace for token-efficient output |
--compact-floats | No | Strip .0 from whole-number floats (e.g., 42.0 → 42). Re-parsing will produce Int instead of Float for these values |
Description
The decompile command:
- Opens the binary file and reads the header
- Loads the string table and schema table
- Reads the section index
- Decompresses sections as needed
- Reconstructs
@structdefinitions from the schema table - Writes each section as a key-value pair in text format
Notes
- Comments are not preserved – comments from the original
.tlare 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