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

compile

Compile a TeaLeaf text file (.tl) to the compact binary format (.tlbx).

Usage

tealeaf compile <input.tl> -o <output.tlbx>

Arguments

ArgumentRequiredDescription
<input.tl>YesPath to the TeaLeaf text file
-o <output.tlbx>YesPath for the output binary file

Description

The compile command:

  1. Parses the text file (including any @include directives)
  2. Builds the string table (deduplicates all strings)
  3. Encodes schemas into the schema table
  4. Encodes each top-level key-value pair as a data section
  5. Applies per-section ZLIB compression (enabled by default)
  6. 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

ErrorCause
Parse errorInvalid TeaLeaf syntax in input file
I/O errorInput file not found or output path not writable
Include errorReferenced @include file not found

See Also