Skip to main content
Every token an agent spends reading CLI output is a token it can’t spend reasoning. incur defaults to TOON (Terse Object Oriented Notation)—a format that’s as readable as YAML but with no quoting, no braces, and no redundant syntax.

What is TOON?

TOON is a data serialization format designed for LLMs and humans. It uses up to 60% fewer tokens compared to JSON while remaining easy to parse.

Comparison

JSON output (verbose)
TOON output (concise)

Token Savings

The TOON format eliminates:
  • Quotation marks around keys and strings
  • Braces {} for objects
  • Brackets [] around arrays (replaced with inline headers)
  • Redundant commas between object properties
Result: 40-60% fewer tokens for typical CLI output.

Format Options

incur supports multiple output formats. Switch between them using global options.

Available Formats

FormatDescriptionUse Case
toonTerse Object Oriented Notation (default)Agent consumption, human readability
jsonStandard JSON with 2-space indentationProgrammatic parsing, debugging
yamlYAML formatHuman editing, config files
mdMarkdown tablesDocumentation, reports
jsonlJSON Lines (streaming)Log aggregation, streaming data

Switch Formats

Using --format
Using --json shorthand

Implementation

TOON output is automatic. Just return data from your command:
Default output (TOON)
JSON output

Markdown Tables

The md format automatically renders objects as tables:

Key-Value Tables

Columnar Tables

Arrays of objects become columnar tables:

JSONL for Streaming

When streaming data, use --format jsonl for line-delimited JSON:

Default Format

Set a default format for your CLI:
Users can still override with --format or --json.

Format Source Code

The formatter implementation is in src/Formatter.ts:
Use TOON (the default) for the best token efficiency and agent experience.