compile
Compile a TeaLeaf text file (.tl) to the compact binary format (.tlbx).
Usage
tealeaf compile <input.tl> -o <output.tlbx>
Arguments
| Argument | Required | Description |
|---|---|---|
<input.tl> | Yes | Path to the TeaLeaf text file |
-o <output.tlbx> | Yes | Path for the output binary file |
Description
The compile command:
- Parses the text file (including any
@includedirectives) - Builds the string table (deduplicates all strings)
- Encodes schemas into the schema table
- Encodes each top-level key-value pair as a data section
- Applies per-section ZLIB compression (enabled by default)
- Writes the binary file with the 64-byte header
Compression is applied to sections larger than 64 bytes where the compressed size is less than 90% of the original.
Examples
# Basic compilation
tealeaf compile config.tl -o config.tlbx
# Compile and inspect
tealeaf compile data.tl -o data.tlbx
tealeaf info data.tlbx
Output
On success, prints:
- Input and output file paths
- Input size, output size, and compression ratio (percentage)
Error Cases
| Error | Cause |
|---|---|
| Parse error | Invalid TeaLeaf syntax in input file |
| I/O error | Input file not found or output path not writable |
| Include error | Referenced @include file not found |
See Also
decompile– reverse operationvalidate– check syntax without compiling- Binary Format – binary layout details