Compress, encode, and decode large JSON payloads into a compact, reversible TOON string to reduce token usage in LLM prompts and tool payloads. Use when you...
Use the bundled script scripts/toon_json.py to encode JSON into a compact TOON string and decode it back losslessly.
bash
python3 scripts/toon_json.py encode < input.json
bash
python3 scripts/toon_json.py encode --schema < input.json
bash
python3 scripts/toon_json.py encode --schema --pretty < input.json
bash
python3 scripts/toon_json.py decode < input.toon
bash
python3 scripts/toon_json.py schema < input.json
Prefer --schema when:
Prefer schema-less mode when:
--pretty output on encode to inspect the embedded schema.